sink.text.details: add `with-data` initialization parameter
[babeltrace.git] / tests / plugins / sink.text.details / succeed / test_succeed
CommitLineData
54d785fa
PP
1#!/bin/bash
2#
3# Copyright (C) 2019 Philippe Proulx <pproulx@efficios.com>
4#
5# This program is free software; you can redistribute it and/or
6# modify it under the terms of the GNU General Public License
7# as published by the Free Software Foundation; only version 2
8# of the License.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19SH_TAP=1
20
21if [ "x${BT_TESTS_SRCDIR:-}" != "x" ]; then
22 UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh"
23else
24 UTILSSH="$(dirname "$0")/../../../utils/utils.sh"
25fi
26
27# shellcheck source=../../../utils/utils.sh
28source "$UTILSSH"
29
30this_dir_relative="plugins/sink.text.details/succeed"
31expect_dir="$BT_TESTS_DATADIR/$this_dir_relative"
32
33test_details() {
34 local test_name="$1"
35 local trace_name="$2"
36 shift 2
37 local details_args=("$@")
38 local trace_dir="$BT_CTF_TRACES_PATH/succeed/$trace_name"
39 local expect_path="$expect_dir/$test_name.expect"
40
41 bt_diff_cli "$expect_path" /dev/null \
42 "$trace_dir" -p trace-name=the-trace \
43 -c sink.text.details "${details_args[@]+${details_args[@]}}"
44 ok $? "'$test_name' test has the expected output"
45}
46
47# This is used for the moment because the source is `src.ctf.fs` and
48# such a component can make its stream names contain absolute paths.
49test_details_no_stream_name() {
50 local test_name="$1"
51 local trace_name="$2"
52 shift 2
53 local details_args=("$@")
54
55 test_details "$test_name" "$trace_name" \
56 "${details_args[@]+${details_args[@]}}" -p with-stream-name=no
57}
58
cc413248 59plan_tests 12
54d785fa
PP
60
61test_details_no_stream_name default wk-heartbeat-u
62test_details_no_stream_name default-compact wk-heartbeat-u -p compact=yes
63test_details_no_stream_name default-compact-without-metadata wk-heartbeat-u -p compact=yes,with-metadata=no
64test_details_no_stream_name default-compact-without-time wk-heartbeat-u -p compact=yes,with-time=no
cc413248
PP
65test_details_no_stream_name default-without-data wk-heartbeat-u -p with-data=no
66test_details_no_stream_name default-without-data-without-metadata wk-heartbeat-u -p with-data=no,with-metadata=no
54d785fa
PP
67test_details_no_stream_name default-without-metadata wk-heartbeat-u -p with-metadata=no
68test_details_no_stream_name default-without-names wk-heartbeat-u -p with-stream-name=no,with-trace-name=no,with-stream-class-name=no
69test_details_no_stream_name default-without-time wk-heartbeat-u -p with-time=no
70test_details_no_stream_name default-without-trace-name wk-heartbeat-u -p with-trace-name=no
71test_details_no_stream_name default-without-uuid wk-heartbeat-u -p with-uuid=no
72test_details_no_stream_name no-packet-context no-packet-context
This page took 0.025025 seconds and 4 git commands to generate.