Tests: Convert the UST multi-session test output to TAP
authorChristian Babeux <christian.babeux@efficios.com>
Fri, 22 Feb 2013 03:46:23 +0000 (22:46 -0500)
committerChristian Babeux <christian.babeux@efficios.com>
Fri, 22 Feb 2013 18:00:28 +0000 (13:00 -0500)
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
tests/regression/ust/multi-session/test_multi_session

index 18e220dcf0e602f99e4786e56a00cc178429bebe..ffe8355a8bfb351709713ceccdcac9bfa78e2c99 100755 (executable)
@@ -21,14 +21,14 @@ TESTDIR=$CURDIR/../../..
 NR_ITER=100
 SESSION_NAME="multi-session"
 EVENT_NAME="ust_gen_nevents:tptest"
+NUM_TESTS=28
 
 source $TESTDIR/utils/utils.sh
 
 print_test_banner "$TEST_DESC"
 
 if [ ! -x "$CURDIR/gen-nevents" ]; then
-       echo -e "No UST nevents binary detected. Passing."
-       exit 0
+       BAIL_OUT "No UST nevents binary detected."
 fi
 
 # MUST set TESTDIR before calling those functions
@@ -43,29 +43,28 @@ test_multi_session() {
                start_lttng_tracing "$SESSION_NAME-$i"
        done
 
-       echo -n "Starting application generating $NR_ITER events... "
        ./$CURDIR/gen-nevents $NR_ITER &
-       print_ok
+       ok $? "Start application to generate $NR_ITER events"
 
        # At least hit one event
-       echo -n "Waiting for events to record "
        while [ -n "$(pidof gen-nevents)" ]; do
-               echo -n "."
                sleep 0.1
        done
-       print_ok
+
+       pass "Wait for events to record"
 
        for i in `seq 0 3`; do
                stop_lttng_tracing "$SESSION_NAME-$i"
                destroy_lttng_session "$SESSION_NAME-$i"
                out=$(babeltrace "$TRACE_PATH/$i" | grep "$EVENT_NAMEi$i" | wc -l)
                if [ $out -ne $NR_ITER ]; then
-                       echo -n "No event found. Suppose to have at least one... "
-                       print_fail
+                       fail "Trace validation of $SESSION_NAME-$i"
+                       diag "No events found."
                        out=1
+                       break
                else
-                       echo -n "Found $out event(s) for $SESSION_NAME-$i. Coherent... "
-                       print_ok
+                       pass "Trace validation of $SESSION_NAME-$i"
+                       diag "Found $out event(s) for $SESSION_NAME-$i."
                        out=0
                fi
        done
@@ -75,6 +74,8 @@ test_multi_session() {
 
 # MUST set TESTDIR before calling those functions
 
+plan_tests $NUM_TESTS
+
 start_lttng_sessiond
 
 TRACE_PATH=$(mktemp -d)
This page took 0.027056 seconds and 4 git commands to generate.