From: Christian Babeux Date: Fri, 22 Feb 2013 03:46:23 +0000 (-0500) Subject: Tests: Convert the UST multi-session test output to TAP X-Git-Tag: v2.2.0-rc1~60^2~10 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c1f5d7d5a1b8c6458abe26ce6912c292045ee2a7;p=lttng-tools.git Tests: Convert the UST multi-session test output to TAP Signed-off-by: Christian Babeux --- diff --git a/tests/regression/ust/multi-session/test_multi_session b/tests/regression/ust/multi-session/test_multi_session index 18e220dcf..ffe8355a8 100755 --- a/tests/regression/ust/multi-session/test_multi_session +++ b/tests/regression/ust/multi-session/test_multi_session @@ -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)