Skip to content

Commit

Permalink
[tests] Fix printing summary after testing confs (#3371)
Browse files Browse the repository at this point in the history
  • Loading branch information
dewagter authored Sep 28, 2024
1 parent 51e43fb commit 4f1bd75
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,11 @@ test_mavlab: all

# test TU Delft conf
test_tudelft: all
CONF_XML=conf/userconf/tudelft/conf.xml prove tests/aircrafts/
CONF_XML=conf/userconf/tudelft/delfly_conf.xml prove tests/aircrafts/
CONF_XML=conf/userconf/tudelft/course_conf.xml prove tests/aircrafts/
CONF_XML=conf/userconf/tudelft/guido_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/ 2>&1 | tee -a ./var/compile.log
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/ 2>&1 | tee -a ./var/compile.log
python ./sw/tools/parse_compile_logs.py | tee ./issues.md

# test GVF conf
test_gvf: all
Expand All @@ -331,7 +332,8 @@ test_gvf: all

# compiles all aircrafts in conf_tests.xml
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_modules: all
Expand All @@ -340,7 +342,7 @@ test_modules: all
test_all_confs: all opencv_bebop
$(Q)$(eval $CONFS:=$(shell ./find_confs.py))
@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
test_math:
Expand Down
7 changes: 4 additions & 3 deletions sw/tools/parse_compile_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ def parse_log(log_file):
lines = f.readlines()

errors = []
conf = ''
conf = 'Unknown'
airframe = ''
module = ''

for line in lines:
lowerline = line.lower()
if 'Testing all aircrafts in conf: ' in line:
conf = line.split('Testing all aircrafts in conf: ')[1].strip()
#print(conf)
Expand All @@ -30,9 +31,9 @@ def parse_log(log_file):
airframe = line.strip()

if conf and airframe:
if 'error:' in line:
if ('error:' in lowerline) or ('failed:' in lowerline):
errors.append((conf, airframe, line.strip()))
if 'warning:' in line:
if 'warning:' in lowerline:
errors.append((conf, airframe, line.strip()))

return errors
Expand Down
1 change: 1 addition & 0 deletions tests/aircrafts/01_compile_all_aircrafts.t
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ my $conf_xml_file = $ENV{'CONF_XML'};
if ($conf_xml_file eq "") {
$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);


Expand Down

0 comments on commit 4f1bd75

Please sign in to comment.