Tests: Add runner script for tools regression tests
authorChristian Babeux <christian.babeux@efficios.com>
Fri, 22 Feb 2013 04:26:52 +0000 (23:26 -0500)
committerChristian Babeux <christian.babeux@efficios.com>
Fri, 22 Feb 2013 18:00:32 +0000 (13:00 -0500)
Also remove old the old runner scripts.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
tests/regression/tools/Makefile.am
tests/regression/tools/filtering/Makefile.am
tests/regression/tools/filtering/runall [deleted file]
tests/regression/tools/health/Makefile.am
tests/regression/tools/health/runall [deleted file]
tests/regression/tools/run.sh [new file with mode: 0755]
tests/regression/tools/runall.sh [deleted file]
tests/regression/tools/streaming/Makefile.am
tests/regression/tools/streaming/runall [deleted file]

index ccfbd34ac0e23f6f872bc5f3665220381a4f2b22..9065a3764882009828b3424bf88c3383627e7b09 100644 (file)
@@ -1,6 +1,3 @@
 SUBDIRS = streaming filtering health
 
-AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/utils -g -Wall
-AM_LDFLAGS = -lurcu
-
-EXTRA_DIST = runall.sh
+EXTRA_DIST = run.sh
index 23bce0005c3ffc72cd605123c56192b8e8431261..5629da2440400195d0038b8a785033b086c5eacb 100644 (file)
@@ -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 = runall test_unsupported_op test_invalid_filter test_valid_filter babelstats.pl
-EXTRA_DIST = runall test_unsupported_op test_invalid_filter test_valid_filter babelstats.pl
+noinst_SCRIPTS = test_unsupported_op test_invalid_filter test_valid_filter babelstats.pl
+EXTRA_DIST = test_unsupported_op test_invalid_filter test_valid_filter babelstats.pl
diff --git a/tests/regression/tools/filtering/runall b/tests/regression/tools/filtering/runall
deleted file mode 100755 (executable)
index cda9799..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-
-DIR=$(dirname $0)
-
-tests=( $DIR/test_unsupported_op $DIR/test_invalid_filter $DIR/test_valid_filter )
-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
index 1a0a8f6d12a915f392e4dd61810f542b3f9b2787..94e54dfaf0655d6cba9cb21ba7c87c6eef494e98 100644 (file)
@@ -36,6 +36,3 @@ health_check_SOURCES = health_check.c $(UTILS)
 health_check_LDADD = $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \
                     $(top_builddir)/src/common/libcommon.la
 endif
-
-noinst_SCRIPTS = runall
-EXTRA_DIST = runall
diff --git a/tests/regression/tools/health/runall b/tests/regression/tools/health/runall
deleted file mode 100755 (executable)
index 0ed0c8e..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-
-DIR=$(dirname $0)
-
-tests=( $DIR/test_thread_exit $DIR/test_thread_stall $DIR/test_tp_fail)
-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
-}
-
-if [ "$(id -u)" != "0" ]; then
-       echo -e "Need root for health test."
-       exit 0
-fi
-
-start_tests
-
-exit $exit_code
diff --git a/tests/regression/tools/run.sh b/tests/regression/tools/run.sh
new file mode 100755 (executable)
index 0000000..63154ac
--- /dev/null
@@ -0,0 +1,40 @@
+#!/bin/bash
+#
+# Copyright (C) 2013 - Christian Babeux <christian.babeux@efficios.com>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; only version 2
+# of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+
+DIR=$(dirname $0)
+TESTDIR=$DIR/../..
+source $TESTDIR/utils/runner.sh
+
+#### ADD TESTS HERE ####
+
+tests=( $DIR/filtering/test_invalid_filter
+       $DIR/filtering/test_unsupported_op
+       $DIR/filtering/test_valid_filter
+       $DIR/health/test_thread_exit
+       $DIR/health/test_thread_stall
+       $DIR/health/test_tp_fail
+       $DIR/streaming/test_kernel
+       $DIR/streaming/test_ust
+       $DIR/streaming/test_uri_switch
+       $DIR/streaming/test_high_throughput_limits )
+
+#### END TESTS HERE ####
+
+opts=("$@")
+run_tests tests[@] opts[@]
diff --git a/tests/regression/tools/runall.sh b/tests/regression/tools/runall.sh
deleted file mode 100755 (executable)
index 5d505d9..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-
-DIR=$(dirname $0)
-
-tests=( $DIR/streaming/runall $DIR/health/runall $DIR/filtering/runall )
-
-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
index 1949f669b3687a494a20427056f9ffa809da489c..2dbb4d5ab48f45ce04ee937e40cc6ab8b80857b2 100644 (file)
@@ -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 = runall test_ust test_kernel test_uri_switch test_high_throughput_limits
-EXTRA_DIST = runall test_ust test_kernel test_uri_switch test_high_throughput_limits
+noinst_SCRIPTS = test_ust test_kernel test_uri_switch test_high_throughput_limits
+EXTRA_DIST = test_ust test_kernel test_uri_switch test_high_throughput_limits
diff --git a/tests/regression/tools/streaming/runall b/tests/regression/tools/streaming/runall
deleted file mode 100755 (executable)
index 809449b..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-
-DIR=$(dirname $0)
-
-tests=( $DIR/test_uri_switch $DIR/test_kernel $DIR/test_ust )
-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
This page took 0.029626 seconds and 4 git commands to generate.