diff --git a/scripts/memcheck.sh b/scripts/memcheck.sh index df8c9d9..bcb050e 100755 --- a/scripts/memcheck.sh +++ b/scripts/memcheck.sh @@ -49,8 +49,20 @@ rm -f "$AKGL_MEMCHECK_LOG"/MemoryChecker.*.log # The run itself is allowed to fail: a suite that valgrind makes slow enough to # trip an assertion still produced a log worth reading, and the log is what # decides the exit status below. +# +# docs_examples and docs_screenshots are excluded, and the exclusion deserves +# its reasons stated: those two tests are *shell scripts* that drive gcc and +# run the compiled snippets as child processes. Valgrind wraps the test +# command, does not trace children, and so spends the whole test memchecking +# /bin/bash -- 413 of bash's own by-design leaks on the first CI run that got +# this far, and not one byte of libakgl. The snippet programs themselves are +# ordinary akgl consumers whose code paths the suites and example games +# already cover below, under valgrind, as real binaries. A caller's own -E +# overrides this one (ctest takes the last), which is fine: a narrowed run +# chose its scope on purpose. set +e -ctest --test-dir "$AKGL_BUILD_DIR" -T memcheck --output-on-failure "$@" +ctest --test-dir "$AKGL_BUILD_DIR" -T memcheck --output-on-failure \ + -E '^(docs_examples|docs_screenshots)$' "$@" AKGL_CTEST_STATUS=$? set -e