3 # SPDX-License-Identifier: GPL-2.0-only
5 # Copyright (C) 2019 Philippe Proulx <pproulx@efficios.com>
10 if [ "x${BT_TESTS_SRCDIR:-}" != "x" ]; then
11 UTILSSH
="$BT_TESTS_SRCDIR/utils/utils.sh"
13 UTILSSH
="$(dirname "$0")/../../../utils/utils.sh"
16 # shellcheck source=../../../utils/utils.sh
19 this_dir_relative
="plugins/sink.text.details/succeed"
20 expect_dir
="$BT_TESTS_DATADIR/$this_dir_relative"
26 local details_args
=("$@")
27 local trace_dir
="$BT_CTF_TRACES_PATH/succeed/$trace_name"
28 local expect_path
="$expect_dir/$test_name.expect"
30 bt_diff_cli
"$expect_path" /dev
/null \
31 "$trace_dir" -p trace-name
=the-trace \
32 -c sink.text.details
"${details_args[@]+${details_args[@]}}"
33 ok $?
"'$test_name' test has the expected output"
36 # This is used for the moment because the source is `src.ctf.fs` and
37 # such a component can make its stream names contain absolute paths.
38 test_details_no_stream_name
() {
42 local details_args
=("$@")
44 test_details
"$test_name" "$trace_name" \
45 "${details_args[@]+${details_args[@]}}" -p with-stream-name
=no
50 test_details_no_stream_name default wk-heartbeat-u
51 test_details_no_stream_name default-compact wk-heartbeat-u
-p compact
=yes
52 test_details_no_stream_name default-compact-without-metadata wk-heartbeat-u
-p compact
=yes,with-metadata
=no
53 test_details_no_stream_name default-compact-without-time wk-heartbeat-u
-p compact
=yes,with-time
=no
54 test_details_no_stream_name default-without-data wk-heartbeat-u
-p with-data
=no
55 test_details_no_stream_name default-without-data-without-metadata wk-heartbeat-u
-p with-data
=no
,with-metadata
=no
56 test_details_no_stream_name default-without-metadata wk-heartbeat-u
-p with-metadata
=no
57 test_details_no_stream_name default-without-names wk-heartbeat-u
-p with-stream-name
=no
,with-trace-name
=no
,with-stream-class-name
=no
58 test_details_no_stream_name default-without-time wk-heartbeat-u
-p with-time
=no
59 test_details_no_stream_name default-without-trace-name wk-heartbeat-u
-p with-trace-name
=no
60 test_details_no_stream_name default-without-uuid wk-heartbeat-u
-p with-uuid
=no
61 test_details_no_stream_name no-packet-context no-packet-context