Fix: src.ctf.fs: initialize the other_entry variable
[babeltrace.git] / tests / cli / test_output_ctf_metadata
CommitLineData
b4c499ed
SM
1#!/bin/bash
2#
644e0364 3# Copyright (C) 2019 Simon Marchi <simon.marchi@efficios.com>
b4c499ed
SM
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
644e0364 18SH_TAP=1
b4c499ed 19
644e0364
MJ
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
27source "$UTILSSH"
b4c499ed
SM
28
29NUM_TESTS=3
30
31plan_tests $NUM_TESTS
32
33tmp_metadata=$(mktemp)
34
35# Test a valid trace directory.
644e0364 36"${BT_TESTS_BT2_BIN}" -o ctf-metadata "${BT_CTF_TRACES_PATH}/succeed/wk-heartbeat-u" > "$tmp_metadata"
b4c499ed
SM
37ok $? "Run babeltrace -o ctf-metadata with a valid trace directory, correct exit status"
38
644e0364 39cmp -s "$tmp_metadata" "${BT_TESTS_DATADIR}/cli/test_output_ctf_metadata.ref"
b4c499ed
SM
40ok $? "Run babeltrace -o ctf-metadata with a valid trace directory, correct output"
41
42# Test an invalid trace directory.
644e0364 43"${BT_TESTS_BT2_BIN}" -o ctf-metadata "${BT_CTF_TRACES_PATH}" >/dev/null 2>&1
b4c499ed 44isnt $? 0 "Run babeltrace -o ctf-metadata with an invalid trace directory, expecting failure"
644e0364
MJ
45
46rm -f "$tmp_metadata"
This page took 0.046393 seconds and 4 git commands to generate.