4 DIR
=$
(readlink
-f ${TESTDIR})
5 BABELTRACE_BIN
=${DIR}/..
/converter
/babeltrace
6 CTF_TRACES
=${DIR}/ctf-traces
8 function test_check_success
()
10 if [ $?
-ne 0 ] ; then
17 function test_check_fail
()
19 if [ $?
-eq 0 ] ; then
26 function run_babeltrace
()
28 ${BABELTRACE_BIN} $
* > /dev
/null
2>&1
32 function print_test_result
()
34 if [ $# -ne 3 ] ; then
35 echo "Invalid arguments provided"
39 if [ ${2} -eq 0 ] ; then
44 echo -e " "${1}" - "${3}
47 successTraces
=(${CTF_TRACES}/succeed
/*)
48 failTraces
=(${CTF_TRACES}/fail
/*)
49 testCount
=$
((2 + ${#successTraces[@]} + ${#failTraces[@]}))
52 echo -e 1..
${testCount}
54 #run babeltrace, expects success
57 print_test_result $
((currentTestIndex
++)) $?
"Running babeltrace without arguments"
59 #run babeltrace with a bogus argument, expects failure
60 run_babeltrace
--bogusarg
62 print_test_result $
((currentTestIndex
++)) $?
"Running babeltrace with a bogus argument"
64 for tracePath
in ${successTraces[@]}; do
65 run_babeltrace
${tracePath}
67 print_test_result $
((currentTestIndex
++)) $?
"Running babeltrace with trace ${tracePath}"
70 for tracePath
in ${failTraces[@]}; do
71 run_babeltrace
${tracePath}
73 print_test_result $
((currentTestIndex
++)) $?
"Running babeltrace with trace ${tracePath}"
This page took 0.031478 seconds and 4 git commands to generate.