Skip to content
Snippets Groups Projects
Commit 707e6798 authored by Rohit Gupta's avatar Rohit Gupta
Browse files

bugfixes to test framework

parent d687b89d
No related branches found
No related tags found
No related merge requests found
...@@ -153,8 +153,8 @@ function test_compile() { ...@@ -153,8 +153,8 @@ function test_compile() {
echo_success "$test_case_name.${tags} PASSED" echo_success "$test_case_name.${tags} PASSED"
xUnit_success "compilation" "$test_case_name.$tags" "PASS" "$result_string" "$xmlfile_testcase" xUnit_success "compilation" "$test_case_name.$tags" "PASS" "$result_string" "$xmlfile_testcase"
else else
echo_success "$test_case_name.${tags} FAILED" echo_error "$test_case_name.${tags} FAILED"
xUnit_success "compilation" "$test_case_name.$tags" "FAIL" "$result_string" "$xmlfile_testcase" xUnit_fail "compilation" "$test_case_name.$tags" "FAIL" "$result_string" "$xmlfile_testcase"
fi fi
} }
...@@ -324,7 +324,7 @@ function test_compile_and_run() { ...@@ -324,7 +324,7 @@ function test_compile_and_run() {
if [ "$result_string" == "" ]; then if [ "$result_string" == "" ]; then
echo_error "execution $test_case_name.$compile_prog.${tags_array[$tags_array_index]} Run_Result = \"$result_string\" Result = FAIL" 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 else
if [ "$global_result" == "0" ]; then if [ "$global_result" == "0" ]; then
echo_error "execution $test_case_name.${tags_array[$tags_array_index]} Run_Result = \"$result_string\" Result = FAIL" echo_error "execution $test_case_name.${tags_array[$tags_array_index]} Run_Result = \"$result_string\" Result = FAIL"
......
...@@ -34,7 +34,7 @@ xUnit_fail() { ...@@ -34,7 +34,7 @@ xUnit_fail() {
xmlfile_testcase=$5 xmlfile_testcase=$5
currtime=$(date +%s.%N) currtime=$(date +%s.%N)
time=$(echo "$currtime - $XUNIT_START" | bc -l) 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 echo -e $xml > $xmlfile_testcase
XUNIT_TESTCASES_XML="$XUNIT_TESTCASES_XML \n$xml" XUNIT_TESTCASES_XML="$XUNIT_TESTCASES_XML \n$xml"
XUNIT_FAILED=$((XUNIT_FAILED+1)) XUNIT_FAILED=$((XUNIT_FAILED+1))
...@@ -56,7 +56,7 @@ xUnit_success() { ...@@ -56,7 +56,7 @@ xUnit_success() {
xmlfile_testcase=$5 xmlfile_testcase=$5
currtime=$(date +%s.%N) currtime=$(date +%s.%N)
time=$(echo "$currtime - $XUNIT_START" | bc -l) 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 echo -e $xml > $xmlfile_testcase
XUNIT_TESTCASES_XML="$XUNIT_TESTCASES_XML \n$xml" XUNIT_TESTCASES_XML="$XUNIT_TESTCASES_XML \n$xml"
XUNIT_SUCCESS=$((XUNIT_SUCCESS+1)) XUNIT_SUCCESS=$((XUNIT_SUCCESS+1))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment