From the Test::Harness::TAP documentation [1]:
The plan tells how many tests will be run, or how many tests have
run. It's a check that the test file hasn't stopped prematurely.
It must appear once, whether at the beginning or end of the output.
The TAP plan *must* be the first line of output of any tests. Currently,
most of the tests output their description and then the TAP plan. This
can cause issues while parsing the test output for "strict" TAP parser
such as the one used in the prove tool.
This commit ensure that the first line outputted by any tests is the TAP
plan.
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
24 files changed:
source $TESTDIR/utils/utils.sh
source $TESTDIR/utils/utils.sh
-print_test_banner "$TEST_DESC"
-
function test_all_event()
{
TRACE_PATH=$(mktemp -d)
function test_all_event()
{
TRACE_PATH=$(mktemp -d)
# MUST set TESTDIR before calling those functions
plan_tests $NUM_TESTS
# MUST set TESTDIR before calling those functions
plan_tests $NUM_TESTS
+print_test_banner "$TEST_DESC"
+
if [ "$(id -u)" == "0" ]; then
isroot=1
else
if [ "$(id -u)" == "0" ]; then
isroot=1
else
source $TESTDIR/utils/utils.sh
source $TESTDIR/utils/utils.sh
-print_test_banner "$TEST_DESC"
-
function test_event_basic()
{
TRACE_PATH=$(mktemp -d)
function test_event_basic()
{
TRACE_PATH=$(mktemp -d)
# MUST set TESTDIR before calling those functions
plan_tests $NUM_TESTS
# MUST set TESTDIR before calling those functions
plan_tests $NUM_TESTS
+print_test_banner "$TEST_DESC"
+
if [ "$(id -u)" == "0" ]; then
isroot=1
else
if [ "$(id -u)" == "0" ]; then
isroot=1
else
source $TESTDIR/utils/utils.sh
source $TESTDIR/utils/utils.sh
-print_test_banner "$TEST_DESC"
-
function enable_ust_lttng_event_filter
{
sess_name="$1"
function enable_ust_lttng_event_filter
{
sess_name="$1"
+print_test_banner "$TEST_DESC"
+
IFS=$'\n'
INVALID_FILTERS=(
# Unsupported ops
IFS=$'\n'
INVALID_FILTERS=(
# Unsupported ops
NUM_TESTS=46
source $TESTDIR/utils/utils.sh
NUM_TESTS=46
source $TESTDIR/utils/utils.sh
-print_test_banner "$TEST_DESC"
-
function enable_ust_lttng_event_filter_unsupported
{
sess_name=$1
function enable_ust_lttng_event_filter_unsupported
{
sess_name=$1
+print_test_banner "$TEST_DESC"
+
# Unsupported operators
OP_STR=("MUL" "DIV" "MOD" "PLUS" "MINUS" "LSHIFT" "RSHIFT"
"BIN_AND" "BIN_OR" "BIN_XOR" "UNARY_BIN_NOT")
# Unsupported operators
OP_STR=("MUL" "DIV" "MOD" "PLUS" "MINUS" "LSHIFT" "RSHIFT"
"BIN_AND" "BIN_OR" "BIN_XOR" "UNARY_BIN_NOT")
source $TESTDIR/utils/utils.sh
source $TESTDIR/utils/utils.sh
-print_test_banner "$TEST_DESC"
-
if [ ! -x "$CURDIR/$BIN_NAME" ]; then
BAIL_OUT "No UST nevents binary detected."
fi
if [ ! -x "$CURDIR/$BIN_NAME" ]; then
BAIL_OUT "No UST nevents binary detected."
fi
+print_test_banner "$TEST_DESC"
+
IFS=$'\n'
issue_356_filter="intfield > 0 && intfield > 1 && "
IFS=$'\n'
issue_356_filter="intfield > 0 && intfield > 1 && "
source $TESTDIR/utils/utils.sh
source $TESTDIR/utils/utils.sh
-print_test_banner "$TEST_DESC"
-
if [ ! -f "$CURDIR/$SESSIOND_PRELOAD" ]; then
BAIL_OUT "libhealthexit.so not available for this test."
fi
if [ ! -f "$CURDIR/$SESSIOND_PRELOAD" ]; then
BAIL_OUT "libhealthexit.so not available for this test."
fi
+print_test_banner "$TEST_DESC"
+
THREAD=("LTTNG_THREAD_MANAGE_CLIENTS"
"LTTNG_THREAD_MANAGE_APPS"
"LTTNG_THREAD_REG_APPS")
THREAD=("LTTNG_THREAD_MANAGE_CLIENTS"
"LTTNG_THREAD_MANAGE_APPS"
"LTTNG_THREAD_REG_APPS")
source $TESTDIR/utils/utils.sh
source $TESTDIR/utils/utils.sh
-print_test_banner "$TEST_DESC"
-
if [ ! -f "$CURDIR/$SESSIOND_PRELOAD" ]; then
BAIL_OUT "libhealthstall.so not available for this test."
fi
if [ ! -f "$CURDIR/$SESSIOND_PRELOAD" ]; then
BAIL_OUT "libhealthstall.so not available for this test."
fi
+print_test_banner "$TEST_DESC"
+
THREAD=("LTTNG_THREAD_MANAGE_CLIENTS"
"LTTNG_THREAD_MANAGE_APPS"
# This thread is a little bit tricky to stall,
THREAD=("LTTNG_THREAD_MANAGE_CLIENTS"
"LTTNG_THREAD_MANAGE_APPS"
# This thread is a little bit tricky to stall,
source $TESTDIR/utils/utils.sh
source $TESTDIR/utils/utils.sh
-print_test_banner "$TEST_DESC"
-
if [ ! -f "$CURDIR/$SESSIOND_PRELOAD" ]; then
BAIL_OUT "libhealthtpfail.so not available for this test."
fi
if [ ! -f "$CURDIR/$SESSIOND_PRELOAD" ]; then
BAIL_OUT "libhealthtpfail.so not available for this test."
fi
+print_test_banner "$TEST_DESC"
+
THREAD=("LTTNG_THREAD_MANAGE_CLIENTS"
"LTTNG_THREAD_MANAGE_APPS")
THREAD=("LTTNG_THREAD_MANAGE_CLIENTS"
"LTTNG_THREAD_MANAGE_APPS")
source $TESTDIR/utils/utils.sh
source $TESTDIR/utils/utils.sh
-print_test_banner "$TEST_DESC"
-
if [ ! -x "$CURDIR/$BIN_NAME" ]; then
BAIL_OUT "No UST nevents binary detected."
fi
if [ ! -x "$CURDIR/$BIN_NAME" ]; then
BAIL_OUT "No UST nevents binary detected."
fi
+print_test_banner "$TEST_DESC"
+
if [ "$(id -u)" == "0" ]; then
isroot=1
else
if [ "$(id -u)" == "0" ]; then
isroot=1
else
source $TESTDIR/utils/utils.sh
source $TESTDIR/utils/utils.sh
-print_test_banner "$TEST_DESC"
-
# LTTng kernel modules check
out=`ls /lib/modules/$(uname -r)/extra | grep lttng`
if [ -z "$out" ]; then
# LTTng kernel modules check
out=`ls /lib/modules/$(uname -r)/extra | grep lttng`
if [ -z "$out" ]; then
+print_test_banner "$TEST_DESC"
+
if [ "$(id -u)" == "0" ]; then
isroot=1
else
if [ "$(id -u)" == "0" ]; then
isroot=1
else
source $TESTDIR/utils/utils.sh
source $TESTDIR/utils/utils.sh
-print_test_banner "$TEST_DESC"
-
if [ ! -x "$CURDIR/$BIN_NAME" ]; then
BAIL_OUT "No UST nevents binary detected."
fi
if [ ! -x "$CURDIR/$BIN_NAME" ]; then
BAIL_OUT "No UST nevents binary detected."
fi
+print_test_banner "$TEST_DESC"
+
start_lttng_relayd "-o $TRACE_PATH"
start_lttng_sessiond
start_lttng_relayd "-o $TRACE_PATH"
start_lttng_sessiond
source $TESTDIR/utils/utils.sh
source $TESTDIR/utils/utils.sh
-print_test_banner "$TEST_DESC"
-
if [ ! -x "$CURDIR/gen-nevents" ]; then
BAIL_OUT "No UST nevents binary detected."
fi
if [ ! -x "$CURDIR/gen-nevents" ]; then
BAIL_OUT "No UST nevents binary detected."
fi
# MUST set TESTDIR before calling those functions
plan_tests $NUM_TESTS
# MUST set TESTDIR before calling those functions
plan_tests $NUM_TESTS
+print_test_banner "$TEST_DESC"
+
start_lttng_sessiond
diag "Start application BEFORE tracing was started"
start_lttng_sessiond
diag "Start application BEFORE tracing was started"
source $TESTDIR/utils/utils.sh
source $TESTDIR/utils/utils.sh
-print_test_banner "$TEST_DESC"
-
if [ ! -x "$CURDIR/gen-nevents" ]; then
BAIL_OUT "No UST nevents binary detected."
fi
if [ ! -x "$CURDIR/gen-nevents" ]; then
BAIL_OUT "No UST nevents binary detected."
fi
# MUST set TESTDIR before calling those functions
plan_tests $NUM_TESTS
# MUST set TESTDIR before calling those functions
plan_tests $NUM_TESTS
+print_test_banner "$TEST_DESC"
+
TESTS=(
"test_before_app"
"test_after_app"
TESTS=(
"test_before_app"
"test_after_app"
source $TESTDIR/utils/utils.sh
source $TESTDIR/utils/utils.sh
-print_test_banner "$TEST_DESC"
-
if [ ! -x "$CURDIR/$BIN_NAME" ]; then
BAIL_OUT "No UST nevents binary detected."
fi
if [ ! -x "$CURDIR/$BIN_NAME" ]; then
BAIL_OUT "No UST nevents binary detected."
fi
+print_test_banner "$TEST_DESC"
+
start_lttng_sessiond
create_lttng_session $SESSION_NAME $TRACE_PATH
start_lttng_sessiond
create_lttng_session $SESSION_NAME $TRACE_PATH
source $TESTDIR/utils/utils.sh
source $TESTDIR/utils/utils.sh
-print_test_banner "$TEST_DESC"
-
if [ ! -x "$CURDIR/$BIN_NAME" ]; then
BAIL_OUT "No UST nevents binary detected."
fi
if [ ! -x "$CURDIR/$BIN_NAME" ]; then
BAIL_OUT "No UST nevents binary detected."
fi
+print_test_banner "$TEST_DESC"
+
start_lttng_sessiond
create_lttng_session $SESSION_NAME $TRACE_PATH
start_lttng_sessiond
create_lttng_session $SESSION_NAME $TRACE_PATH
source $TESTDIR/utils/utils.sh
source $TESTDIR/utils/utils.sh
-print_test_banner "$TEST_DESC"
-
if [ ! -x "$CURDIR/gen-nevents" ]; then
BAIL_OUT "No UST nevents binary detected."
fi
if [ ! -x "$CURDIR/gen-nevents" ]; then
BAIL_OUT "No UST nevents binary detected."
fi
+print_test_banner "$TEST_DESC"
+
start_lttng_sessiond
TRACE_PATH=$(mktemp -d)
start_lttng_sessiond
TRACE_PATH=$(mktemp -d)
source $TESTDIR/utils/utils.sh
source $TESTDIR/utils/utils.sh
-print_test_banner "$TEST_DESC"
-
if [ ! -x "$CURDIR/$TEST_BIN_NAME" ]; then
BAIL_OUT "No UST $TEST_BIN_NAME binary detected."
fi
if [ ! -x "$CURDIR/$TEST_BIN_NAME" ]; then
BAIL_OUT "No UST $TEST_BIN_NAME binary detected."
fi
+print_test_banner "$TEST_DESC"
+
start_lttng_sessiond
# Start test for 1000 seconds
start_lttng_sessiond
# Start test for 1000 seconds
source $TESTDIR/utils/utils.sh
source $TESTDIR/utils/utils.sh
-print_test_banner "$TEST_DESC"
-
if [ ! -x "$CURDIR/demo/demo" ]; then
BAIL_OUT "No UST nevents binary detected."
fi
if [ ! -x "$CURDIR/demo/demo" ]; then
BAIL_OUT "No UST nevents binary detected."
fi
+print_test_banner "$TEST_DESC"
+
TESTS=(
"test_enable_wildcard_filter"
"test_enable_wildcard_filter_2"
TESTS=(
"test_enable_wildcard_filter"
"test_enable_wildcard_filter_2"
source $TESTDIR/utils/utils.sh
source $TESTDIR/utils/utils.sh
-print_test_banner "$TEST_DESC"
-
function enable_ust_lttng_event_per_chan()
{
sess_name="$1"
function enable_ust_lttng_event_per_chan()
{
sess_name="$1"
# MUST set TESTDIR before calling those functions
plan_tests $NUM_TESTS
# MUST set TESTDIR before calling those functions
plan_tests $NUM_TESTS
+print_test_banner "$TEST_DESC"
+
start_lttng_sessiond
test_event_basic
start_lttng_sessiond
test_event_basic
source $TESTDIR/utils/utils.sh
source $TESTDIR/utils/utils.sh
-print_test_banner "$TEST_DESC"
-
function test_event_wildcard()
{
TRACE_PATH=$(mktemp -d)
function test_event_wildcard()
{
TRACE_PATH=$(mktemp -d)
# MUST set TESTDIR before calling those functions
plan_tests $NUM_TESTS
# MUST set TESTDIR before calling those functions
plan_tests $NUM_TESTS
+print_test_banner "$TEST_DESC"
+
start_lttng_sessiond
test_event_wildcard
start_lttng_sessiond
test_event_wildcard
int main(int argc, char **argv)
{
int main(int argc, char **argv)
{
- diag("Kernel data structure unit test");
-
+ diag("Kernel data structure unit test");
+
test_create_one_kernel_session();
test_create_kernel_metadata();
test_create_kernel_channel();
test_create_one_kernel_session();
test_create_kernel_metadata();
test_create_kernel_channel();
int main(int argc, char **argv)
{
int main(int argc, char **argv)
{
- diag("Sessions unit tests");
-
+ diag("Sessions unit tests");
+
test_session_list();
test_create_one_session();
test_session_list();
test_create_one_session();
int main(int argc, char **argv)
{
int main(int argc, char **argv)
{
- diag("URI unit tests");
-
+ diag("URI unit tests");
+
test_uri_parsing();
test_uri_cmp();
test_uri_parsing();
test_uri_cmp();
int main(int argc, char **argv)
{
int main(int argc, char **argv)
{
- diag("UST data structures unit test");
-
+ diag("UST data structures unit test");
+
test_create_one_ust_session();
test_create_ust_metadata();
test_create_ust_channel();
test_create_one_ust_session();
test_create_ust_metadata();
test_create_ust_channel();