Commit | Line | Data |
---|---|---|
19badea8 CB |
1 | #!/bin/bash |
2 | # | |
0235b0db | 3 | # SPDX-License-Identifier: GPL-2.0-only |
19badea8 | 4 | # |
0235b0db | 5 | # Copyright (C) 2013 Christian Babeux <christian.babeux@efficios.com> |
19badea8 | 6 | # |
19badea8 | 7 | |
644e0364 MJ |
8 | SH_TAP=1 |
9 | ||
10 | if [ "x${BT_TESTS_SRCDIR:-}" != "x" ]; then | |
11 | UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh" | |
12 | else | |
13 | UTILSSH="$(dirname "$0")/../utils/utils.sh" | |
14 | fi | |
15 | ||
16 | # shellcheck source=../utils/utils.sh | |
17 | source "$UTILSSH" | |
19badea8 | 18 | |
6b66b7a9 SM |
19 | SUCCESS_TRACES=("${BT_CTF_TRACES_PATH}/succeed/"*) |
20 | FAIL_TRACES=("${BT_CTF_TRACES_PATH}/fail/"*) | |
19badea8 CB |
21 | |
22 | NUM_TESTS=$((${#SUCCESS_TRACES[@]} + ${#FAIL_TRACES[@]})) | |
23 | ||
24 | plan_tests $NUM_TESTS | |
25 | ||
03f007c8 MJ |
26 | for path in "${SUCCESS_TRACES[@]}"; do |
27 | trace=$(basename "${path}") | |
644e0364 | 28 | "${BT_TESTS_BT2_BIN}" "${path}" > /dev/null 2>&1 |
ec2c5e50 | 29 | ok $? "Run babeltrace2 with trace ${trace}" |
19badea8 CB |
30 | done |
31 | ||
03f007c8 MJ |
32 | for path in "${FAIL_TRACES[@]}"; do |
33 | trace=$(basename "${path}") | |
644e0364 | 34 | if "${BT_TESTS_BT2_BIN}" "${path}" > /dev/null 2>&1; then |
ec2c5e50 | 35 | fail "Run babeltrace2 with invalid trace ${trace}" |
19badea8 | 36 | else |
ec2c5e50 | 37 | pass "Run babeltrace2 with invalid trace ${trace}" |
19badea8 CB |
38 | fi |
39 | done |