[build] possibilty to specify conf.xml file used for tests

If the CONF_XML environment variable is set, use that conf.xml file instead of the standard $PAPARAZZI_HOME/conf/conf.xml
Meaning you can run tests for a different conf without changing the conf.xml symlink, e.g.
```
CONF_XML=$PAPARAZZI_HOME/conf/conf_tests.xml prove tests/examples
```
This commit is contained in:
Felix Ruess
2015-03-12 17:10:05 +01:00
parent 6d2acf227d
commit 81f562dc38
2 changed files with 8 additions and 4 deletions

View File

@@ -28,7 +28,7 @@ include conf/Makefile.local
# main directory where the generated files and compilation results for an aircraft are stored
AIRCRAFT_BUILD_DIR = $(PAPARAZZI_HOME)/var/aircrafts/$(AIRCRAFT)
CONF=$(PAPARAZZI_HOME)/conf
CONF_XML=$(CONF)/conf.xml
CONF_XML ?= $(CONF)/conf.xml
AIRBORNE=sw/airborne
MESSAGES_XML = $(CONF)/messages.xml
@@ -231,7 +231,7 @@ $(SETTINGS_TELEMETRY) : $(PERIODIC_H)
@echo "#######################################"
@echo "# BUILD AIRCRAFT=$(AIRCRAFT), TARGET $*"
@echo "#######################################"
$(Q)PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) TARGET=$* Q=$(Q) $(GENERATORS)/gen_aircraft.out $(AIRCRAFT)
$(Q)PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) TARGET=$* Q=$(Q) $(GENERATORS)/gen_aircraft.out $(AIRCRAFT) $(CONF_XML)
%.compile: %.ac_h | print_version
cd $(AIRBORNE); $(MAKE) -j$(NPROCS) TARGET=$* all

View File

@@ -35,7 +35,11 @@ use Cwd;
$|++;
my $xmlSimple = XML::Simple->new(ForceArray => 1);
my $conf = $xmlSimple->XMLin("$ENV{'PAPARAZZI_HOME'}/conf/conf.xml");
my $conf_xml_file = $ENV{'CONF_XML'};
if ($conf_xml_file eq "") {
$conf_xml_file = "$ENV{'PAPARAZZI_HOME'}/conf/conf.xml";
}
my $conf = $xmlSimple->XMLin($conf_xml_file);
sub get_num_targets
@@ -57,7 +61,7 @@ sub get_num_targets
}
plan tests => get_num_targets()+1;
ok(1, "Parsed the configuration file");
ok(1, "Parsed the $conf_xml_file configuration file");
foreach my $aircraft (sort keys%{$conf->{'aircraft'}})
{
my $airframe = $conf->{'aircraft'}->{$aircraft}->{'airframe'};