tests/lib/test_trace_ir_ref.c: rename user structure
[babeltrace.git] / tests / cli / test_output_ctf_metadata
1 #!/bin/bash
2 #
3 # SPDX-License-Identifier: GPL-2.0-only
4 #
5 # Copyright (C) 2019 Simon Marchi <simon.marchi@efficios.com>
6 #
7
8 SH_TAP=1
9
10 if [ "x${BT_TESTS_SRCDIR:-}" != "x" ]; then
11 UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh"
12 else
13 UTILSSH="$(dirname "$0")/../utils/utils.sh"
14 fi
15
16 # shellcheck source=../utils/utils.sh
17 source "$UTILSSH"
18
19 NUM_TESTS=3
20
21 plan_tests $NUM_TESTS
22
23 tmp_metadata=$(mktemp)
24
25 # Test a valid trace directory.
26 "${BT_TESTS_BT2_BIN}" -o ctf-metadata "${BT_CTF_TRACES_PATH}/succeed/wk-heartbeat-u" > "$tmp_metadata"
27 ok $? "Run babeltrace -o ctf-metadata with a valid trace directory, correct exit status"
28
29 cmp -s "$tmp_metadata" "${BT_TESTS_DATADIR}/cli/test_output_ctf_metadata.ref"
30 ok $? "Run babeltrace -o ctf-metadata with a valid trace directory, correct output"
31
32 # Test an invalid trace directory.
33 "${BT_TESTS_BT2_BIN}" -o ctf-metadata "${BT_CTF_TRACES_PATH}" >/dev/null 2>&1
34 isnt $? 0 "Run babeltrace -o ctf-metadata with an invalid trace directory, expecting failure"
35
36 rm -f "$tmp_metadata"
This page took 0.032408 seconds and 4 git commands to generate.