From 707e6798c34d40d9802d55bc5f5d7f2a72a92128 Mon Sep 17 00:00:00 2001 From: Rohit Gupta <rohit.gupta@eurecom.fr> Date: Sun, 6 Dec 2015 13:32:19 +0100 Subject: [PATCH] bugfixes to test framework --- cmake_targets/autotests/run_exec_autotests.bash | 6 +++--- cmake_targets/tools/test_helper | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake_targets/autotests/run_exec_autotests.bash b/cmake_targets/autotests/run_exec_autotests.bash index 2eea43082d..a447ac3b93 100755 --- a/cmake_targets/autotests/run_exec_autotests.bash +++ b/cmake_targets/autotests/run_exec_autotests.bash @@ -153,8 +153,8 @@ function test_compile() { echo_success "$test_case_name.${tags} PASSED" xUnit_success "compilation" "$test_case_name.$tags" "PASS" "$result_string" "$xmlfile_testcase" else - echo_success "$test_case_name.${tags} FAILED" - xUnit_success "compilation" "$test_case_name.$tags" "FAIL" "$result_string" "$xmlfile_testcase" + echo_error "$test_case_name.${tags} FAILED" + xUnit_fail "compilation" "$test_case_name.$tags" "FAIL" "$result_string" "$xmlfile_testcase" fi } @@ -324,7 +324,7 @@ function test_compile_and_run() { if [ "$result_string" == "" ]; then echo_error "execution $test_case_name.$compile_prog.${tags_array[$tags_array_index]} Run_Result = \"$result_string\" Result = FAIL" - xUnit_success "execution" "$test_case_name.${tags_array[$tags_array_index]}" "FAIL" "$result_string" "$xmlfile_testcase" + xUnit_fail "execution" "$test_case_name.${tags_array[$tags_array_index]}" "FAIL" "$result_string" "$xmlfile_testcase" else if [ "$global_result" == "0" ]; then echo_error "execution $test_case_name.${tags_array[$tags_array_index]} Run_Result = \"$result_string\" Result = FAIL" diff --git a/cmake_targets/tools/test_helper b/cmake_targets/tools/test_helper index e60fb8c720..495c80f079 100644 --- a/cmake_targets/tools/test_helper +++ b/cmake_targets/tools/test_helper @@ -34,7 +34,7 @@ xUnit_fail() { xmlfile_testcase=$5 currtime=$(date +%s.%N) time=$(echo "$currtime - $XUNIT_START" | bc -l) - xml="<testcase classname='$class' name='$test_case' Run_result='$run_result' time='$time' RESULT='$result'></testcase>" + xml="<testcase classname='$class' name='$test_case' Run_result='$run_result' time='$time s' RESULT='$result'></testcase>" echo -e $xml > $xmlfile_testcase XUNIT_TESTCASES_XML="$XUNIT_TESTCASES_XML \n$xml" XUNIT_FAILED=$((XUNIT_FAILED+1)) @@ -56,7 +56,7 @@ xUnit_success() { xmlfile_testcase=$5 currtime=$(date +%s.%N) time=$(echo "$currtime - $XUNIT_START" | bc -l) - xml="<testcase classname='$class' name='$test_case' Run_result='$run_result' time='$time' RESULT='$result'></testcase>" + xml="<testcase classname='$class' name='$test_case' Run_result='$run_result' time='$time s' RESULT='$result'></testcase>" echo -e $xml > $xmlfile_testcase XUNIT_TESTCASES_XML="$XUNIT_TESTCASES_XML \n$xml" XUNIT_SUCCESS=$((XUNIT_SUCCESS+1)) -- GitLab