From 2b1745e140dd944809ca88572517b936e40a1bc3 Mon Sep 17 00:00:00 2001 From: Christian Babeux Date: Tue, 16 Oct 2012 14:33:23 -0400 Subject: [PATCH] Tests: Add filtering tests to configure Add filtering folder to top-level Makefile.am. Also add a runall script to run all filtering tests. Signed-off-by: Christian Babeux Signed-off-by: David Goulet --- 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 cb5dc3891..fbaae6f86 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 173dce21f..56eda3ada 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 a3bf8666d..e1e715da4 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 000000000..c92e39988 --- /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 0ad7cf17a..b2be91c6c 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 -- 2.34.1