Move to kernel style SPDX license identifiers
[babeltrace.git] / tests / cli / convert / test_auto_source_discovery_grouping
CommitLineData
73760435
SM
1#!/bin/bash
2#
0235b0db 3# SPDX-License-Identifier: GPL-2.0-only
73760435 4#
0235b0db 5# Copyright (C) 2019 Simon Marchi <simon.marchi@efficios.com>
73760435 6#
73760435
SM
7
8# Test the auto source disovery mechanism of the CLI.
9
10if [ "x${BT_TESTS_SRCDIR:-}" != "x" ]; then
11 UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh"
12else
13 UTILSSH="$(dirname "$0")/../../utils/utils.sh"
14fi
15
16# shellcheck source=../../utils/utils.sh
17SH_TAP=1 source "$UTILSSH"
18
97010665 19NUM_TESTS=3
73760435
SM
20
21plan_tests $NUM_TESTS
22
a83410cd 23data_dir="${BT_TESTS_DATADIR}/auto-source-discovery/grouping"
73760435
SM
24plugin_dir="${data_dir}"
25trace_dir="${data_dir}/traces"
26
a83410cd 27stdout_expected_file="${BT_TESTS_DATADIR}/cli/convert/auto-source-discovery-grouping.expect"
97010665
SM
28stdout_actual_file=$(mktemp -t stdout-actual.XXXXXX)
29stderr_actual_file=$(mktemp -t actual-stderr.XXXXXX)
73760435 30
97010665 31bt_cli "$stdout_actual_file" "$stderr_actual_file" \
02510056 32 --plugin-path "${plugin_dir}" convert "ABCDE" "${trace_dir}" some_other_non_opt \
216b7cc7 33 -c sink.text.details --params='with-metadata=false'
97010665
SM
34ok "$?" "CLI runs successfully"
35
36# Check components and their inputs.
37bt_diff "$stdout_expected_file" "$stdout_actual_file"
38ok "$?" "expected components are instantiated with expected inputs"
39
40# Check that expected warning is printed.
4656d91f 41# shellcheck disable=SC2016
97010665
SM
42grep -q 'No trace was found based on input `some_other_non_opt`' "$stderr_actual_file"
43ok "$?" "warning is printed"
44
45rm -f "$stdout_actual_file"
46rm -f "$stderr_actual_file"
This page took 0.039967 seconds and 4 git commands to generate.