You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A test-directory program named as the package's own bin target is written over that program ([test] programs = "directory") #1028
A package whose bin target and whose test directory have the same name gets one output path for two different programs. Whichever of mcpp build and mcpp test ran last decides what the file is; nothing is diagnosed.
src/main.cpp prints the program; tests/collide/one_test.cpp holds one mtest case.
$ mcpp build && target/x86_64-linux-gnu/<hash>/bin/collide
the program
$ mcpp test # 1 passed
$ target/x86_64-linux-gnu/<hash>/bin/collide
ok collide.one/one # the file is now the test program
$ mcpp build # relinks (0.67 s) — the program again
Why it matters
Anything that finds a built program by its path (a build rule's tool, a benchmark harness, a packaging step, CI's "build, test, then run the binary") runs the test program after mcpp test, with no error — here a timing harness measured the mtest runner printing no such case in 0 ms instead of the tool.
mcpp build after mcpp test (and the reverse) relinks every time, so the two commands never both find their output current.
The natural layout produces it: a tool package x with the program x and tests/x/ (two packages of one workspace here had it).
Expected
Either the two outputs do not share a path (test programs under their own directory or with a suffix, as file-per-program tests have _test), or planning refuses the manifest and names both targets.
Activity