#!/bin/bash # # Copyright (C) - 2019 Simon Marchi # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License, version 2 only, as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 51 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. . "@abs_top_builddir@/tests/utils/common.sh" NUM_TESTS=3 plan_tests $NUM_TESTS tmp_metadata=$(mktemp) # Test a valid trace directory. "${BT_BIN}" -o ctf-metadata "${BT_CTF_TRACES}/succeed/wk-heartbeat-u" > "$tmp_metadata" ok $? "Run babeltrace -o ctf-metadata with a valid trace directory, correct exit status" cmp -s "$tmp_metadata" "${BT_SRC_PATH}/tests/cli/test_output_ctf_metadata.ref" ok $? "Run babeltrace -o ctf-metadata with a valid trace directory, correct output" # Test an invalid trace directory. "${BT_BIN}" -o ctf-metadata "${BT_CTF_TRACES}" &> /dev/null isnt $? 0 "Run babeltrace -o ctf-metadata with an invalid trace directory, expecting failure"