Commit | Line | Data |
---|---|---|
19badea8 CB |
1 | #!/bin/bash |
2 | # | |
3 | # Copyright (C) - 2013 Christian Babeux <christian.babeux@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 | ||
03f007c8 | 18 | . "@abs_top_builddir@/tests/utils/common.sh" |
19badea8 | 19 | |
bbff0ab4 MJ |
20 | SUCCESS_TRACES=(${BT_CTF_TRACES_PATH}/succeed/*) |
21 | FAIL_TRACES=(${BT_CTF_TRACES_PATH}/fail/*) | |
19badea8 CB |
22 | |
23 | NUM_TESTS=$((${#SUCCESS_TRACES[@]} + ${#FAIL_TRACES[@]})) | |
24 | ||
25 | plan_tests $NUM_TESTS | |
26 | ||
03f007c8 MJ |
27 | for path in "${SUCCESS_TRACES[@]}"; do |
28 | trace=$(basename "${path}") | |
29 | "${BT_BIN}" "${path}" > /dev/null 2>&1 | |
ec2c5e50 | 30 | ok $? "Run babeltrace2 with trace ${trace}" |
19badea8 CB |
31 | done |
32 | ||
03f007c8 MJ |
33 | for path in "${FAIL_TRACES[@]}"; do |
34 | trace=$(basename "${path}") | |
35 | "${BT_BIN}" "${path}" > /dev/null 2>&1 | |
19badea8 | 36 | if [ $? -eq 0 ]; then |
ec2c5e50 | 37 | fail "Run babeltrace2 with invalid trace ${trace}" |
19badea8 | 38 | else |
ec2c5e50 | 39 | pass "Run babeltrace2 with invalid trace ${trace}" |
19badea8 CB |
40 | fi |
41 | done |