3 # Copyright (C) 2019 Simon Marchi <simon.marchi@efficios.com>
5 # This program is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License, version 2 only, as
7 # published by the Free Software Foundation.
9 # This program is distributed in the hope that it will be useful, but WITHOUT
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 # You should have received a copy of the GNU General Public License along with
15 # this program; if not, write to the Free Software Foundation, Inc., 51
16 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 # Test the auto source disovery mechanism of the CLI.
20 if [ "x${BT_TESTS_SRCDIR:-}" != "x" ]; then
21 UTILSSH
="$BT_TESTS_SRCDIR/utils/utils.sh"
23 UTILSSH
="$(dirname "$0")/../../utils/utils.sh"
26 # shellcheck source=../../utils/utils.sh
27 SH_TAP
=1 source "$UTILSSH"
33 data_dir
="${BT_TESTS_DATADIR}/cli/auto-source-discovery"
34 plugin_dir
="${data_dir}"
35 trace_dir
="${data_dir}/traces"
37 expected_file
=$
(mktemp expected.XXXXXX
)
38 actual_file
=$
(mktemp actual.XXXXXX
)
40 run_python_bt2
"$BT_TESTS_BT2_BIN" convert
--plugin-path "${plugin_dir}" "ABCDE" "${trace_dir}" some_other_leftover |
sort > "$actual_file"
41 ok
"${PIPESTATUS[0]}" "successful execution"
43 cat > "$expected_file" <<END
44 TestSourceABCDE: ABCDE
45 TestSourceExt: ${trace_dir}/aaa1, ${trace_dir}/aaa2, ${trace_dir}/aaa3
46 TestSourceExt: ${trace_dir}/bbb1, ${trace_dir}/bbb2
47 TestSourceExt: ${trace_dir}/ccc1
48 TestSourceExt: ${trace_dir}/ccc2
49 TestSourceExt: ${trace_dir}/ccc3
50 TestSourceExt: ${trace_dir}/ccc4
51 TestSourceSomeDir: ${trace_dir}/some-dir
54 diff -u "$expected_file" "$actual_file"
55 ok
"$?" "sources are auto-discovered"
57 rm -f "$expected_file" "$actual_file"
This page took 0.032254 seconds and 5 git commands to generate.