Mark tests which require debug symbols

Milton Vandersloot miltonrobertvandersloot1412 at protonmail.com
Sun Apr 5 01:38:53 PDT 2020


Dear notmuch Developers

The test suite fails some tests when the executable is not build with debug symbols (-g).
To run the test suite completely notmuch has to be (re)compiled with debug symbols.
However, in this scenario the tested code/library (with debug symbols) is not the same as used later (without debug symbols).
There are numerous reasons for not wanting debug symbols in the production executable which I won't dive into.

Instead of requiring debug symbols to be present and failing the test suite, it would be nice if the test suite would skip the affected tests like it does when e.g. Emacs or GDB is missing.
Below a sed script which marks the test needing debug symbols. It uses the (I believe sort of private) function test_subtest_missing_external_prereq_ as also done by T530-upgrade.sh and T395-ruby.sh.

Regards
Milton

# Mark tests properly for skipping which need debug symbols.
missing_debug_symbols="test_subtest_missing_external_prereq_['Not compiled with debug symbols']=t"
sed -e "/test_begin_subtest [\"']notmuch is compiled with debugging symbols[\"']/ a ${missing_debug_symbols}" \
	-i test/T000-basic.sh || die
sed -e "/test_begin_subtest [\"']error message from query_search_messages[\"']/ a ${missing_debug_symbols}" \
	-i test/T060-count.sh || die
for testname in \
	'EXIT_FAILURE when index_file returns $code' \
	'success exit with --keep when index_file returns $code' \
	'EX_TEMPFAIL when index_file returns $code' \
	'success exit with --keep when index_file returns $code' \
	; do
	sed -e "/test_begin_subtest [\"']${testname}[\"']/ a ${missing_debug_symbols}" \
		-i test/T070-insert.sh \
		|| die "Marking test ${testname} for skipping."
done



More information about the notmuch mailing list