tests: quote ${BT_CTF_TRACES_PATH} in test_trace_read and test_trace_copy
[babeltrace.git] / tests / cli / test_trace_read
CommitLineData
19badea8
CB
1#!/bin/bash
2#
abdabab5 3# Copyright (C) 2013 Christian Babeux <christian.babeux@efficios.com>
19badea8
CB
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
abdabab5
MJ
18SH_TAP=1
19
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"
19badea8 28
36aa69d7
SM
29SUCCESS_TRACES=("${BT_CTF_TRACES_PATH}/succeed/"*)
30FAIL_TRACES=("${BT_CTF_TRACES_PATH}/fail/"*)
19badea8
CB
31
32NUM_TESTS=$((${#SUCCESS_TRACES[@]} + ${#FAIL_TRACES[@]}))
33
34plan_tests $NUM_TESTS
35
de3fb4cd
MJ
36for path in "${SUCCESS_TRACES[@]}"; do
37 trace=$(basename "${path}")
abdabab5 38 "${BT_TESTS_BT2_BIN}" "${path}" > /dev/null 2>&1
142ac9b0 39 ok $? "Run babeltrace2 with trace ${trace}"
19badea8
CB
40done
41
de3fb4cd
MJ
42for path in "${FAIL_TRACES[@]}"; do
43 trace=$(basename "${path}")
abdabab5 44 if "${BT_TESTS_BT2_BIN}" "${path}" > /dev/null 2>&1; then
142ac9b0 45 fail "Run babeltrace2 with invalid trace ${trace}"
19badea8 46 else
142ac9b0 47 pass "Run babeltrace2 with invalid trace ${trace}"
19badea8
CB
48 fi
49done
This page took 0.061651 seconds and 4 git commands to generate.