[lttng-dev] [PATCH lttng-tools 5/5] Tests: Add filtering tests to configure

Christian Babeux christian.babeux at efficios.com
Tue Oct 16 14:33:23 EDT 2012


Add filtering folder to top-level Makefile.am.
Also add a runall script to run all filtering tests.

Signed-off-by: Christian Babeux <christian.babeux at efficios.com>
---
 configure.ac                      |  1 +
 tests/tools/Makefile.am           |  2 +-
 tests/tools/filtering/Makefile.am |  4 ++--
 tests/tools/filtering/runall      | 28 ++++++++++++++++++++++++++++
 tests/tools/runall.sh             |  2 +-
 5 files changed, 33 insertions(+), 4 deletions(-)
 create mode 100755 tests/tools/filtering/runall

diff --git a/configure.ac b/configure.ac
index cb5dc38..fbaae6f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -288,6 +288,7 @@ AC_CONFIG_FILES([
 	tests/kernel/Makefile
 	tests/tools/Makefile
 	tests/tools/streaming/Makefile
+	tests/tools/filtering/Makefile
 	tests/tools/health/Makefile
 	tests/ust/Makefile
 	tests/ust/nprocesses/Makefile
diff --git a/tests/tools/Makefile.am b/tests/tools/Makefile.am
index 173dce2..56eda3a 100644
--- a/tests/tools/Makefile.am
+++ b/tests/tools/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = streaming health
+SUBDIRS = streaming filtering health
 
 AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests -g -Wall
 AM_LDFLAGS = -lurcu -lurcu-cds
diff --git a/tests/tools/filtering/Makefile.am b/tests/tools/filtering/Makefile.am
index a3bf866..e1e715d 100644
--- a/tests/tools/filtering/Makefile.am
+++ b/tests/tools/filtering/Makefile.am
@@ -14,5 +14,5 @@ gen_ust_events_SOURCES = gen-ust-events.c tp.c tp.h
 gen_ust_events_LDADD = -llttng-ust
 endif
 
-noinst_SCRIPTS = unsupported-ops invalid-filters valid-filters babelstats.pl
-EXTRA_DIST = unsupported-ops invalid-filters valid-filters babelstats.pl
+noinst_SCRIPTS = runall unsupported-ops invalid-filters valid-filters babelstats.pl
+EXTRA_DIST = runall unsupported-ops invalid-filters valid-filters babelstats.pl
diff --git a/tests/tools/filtering/runall b/tests/tools/filtering/runall
new file mode 100755
index 0000000..c92e399
--- /dev/null
+++ b/tests/tools/filtering/runall
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+DIR=$(dirname $0)
+
+tests=( $DIR/unsupported-ops $DIR/invalid-filters $DIR/valid-filters )
+exit_code=0
+
+function start_tests ()
+{
+	for bin in ${tests[@]};
+	do
+		if [ ! -e $bin ]; then
+			echo -e "$bin not found, passing"
+			continue
+		fi
+
+		./$bin
+		# Test must return 0 to pass.
+		if [ $? -ne 0 ]; then
+			exit_code=1
+			break
+		fi
+	done
+}
+
+start_tests
+
+exit $exit_code
diff --git a/tests/tools/runall.sh b/tests/tools/runall.sh
index 0ad7cf1..b2be91c 100755
--- a/tests/tools/runall.sh
+++ b/tests/tools/runall.sh
@@ -3,7 +3,7 @@
 DIR=$(dirname $0)
 
 tests=( $DIR/test_kernel_data_trace $DIR/test_sessions $DIR/test_ust_data_trace \
-		$DIR/streaming/runall $DIR/health/runall )
+		$DIR/streaming/runall $DIR/health/runall $DIR/filtering/runall)
 
 exit_code=0
 
-- 
1.7.12.2




More information about the lttng-dev mailing list