better logging in autotests
This commit is contained in:
@@ -20,7 +20,7 @@ test_compile() {
|
|||||||
compile_prog=$2
|
compile_prog=$2
|
||||||
exec_prog=$3
|
exec_prog=$3
|
||||||
build_dir=$tdir/$1/build
|
build_dir=$tdir/$1/build
|
||||||
log_file=$tdir/log/test.$1.txt
|
log_file=$tdir/log/test.$1.$2.$5.txt
|
||||||
target=$5
|
target=$5
|
||||||
echo "Compiling test case $test_name. Log file = $log_file"
|
echo "Compiling test case $test_name. Log file = $log_file"
|
||||||
rm -fr $build_dir
|
rm -fr $build_dir
|
||||||
@@ -34,10 +34,10 @@ test_compile() {
|
|||||||
if [ -s $exec_prog ] ; then
|
if [ -s $exec_prog ] ; then
|
||||||
cp $exec_prog $tdir/bin/`basename $exec_prog`.$target.$test_name
|
cp $exec_prog $tdir/bin/`basename $exec_prog`.$target.$test_name
|
||||||
echo_success "$test_name $exec_prog $target compiled"
|
echo_success "$test_name $exec_prog $target compiled"
|
||||||
xUnit_success "compilation" $test_name "PASS" 1
|
xUnit_success "compilation" $test_name "PASS" 1 "$results_file"
|
||||||
else
|
else
|
||||||
echo_error "$test_name $exec_prog $target compilation failed"
|
echo_error "$test_name $exec_prog $target compilation failed"
|
||||||
xUnit_fail "compilation" $test_name "FAIL" 1
|
xUnit_fail "compilation" $test_name "FAIL" 1 "$results_file"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ xUnit_fail() {
|
|||||||
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 s' 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))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user