75a49770d62d8fa031821ff97616b9dd3c33f42d
3 # SPDX-License-Identifier: GPL-2.0-only
5 # Copyright (C) 2019 Simon Marchi <simon.marchi@efficios.com>
8 # Test the auto source disovery mechanism of the CLI.
10 if [ -n "${BT_TESTS_SRCDIR:-}" ]; then
11 UTILSSH
="$BT_TESTS_SRCDIR/utils/utils.sh"
13 UTILSSH
="$(dirname "$0")/../../utils/utils.sh"
16 # shellcheck source=../../utils/utils.sh
17 SH_TAP
=1 source "$UTILSSH"
23 data_dir
="${BT_TESTS_DATADIR}/auto-source-discovery/grouping"
24 plugin_dir
="${data_dir}"
25 trace_dir
="${data_dir}/traces"
27 stdout_expected_file
="${BT_TESTS_DATADIR}/cli/convert/auto-source-discovery-grouping.expect"
28 stdout_actual_file
=$
(mktemp
-t stdout-actual.XXXXXX
)
29 stderr_actual_file
=$
(mktemp
-t actual-stderr.XXXXXX
)
31 bt_cli
"$stdout_actual_file" "$stderr_actual_file" \
32 --plugin-path "${plugin_dir}" convert
"ABCDE" "${trace_dir}" some_other_non_opt \
33 -c sink.text.details
--params='with-metadata=false'
34 ok
"$?" "CLI runs successfully"
36 # Check components and their inputs.
37 bt_diff
"$stdout_expected_file" "$stdout_actual_file"
38 ok
"$?" "expected components are instantiated with expected inputs"
40 # Check that expected warning is printed.
41 # shellcheck disable=SC2016
43 'No trace was found based on input `some_other_non_opt`' \
44 "$stderr_actual_file" \
47 rm -f "$stdout_actual_file"
48 rm -f "$stderr_actual_file"
This page took 0.031989 seconds and 5 git commands to generate.