Test Runner Limitations
Issue: Multiple main() Function
Definitions
The D3-TUI test infrastructure contains three runner files with
main(): - src/tests/test_runner.c — Contains
int main(int argc, char **argv) -
src/tests/test_runner_simple.c — Contains
int main(void) -
src/tests/simple_test_runner.c — Contains
int main(int argc, char** argv)
Constraint: These files cannot be linked together
into a single executable due to the C language requirement that a
program have exactly one main() function entry point.
Current State: - ✅ Individual test files
(test_terminal.c, test_arc_001.c, etc.) live
in src/tests/ - ✅ test_runner.c and
test_runner_simple.c now include all 19 test suites
(including smoke_test) - ❌ There is currently no host-side
test build target in the canonical Makefile - ❌ The
runners cannot be linked together into a single executable - ⚠️ The root
tests/ directory is a structural placeholder; see
tests/README.md
Workaround: - Compile individual test files manually
against src/d3tui/test/test_framework.c when a host
compiler is available. - Meta-runners remain as object files only for
potential future refactoring.
Refactoring Options (for future consideration): 1.
Option A: Rename one main() to a different
entry point (e.g., test_runner_main()) and provide a thin
wrapper 2. Option B: Accept current limitation as
pragmatic (recommended - no functional impact) 3. Option
C: Merge both runners into a single file with conditional
compilation
Decision: Option B currently selected - the limitation has no impact on test coverage or build system functionality.