From c1f5d7d5a1b8c6458abe26ce6912c292045ee2a7 Mon Sep 17 00:00:00 2001 From: Christian Babeux Date: Thu, 21 Feb 2013 22:46:23 -0500 Subject: [PATCH] Tests: Convert the UST multi-session test output to TAP Signed-off-by: Christian Babeux --- .../ust/multi-session/test_multi_session | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) 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) -- 2.34.1