[Bug] Make CTest self-contained from a clean checkout

Open
#1 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
c, cmake

Research direction

Start in CMakeLists.txt around lines 61-73, where the elf_loader, disasm and decompiler tests point at the untracked ${CMAKE_CURRENT_SOURCE_DIR}/hello binary, and at the fixture target near lines 83-89, which does not build hello.c. Check .gitignore:15 to see why hello is ignored. Done when a fresh archive of HEAD configures, builds and passes ctest --test-dir build without any pre-existing hello binary, with the fixture shared by all three tests.

Written by the indexing model from the issue text.

Description

bug good first issue

Summary

ctest fails from a clean checkout because three tests require an ignored hello executable that no CMake target creates.

Evidence

CMakeLists.txt:61-73 registers elf_loader, disasm, and decompiler with:

"${CMAKE_CURRENT_SOURCE_DIR}/hello"

However, hello is ignored by .gitignore:15, only hello.c is tracked, and the build fixture target at CMakeLists.txt:83-89 does not compile hello.c.

I reproduced this by archiving HEAD into a fresh directory and running the documented workflow:

50% tests passed, 3 tests failed out of 6
elf_loader: could not open file: .../hello
disasm: could not open file: .../hello
decompiler: could not open file: .../hello

The roundtrip test passes because it compiles its own temporary fixture, which makes the inconsistency easy to miss when an old ignored hello binary happens to exist locally.

Impact

The README promises that make -C build test works after a fresh configure/build, but a new clone or CI workspace fails three tests before exercising the loader, disassembler, and project decompiler tests.

Expected behavior

The test suite should provision its ELF fixture as part of the build/test graph, or compile a temporary fixture from hello.c for every test that needs a binary. A clean checkout should pass the documented test command without relying on ignored files left by a previous local build.

Acceptance criteria

  • Remove the dependency on an untracked hello executable.
  • Verify cmake -S . -B build && cmake --build build && ctest --test-dir build in a clean checkout.
  • Keep the fixture setup deterministic and shared by the loader, disassembly, and decompiler tests.
Dominant language
C++
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TiElixir/caraxes

All issues in TiElixir/caraxes

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.