Observed issue
==============
During CI runs, builds may timeout or be killed for another reason.
Those tests logs are deleted and cannot be checked for diagnostic
information, warnings, or errors.
Cause
=====
By default, the test log for the currently running test is deleted by
automake so that subsequent invocations of `make check` will re-run the test.
Solution
========
Add a disable flag `--disable-precious-tests` and set
`PRECIOUS_TESTS` to true by default when configuring lttng-tools. When
`PRECIOUS_TOOLS` is set, all test logs in `tests/regression` will be
marked as `.PRECIOUS` and subsequently not deleted when interrupted.
Known drawbacks
===============
This could make interrupting a test and re-running during test
development more of a hassle.
References
==========
[1]: https://www.gnu.org/software/make/manual/html_node/Special-Targets.html
[2]: https://automake.gnu.narkive.com/1TjEGbH2/delete-on-error-test-suite-log-and-precious
Change-Id: I08b4a1bb29eb609827cc1c047f141f94b210effe
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
AM_CONDITIONAL([TEST_SDT_UPROBE], [test "$test_sdt_uprobe" = "yes"])
+AC_ARG_ENABLE(
+ [precious-tests],
+ AS_HELP_STRING(
+ [--disable-precious-tests],
+ [Delete log files for interrupted tests]
+ ),
+ [precious_tests=$enableval],
+ [precious_tests=yes]
+)
+
+AM_CONDITIONAL([PRECIOUS_TESTS], [test x$precious_tests = xyes])
+
AC_ARG_ENABLE([lib-lttng-ctl], AS_HELP_STRING([--disable-lib-lttng-ctl],
[Disable the build of liblttng-ctl (only possible if no binaries that depend on it are built)]))
ust/ust-dl/test_ust-dl \
ust/type-declarations/test_type_declarations
endif
+
+if PRECIOUS_TESTS
+.PRECIOUS: $(TEST_LOGS)
+endif