tests/lib/test_trace_ir_ref.c: rename user structure
[babeltrace.git] / tests / cli / test_trace_read
CommitLineData
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
8SH_TAP=1
9
10if [ "x${BT_TESTS_SRCDIR:-}" != "x" ]; then
11 UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh"
12else
13 UTILSSH="$(dirname "$0")/../utils/utils.sh"
14fi
15
16# shellcheck source=../utils/utils.sh
17source "$UTILSSH"
19badea8 18
6b66b7a9
SM
19SUCCESS_TRACES=("${BT_CTF_TRACES_PATH}/succeed/"*)
20FAIL_TRACES=("${BT_CTF_TRACES_PATH}/fail/"*)
19badea8
CB
21
22NUM_TESTS=$((${#SUCCESS_TRACES[@]} + ${#FAIL_TRACES[@]}))
23
24plan_tests $NUM_TESTS
25
03f007c8
MJ
26for 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
30done
31
03f007c8
MJ
32for 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
39done
This page took 0.074432 seconds and 4 git commands to generate.