From: Christian Babeux Date: Fri, 22 Feb 2013 02:52:04 +0000 (-0500) Subject: Tests: Add runner script for kernel regression tests X-Git-Tag: v2.2.0-rc1~60^2~17 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=4c95078aa5a1ac5d63ac0b0ffe4fac2be1b8ca47 Tests: Add runner script for kernel regression tests Also remove the old runner scripts. Signed-off-by: Christian Babeux --- diff --git a/tests/regression/kernel/Makefile.am b/tests/regression/kernel/Makefile.am index 3c479363b..cff432dfc 100644 --- a/tests/regression/kernel/Makefile.am +++ b/tests/regression/kernel/Makefile.am @@ -1,6 +1 @@ -AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/utils -g -Wall -AM_LDFLAGS = -lurcu -lurcu-cds - -EXTRA_DIST = runall.sh run-kernel-tests.sh test_all_events test_event_basic - - +EXTRA_DIST = run.sh test_event_basic test_all_events diff --git a/tests/regression/kernel/run-kernel-tests.sh b/tests/regression/kernel/run-kernel-tests.sh deleted file mode 100755 index ec2ceaf91..000000000 --- a/tests/regression/kernel/run-kernel-tests.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -SESSIOND_BIN="lttng-sessiond" -CURDIR=$(dirname $0) -TESTDIR=$CURDIR/../.. - -source $TESTDIR/utils/utils.sh - -tmpdir=`mktemp -d` -tests=( $CURDIR/kernel_event_basic $CURDIR/kernel_all_events_basic ) -exit_code=0 - -function start_tests () -{ - for bin in ${tests[@]}; - do - if [ ! -e $bin ]; then - echo -e "$bin not found, passing" - continue - fi - - start_lttng_sessiond - - ./$bin $tmpdir - # Test must return 0 to pass. - if [ $? -ne 0 ]; then - exit_code=1 - stop_lttng_sessiond - break - fi - stop_lttng_sessiond - done - - # Cleaning up - rm -rf $tmpdir -} - -function check_lttng_modules () -{ - local out=`ls /lib/modules/$(uname -r)/extra | grep lttng` - if [ -z "$out" ]; then - echo "LTTng modules not detected. Aborting kernel tests!" - echo "" - # Exit status 0 so the tests can continue - exit 0 - fi -} - - -TEST_DESC="Testing Kernel tracer" - -print_test_banner "$TEST_DESC" - -# Detect lttng-modules installed -check_lttng_modules - -start_tests - -exit $exit_code diff --git a/tests/regression/kernel/run.sh b/tests/regression/kernel/run.sh new file mode 100755 index 000000000..fe042e412 --- /dev/null +++ b/tests/regression/kernel/run.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# +# Copyright (C) 2013 - Christian Babeux +# +# 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/test_event_basic + $DIR/test_all_events ) + +#### END TESTS HERE #### + +opts=("$@") +run_tests tests[@] opts[@] diff --git a/tests/regression/kernel/runall.sh b/tests/regression/kernel/runall.sh deleted file mode 100755 index 2b76e5355..000000000 --- a/tests/regression/kernel/runall.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -DIR=$(dirname $0) - -tests=( $DIR/run-kernel-tests.sh ) -exit_code=0 - -function start_tests () -{ - for bin in ${tests[@]}; - do - ./$bin - # Test must return 0 to pass. - if [ $? -ne 0 ]; then - exit_code=1 - break - fi - done -} - -start_tests - -exit $exit_code