[lttng-dev] [RFC/PATCH 1/3] babeltrace: use AM_TESTS_ENVIRONMENT for tests

Nathan Lynch nathan_lynch at mentor.com
Tue Oct 25 15:34:25 UTC 2016


Export convenient variables from the build system into the runtime
environment of the testcases, so that fewer test scripts need to be
generated at configure time using Autoconf variable substitutions.

This makes it less tedious to add and work on testcases in script
form.

The user can supplement or override settings in AM_TESTS_ENVIRONMENT
by using TESTS_ENVIRONMENT on the command line.

Signed-off-by: Nathan Lynch <nathan_lynch at mentor.com>
---
 tests/Makefile.am | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index eda9f2351310..28cb2eca7770 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -29,3 +29,15 @@ endif
 if USE_PYTHON
 TESTS += bin/intersection/test_multi_trace_intersection.py
 endif
+
+AM_TESTS_ENVIRONMENT = \
+	abs_top_srcdir='$(abs_top_srcdir)'; export abs_top_srcdir ; \
+	abs_top_builddir='$(abs_top_builddir)'; export abs_top_builddir ; \
+	TAPLIB='$(abs_top_srcdir)'/tests/utils/tap/tap.sh ; export TAPLIB ; \
+	CTF_TRACES='$(abs_top_srcdir)'/tests/ctf-traces ; export CTF_TRACES ; \
+	BABELTRACE_BIN='$(abs_top_builddir)'/converter/babeltrace ; \
+	export BABELTRACE_BIN ; \
+	DEBUG_INFO_DATA='$(abs_top_srcdir)'/tests/debug-info-data ; \
+	export DEBUG_INFO_DATA ; \
+	GREP='$(GREP)' ; export GREP; \
+	SED='$(SED)' ; export SED;
-- 
2.7.4



More information about the lttng-dev mailing list