Mark tests which require debug symbols

classic Classic list List threaded Threaded
2 messages Options
Milton Vandersloot Milton Vandersloot
Reply | Threaded
Open this post in threaded view
|

Mark tests which require debug symbols

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

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: Mark tests which require debug symbols

Milton Vandersloot <[hidden email]> writes:

> 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.

Is there some reason you can't strip the binaries before installing
them? That's what we do in Debian.

d
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch