Move to kernel style SPDX license identifiers
[babeltrace.git] / tests / plugins / sink.text.details / succeed / test_succeed
CommitLineData
54d785fa
PP
1#!/bin/bash
2#
0235b0db 3# SPDX-License-Identifier: GPL-2.0-only
54d785fa 4#
0235b0db 5# Copyright (C) 2019 Philippe Proulx <pproulx@efficios.com>
54d785fa 6#
54d785fa
PP
7
8SH_TAP=1
9
10if [ "x${BT_TESTS_SRCDIR:-}" != "x" ]; then
11 UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh"
12else
13 UTILSSH="$(dirname "$0")/../../../utils/utils.sh"
14fi
15
16# shellcheck source=../../../utils/utils.sh
17source "$UTILSSH"
18
19this_dir_relative="plugins/sink.text.details/succeed"
20expect_dir="$BT_TESTS_DATADIR/$this_dir_relative"
21
22test_details() {
23 local test_name="$1"
24 local trace_name="$2"
25 shift 2
26 local details_args=("$@")
27 local trace_dir="$BT_CTF_TRACES_PATH/succeed/$trace_name"
28 local expect_path="$expect_dir/$test_name.expect"
29
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"
34}
35
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.
38test_details_no_stream_name() {
39 local test_name="$1"
40 local trace_name="$2"
41 shift 2
42 local details_args=("$@")
43
44 test_details "$test_name" "$trace_name" \
45 "${details_args[@]+${details_args[@]}}" -p with-stream-name=no
46}
47
cc413248 48plan_tests 12
54d785fa
PP
49
50test_details_no_stream_name default wk-heartbeat-u
51test_details_no_stream_name default-compact wk-heartbeat-u -p compact=yes
52test_details_no_stream_name default-compact-without-metadata wk-heartbeat-u -p compact=yes,with-metadata=no
53test_details_no_stream_name default-compact-without-time wk-heartbeat-u -p compact=yes,with-time=no
cc413248
PP
54test_details_no_stream_name default-without-data wk-heartbeat-u -p with-data=no
55test_details_no_stream_name default-without-data-without-metadata wk-heartbeat-u -p with-data=no,with-metadata=no
54d785fa
PP
56test_details_no_stream_name default-without-metadata wk-heartbeat-u -p with-metadata=no
57test_details_no_stream_name default-without-names wk-heartbeat-u -p with-stream-name=no,with-trace-name=no,with-stream-class-name=no
58test_details_no_stream_name default-without-time wk-heartbeat-u -p with-time=no
59test_details_no_stream_name default-without-trace-name wk-heartbeat-u -p with-trace-name=no
60test_details_no_stream_name default-without-uuid wk-heartbeat-u -p with-uuid=no
61test_details_no_stream_name no-packet-context no-packet-context
This page took 0.03356 seconds and 4 git commands to generate.