@@ -14,20 +14,20 @@ run_test_with_global_timeout() {
1414 local input=$1
1515 local output=$2
1616 local reference=$3
17- local config =$4
18- local global_timeout =$5
19-
20- (.. /biflow_aggregator -i " u:lr,u:ba" -e -c config.xml -n $config -g $global_timeout & ) || true
17+ local section =$4
18+ local config =$5
19+ local global_timeout= $6
20+ (./biflow_aggregator -i " u:lr,u:ba" -e -c $ config -n $section -g $global_timeout & ) || true
2121 local AGGREGATOR_PID=$!
2222 sleep 0.5
2323 die_if_not_running $AGGREGATOR_PID " Failed to start biflow aggregator"
2424
25- .. /../logger/logger -w $output -i " u:ba" &
25+ ./../logger/logger -w $output -i " u:ba" &
2626 local LOGGER_PID=$!
2727 sleep 0.5
2828 die_if_not_running $LOGGER_PID " Failed to start logger"
2929
30- .. /../logreplay/logreplay -f $input -i " u:lr" &
30+ ./../logreplay/logreplay -f $input -i " u:lr" &
3131 local LOGREPLAY_PID=$!
3232 sleep 0.5
3333 die_if_not_running $LOGREPLAY_PID " Failed to start logreplay"
@@ -39,38 +39,49 @@ run_test_with_global_timeout() {
3939 kill $LOGGER_PID 2> /dev/null
4040 wait $LOGGER_PID
4141
42- if ! colordiff $output $reference ; then
42+ if ! diff $output $reference ; then
4343 echo $output doesnt match $reference
4444 success=" false"
4545 fi
4646}
47+ pwd >&2
4748
4849script_path=" $( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd) "
49- cd $script_path
50+
5051success=" true"
51- mkdir -p outputs
52- for input in inputs/input* ; do
52+
53+ tmpdir=$( mktemp -d)
54+
55+ trap " rm -rf \" $tmpdir \" " EXIT
56+
57+ outputs=" $tmpdir /outputs"
58+
59+ mkdir -p " $outputs "
60+
61+
62+ for input in " $script_path " /inputs/input* ; do
5363 basename=$( basename " $input " )
5464 echo Found $basename
5565 if [[ $basename =~ input([0-9]+)_(.+) ]]; then
5666 index=" ${BASH_REMATCH[1]} "
57- config=" ${BASH_REMATCH[2]} "
58- output=outputs/output$index
59- reference=references/reference$index
67+ section=" ${BASH_REMATCH[2]} "
68+ output=" $outputs /output$index "
69+ config=" $script_path /config.xml"
70+ reference=" $script_path /references/reference$index "
6071 else
6172 echo $input
6273 echo " Incorrect input name. Must be input<index>_<config_name>"
6374 exit 1
6475 fi
6576
6677 echo " Running test without global timeout..."
67- run_test_with_global_timeout $input ${output} _gt0 ${reference} _gt0 $config " 0"
78+ run_test_with_global_timeout $input ${output} _gt0 ${reference} _gt0 $section $ config " 0"
6879
6980 echo " Running test with relative global timeout..."
70- run_test_with_global_timeout $input ${output} _gt5r ${reference} _gt5r $config " 5r"
81+ run_test_with_global_timeout $input ${output} _gt5r ${reference} _gt5r $section $ config " 5r"
7182
7283 echo " Running test with absolute global timeout..."
73- run_test_with_global_timeout $input ${output} _gt5a ${reference} _gt5a $config " 5a"
84+ run_test_with_global_timeout $input ${output} _gt5a ${reference} _gt5a $section $ config " 5a"
7485
7586done
7687
@@ -79,4 +90,4 @@ if [ "$success" = "true" ]; then
7990else
8091 echo " Some tests failed."
8192 exit 1
82- fi
93+ fi
0 commit comments