[RFC/PATCH,1/3] babeltrace: use AM_TESTS_ENVIRONMENT for tests

Message ID 1477409667-8309-2-git-send-email-nathan_lynch@mentor.com
State New
Delegated to: Jérémie Galarneau
Headers show
Series
  • babeltrace: test harness improvements + new tests
Related show

Commit Message

Nathan Lynch Oct. 25, 2016, 3:34 p.m. UTC
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(+)

Patch

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;