Move the bitfield test to tests/lib/
[babeltrace.git] / tests / runall.sh
CommitLineData
607c826c
MD
1#!/bin/bash
2
3TESTDIR=$(dirname $0)
4DIR=$(readlink -f ${TESTDIR})
5BABELTRACE_BIN=${DIR}/../converter/babeltrace
6CTF_TRACES=${DIR}/ctf-traces
7
8function print_ok ()
9{
10 # Check if we are a terminal
11 if [ -t 1 ]; then
12 echo -e "\e[1;32mOK\e[0m"
13 else
14 echo -e "OK"
15 fi
16}
17
18function print_fail ()
19{
20 # Check if we are a terminal
21 if [ -t 1 ]; then
22 echo -e "\e[1;31mFAIL\e[0m"
23 else
24 echo -e "FAIL"
25 fi
26}
27
28function test_check ()
29{
30 if [ $? -ne 0 ] ; then
31 print_fail
32 return 1
33 else
34 print_ok
35 return 0
36 fi
37}
38
39function test_check_fail ()
40{
41 if [ $? -ne 1 ] ; then
42 print_fail
43 return 1
44 else
45 print_ok
46 return 0
47 fi
48}
49
50function run_babeltrace ()
51{
52 ${BABELTRACE_BIN} $* > /dev/null 2>&1
53 return $?
54}
55
607c826c
MD
56#run babeltrace expects success
57echo -e "Running babeltrace without argument..."
58run_babeltrace
59test_check
60if [ $? -ne 0 ]; then
61 exit 1
62fi
63
64for a in ${CTF_TRACES}/succeed/*; do
65 echo -e "Running babeltrace for trace ${a}..."
66 run_babeltrace ${a}
67 test_check
68 if [ $? -ne 0 ]; then
69 exit 1
70 fi
71done
72
73#run babeltrace expects failure
74echo -e "Running babeltrace with bogus argument..."
75run_babeltrace --bogusarg
76test_check_fail
77if [ $? -ne 0 ]; then
78 exit 1
79fi
80
81for a in ${CTF_TRACES}/fail/*; do
82 echo -e "Running babeltrace for trace ${a}..."
83 run_babeltrace ${a}
84 test_check_fail
85 if [ $? -ne 0 ]; then
86 exit 1
87 fi
88done
89
90exit 0
This page took 0.025464 seconds and 4 git commands to generate.