Commit | Line | Data |
---|---|---|
38403bf5 FD |
1 | #!/bin/bash |
2 | # | |
0235b0db | 3 | # SPDX-License-Identifier: GPL-2.0-only |
38403bf5 | 4 | # |
0235b0db | 5 | # Copyright (C) 2019 Francis Deslauriers <francis.deslauriers@efficios.com> |
38403bf5 | 6 | # |
38403bf5 FD |
7 | |
8 | # This file tests what happens when we mux messages. | |
9 | ||
10 | SH_TAP=1 | |
11 | ||
12 | if [ "x${BT_TESTS_SRCDIR:-}" != "x" ]; then | |
13 | UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh" | |
14 | else | |
10a81653 | 15 | UTILSSH="$(dirname "$0")/../../../utils/utils.sh" |
38403bf5 FD |
16 | fi |
17 | ||
77362a65 | 18 | # shellcheck source=../../../utils/utils.sh |
38403bf5 FD |
19 | source "$UTILSSH" |
20 | ||
21 | data_dir="$BT_TESTS_DATADIR/plugins/flt.utils.muxer" | |
22 | ||
23 | plan_tests 12 | |
24 | ||
25 | function run_test | |
26 | { | |
27 | local test_name="$1" | |
28 | local local_args=( | |
02510056 | 29 | "--plugin-path" "$data_dir" |
38403bf5 FD |
30 | "-c" "src.test-muxer.TheSourceOfConfusion" |
31 | "-p" "test-name=$test_name" | |
32 | "-c" "sink.text.details" | |
33 | "--params=compact=false,with-metadata=false" | |
38403bf5 FD |
34 | ) |
35 | ||
36 | stdout_expected="$data_dir/succeed/$test_name.expect" | |
37 | bt_diff_cli "$stdout_expected" /dev/null "${local_args[@]}" | |
38 | ok $? "$test_name" | |
39 | } | |
40 | ||
41 | ||
42 | test_cases=( | |
43 | basic_timestamp_ordering | |
44 | diff_event_class_id | |
45 | diff_event_class_name | |
46 | diff_inactivity_msg_cs | |
47 | diff_stream_class_id | |
48 | diff_stream_class_name | |
49 | diff_stream_class_no_name | |
50 | diff_stream_id | |
51 | diff_stream_name | |
52 | diff_stream_no_name | |
53 | diff_trace_name | |
54 | multi_iter_ordering | |
55 | ) | |
56 | ||
57 | for i in "${test_cases[@]}" | |
58 | do | |
77362a65 | 59 | run_test "$i" |
38403bf5 | 60 | done |