tests: silence "variable/expression in single quote" shellcheck warnings
[babeltrace.git] / tests / cli / convert / test_auto_source_discovery_grouping
CommitLineData
73760435
SM
1#!/bin/bash
2#
3# Copyright (C) 2019 Simon Marchi <simon.marchi@efficios.com>
4#
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.
8#
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
12# more details.
13#
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.
17
18# Test the auto source disovery mechanism of the CLI.
19
20if [ "x${BT_TESTS_SRCDIR:-}" != "x" ]; then
21 UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh"
22else
23 UTILSSH="$(dirname "$0")/../../utils/utils.sh"
24fi
25
26# shellcheck source=../../utils/utils.sh
27SH_TAP=1 source "$UTILSSH"
28
97010665 29NUM_TESTS=3
73760435
SM
30
31plan_tests $NUM_TESTS
32
a83410cd 33data_dir="${BT_TESTS_DATADIR}/auto-source-discovery/grouping"
73760435
SM
34plugin_dir="${data_dir}"
35trace_dir="${data_dir}/traces"
36
ff89ed28
MJ
37if [ "$BT_OS_TYPE" = "mingw" ]; then
38 # Use Windows native paths for comparison because Unix
39 # paths are converted by the shell before they are passed
40 # to the native babeltrace2 binary.
41 trace_dir=$(cygpath -w "$trace_dir")
42 dir_sep='\'
43else
44 dir_sep='/'
45fi
73760435 46
a83410cd 47stdout_expected_file="${BT_TESTS_DATADIR}/cli/convert/auto-source-discovery-grouping.expect"
97010665
SM
48stdout_actual_file=$(mktemp -t stdout-actual.XXXXXX)
49stderr_actual_file=$(mktemp -t actual-stderr.XXXXXX)
73760435 50
97010665 51bt_cli "$stdout_actual_file" "$stderr_actual_file" \
02510056 52 --plugin-path "${plugin_dir}" convert "ABCDE" "${trace_dir}" some_other_non_opt \
216b7cc7 53 -c sink.text.details --params='with-metadata=false'
97010665
SM
54ok "$?" "CLI runs successfully"
55
56# Check components and their inputs.
57bt_diff "$stdout_expected_file" "$stdout_actual_file"
58ok "$?" "expected components are instantiated with expected inputs"
59
60# Check that expected warning is printed.
4656d91f 61# shellcheck disable=SC2016
97010665
SM
62grep -q 'No trace was found based on input `some_other_non_opt`' "$stderr_actual_file"
63ok "$?" "warning is printed"
64
65rm -f "$stdout_actual_file"
66rm -f "$stderr_actual_file"
This page took 0.035489 seconds and 4 git commands to generate.