Skip to content

Commit

Permalink
Moving the conf/conf.xml file back from the packup after the tests ha…
Browse files Browse the repository at this point in the history
…ve run.
  • Loading branch information
rbdavison committed Jul 16, 2012
1 parent 5f5e4bd commit 527837e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Makefile
Expand Up @@ -63,6 +63,7 @@ XSENS_XML = $(CONF)/xsens_MTi-G.xml
TOOLS=$(PAPARAZZI_SRC)/sw/tools
OCAML=$(shell which ocaml)
OCAMLRUN=$(shell which ocamlrun)
BUILD_DATETIME:=$(shell date +%Y%m%d-%H%M%S)

# try to find the paparazzi multilib toolchain
TOOLCHAIN=$(shell find -L /opt/paparazzi/arm-multilib ~/sat -maxdepth 1 -type d -name arm-none-eabi 2>/dev/null | head -n 1)
Expand Down Expand Up @@ -259,9 +260,12 @@ ab_clean:
find sw/airborne -name '*~' -exec rm -f {} \;

replace_current_conf_xml:
test conf/conf.xml || mv conf/conf.xml conf/conf.xml.backup.`date +%Y%m%d-%H%M%s`
test conf/conf.xml && mv conf/conf.xml conf/conf.xml.backup.$(BUILD_DATETIME)
cp conf/conf.xml.example conf/conf.xml

restore_conf_xml:
test conf/conf.xml.backup.$(BUILD_DATETIME) && mv conf/conf.xml.backup.$(BUILD_DATETIME) conf/conf.xml

commands: paparazzi sw/simulator/launchsitl

paparazzi:
Expand All @@ -272,6 +276,8 @@ sw/simulator/launchsitl:
cat src/$(@F) | sed s#OCAMLRUN#$(OCAMLRUN)# | sed s#OCAML#$(OCAML)# > $@
chmod a+x $@

test: all replace_current_conf_xml
run_tests:
cd tests; $(MAKE) test

test: all replace_current_conf_xml run_tests restore_conf_xml

0 comments on commit 527837e

Please sign in to comment.