[tests] Fix printing summary after testing confs (#3371)

This commit is contained in:
Christophe De Wagter
2024-09-28 23:15:12 +02:00
committed by GitHub
parent 51e43fb67d
commit 4f1bd75203
3 changed files with 13 additions and 9 deletions
+8 -6
View File
@@ -319,10 +319,11 @@ test_mavlab: all
# test TU Delft conf # test TU Delft conf
test_tudelft: all test_tudelft: all
CONF_XML=conf/userconf/tudelft/conf.xml prove tests/aircrafts/ CONF_XML=conf/userconf/tudelft/conf.xml prove tests/aircrafts/ 2>&1 | tee ./var/compile.log
CONF_XML=conf/userconf/tudelft/delfly_conf.xml prove tests/aircrafts/ CONF_XML=conf/userconf/tudelft/delfly_conf.xml prove tests/aircrafts/ 2>&1 | tee -a ./var/compile.log
CONF_XML=conf/userconf/tudelft/course_conf.xml prove tests/aircrafts/ CONF_XML=conf/userconf/tudelft/course_conf.xml prove tests/aircrafts/ 2>&1 | tee -a ./var/compile.log
CONF_XML=conf/userconf/tudelft/guido_conf.xml prove tests/aircrafts/ CONF_XML=conf/userconf/tudelft/guido_conf.xml prove tests/aircrafts/ 2>&1 | tee -a ./var/compile.log
python ./sw/tools/parse_compile_logs.py | tee ./issues.md
# test GVF conf # test GVF conf
test_gvf: all test_gvf: all
@@ -331,7 +332,8 @@ test_gvf: all
# compiles all aircrafts in conf_tests.xml # compiles all aircrafts in conf_tests.xml
test_examples: all test_examples: all
CONF_XML=conf/conf_tests.xml prove tests/aircrafts/ CONF_XML=conf/conf_tests.xml prove tests/aircrafts/ 2>&1 | tee ./var/compile.log
python ./sw/tools/parse_compile_logs.py | tee ./issues.md
# test compilation of modules # test compilation of modules
test_modules: all test_modules: all
@@ -340,7 +342,7 @@ test_modules: all
test_all_confs: all opencv_bebop test_all_confs: all opencv_bebop
$(Q)$(eval $CONFS:=$(shell ./find_confs.py)) $(Q)$(eval $CONFS:=$(shell ./find_confs.py))
@echo "************\nFound $(words $($CONFS)) config files: $($CONFS)" @echo "************\nFound $(words $($CONFS)) config files: $($CONFS)"
$(Q)$(foreach conf,$($CONFS),echo "\n************\nTesting all aircrafts in conf: $(conf)\n************" && (CONF_XML=$(conf) prove tests/aircrafts/ || echo "failed $(conf)" >> TEST_ALL_CONFS_FAILED);) test -f TEST_ALL_CONFS_FAILED && cat TEST_ALL_CONFS_FAILED && rm -f TEST_ALL_CONFS_FAILED && exit 1; exit 0 $(Q)$(foreach conf,$($CONFS),(CONF_XML=$(conf) prove tests/aircrafts/ || echo "failed $(conf)" >> TEST_ALL_CONFS_FAILED);) test -f TEST_ALL_CONFS_FAILED && cat TEST_ALL_CONFS_FAILED && rm -f TEST_ALL_CONFS_FAILED && exit 1; exit 0
# run some math tests that don't need whole paparazzi to be built # run some math tests that don't need whole paparazzi to be built
test_math: test_math:
+4 -3
View File
@@ -12,11 +12,12 @@ def parse_log(log_file):
lines = f.readlines() lines = f.readlines()
errors = [] errors = []
conf = '' conf = 'Unknown'
airframe = '' airframe = ''
module = '' module = ''
for line in lines: for line in lines:
lowerline = line.lower()
if 'Testing all aircrafts in conf: ' in line: if 'Testing all aircrafts in conf: ' in line:
conf = line.split('Testing all aircrafts in conf: ')[1].strip() conf = line.split('Testing all aircrafts in conf: ')[1].strip()
#print(conf) #print(conf)
@@ -30,9 +31,9 @@ def parse_log(log_file):
airframe = line.strip() airframe = line.strip()
if conf and airframe: if conf and airframe:
if 'error:' in line: if ('error:' in lowerline) or ('failed:' in lowerline):
errors.append((conf, airframe, line.strip())) errors.append((conf, airframe, line.strip()))
if 'warning:' in line: if 'warning:' in lowerline:
errors.append((conf, airframe, line.strip())) errors.append((conf, airframe, line.strip()))
return errors return errors
@@ -43,6 +43,7 @@ my $conf_xml_file = $ENV{'CONF_XML'};
if ($conf_xml_file eq "") { if ($conf_xml_file eq "") {
$conf_xml_file = "$ENV{'PAPARAZZI_HOME'}/conf/conf.xml"; $conf_xml_file = "$ENV{'PAPARAZZI_HOME'}/conf/conf.xml";
} }
warn "\n************\nTesting all aircrafts in conf: $conf_xml_file\n************\n";
my $conf = $xmlSimple->XMLin($conf_xml_file); my $conf = $xmlSimple->XMLin($conf_xml_file);