Record the mutation score and the concurrency mutants it misses
src/error.c now scores 81.2%: 238 of 293 mutants killed, 204 by a failing test, 24 by failing to compile, and 10 by hanging the suite -- deleting akerr_mutex_init() or the akerr_initializing re-entry guard deadlocks the first test, which is the right answer for a broken lock. Lock deletions are the one survivor category where surviving does not mean harmless, so measure it rather than assume: rebuilt, the surviving "delete the pool lock" mutant fails tests/err_threads_pool.c in 4 of 10 runs and fails under scripts/thread_test.sh in 5 of 5, with no false positive on the unmutated library. The property assertions alone are a coin flip on a missing lock; the sanitizer run is what holds that line. The harness builds mutants with default CMake options and so never sees it -- TODO item 8. Also warn that a sanitized test binary run by hand does not inherit the halt_on_error CTest gives it, and will print a race and still exit 0. That is how the 5-of-5 above first read as 2 of 5. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -40,8 +40,11 @@ which configures `build/tsan` with `-DAKERR_SANITIZE=thread`, builds the library
|
||||
*and* the tests with it, and runs CTest with ASLR disabled (TSan aborts with an
|
||||
"unexpected memory mapping" on kernels with `vm.mmap_rnd_bits` above 28).
|
||||
`AKERR_SANITIZE` takes any sanitizer list, so `-DAKERR_SANITIZE=address,undefined`
|
||||
works the same way. Under a sanitized build a report fails the test rather than
|
||||
being printed and passed over.
|
||||
works the same way. CTest gives each test `halt_on_error=1`, so a report fails
|
||||
the test rather than being printed and passed over — running a sanitized test
|
||||
binary by hand does **not** inherit that. Set it yourself
|
||||
(`TSAN_OPTIONS=halt_on_error=1 ./build/tsan/test_err_threads_pool`) or the
|
||||
binary can print a race and still exit 0.
|
||||
|
||||
Mutation testing is available through:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user