If no tests are run (because they have all been excluded) then make
sure we insert a valid timestamp into the XML file, and avoid printing
an error message when reading a non-existent test summary scratch
file.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
local report=$tmp.report.xunit.$sect_name.xml
# Header
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $REPORT_DIR/result.xml
local report=$tmp.report.xunit.$sect_name.xml
# Header
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $REPORT_DIR/result.xml
+ if [ -z "$date_time" ]; then
+ date_time=$(date +"%F %T")
+ fi
local dtime=`echo $date_time| tr " " 'T'`
local stats="failures=\"$n_bad\" skipped=\"$n_notrun\" tests=\"$n_total\" time=\"$sect_time\""
local hw_info="hostname=\"$HOST\" timestamp=\"$dtime\" "
local dtime=`echo $date_time| tr " " 'T'`
local stats="failures=\"$n_bad\" skipped=\"$n_notrun\" tests=\"$n_total\" time=\"$sect_time\""
local hw_info="hostname=\"$HOST\" timestamp=\"$dtime\" "
_xunit_add_property "$p"
done
echo -e "\t</properties>" >> $REPORT_DIR/result.xml
_xunit_add_property "$p"
done
echo -e "\t</properties>" >> $REPORT_DIR/result.xml
- cat $tmp.report.xunit.$sect_name.xml >> $REPORT_DIR/result.xml
+ if [ -f $report ]; then
+ cat $report >> $REPORT_DIR/result.xml
+ fi
echo "</testsuite>" >> $REPORT_DIR/result.xml
echo "Xunit report: $REPORT_DIR/result.xml"
}
echo "</testsuite>" >> $REPORT_DIR/result.xml
echo "Xunit report: $REPORT_DIR/result.xml"
}