Commit | Line | Data |
---|---|---|
1ec75dfa 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 | . "@abs_top_builddir@/tests/utils/common.sh" | |
19 | ||
20 | ||
21 | NUM_TESTS=3 | |
22 | ||
23 | plan_tests $NUM_TESTS | |
24 | ||
25 | tmp_metadata=$(mktemp) | |
26 | ||
27 | # Test a valid trace directory. | |
b7c5d194 | 28 | "${BT_BIN}" -o ctf-metadata "${BT_CTF_TRACES_PATH}/succeed/wk-heartbeat-u" > "$tmp_metadata" |
1ec75dfa SM |
29 | ok $? "Run babeltrace -o ctf-metadata with a valid trace directory, correct exit status" |
30 | ||
b7c5d194 | 31 | cmp -s "$tmp_metadata" "${BT_SRC_PATH}/tests/data/cli/test_output_ctf_metadata.ref" |
1ec75dfa SM |
32 | ok $? "Run babeltrace -o ctf-metadata with a valid trace directory, correct output" |
33 | ||
34 | # Test an invalid trace directory. | |
b7c5d194 | 35 | "${BT_BIN}" -o ctf-metadata "${BT_CTF_TRACES_PATH}" &> /dev/null |
1ec75dfa | 36 | isnt $? 0 "Run babeltrace -o ctf-metadata with an invalid trace directory, expecting failure" |