diff --git a/.travis.mk b/.travis.mk index b467f298b..1f04ab558 100644 --- a/.travis.mk +++ b/.travis.mk @@ -29,6 +29,8 @@ EXAMPLES_redbee_econotag = $(EXAMPLES_most_non_native) EXAMPLES_sky = $(EXAMPLES_most_non_native) sky-shell +COOJA_TESTS = tools/cooja/contiki_tests/*.csc + CT := \033[0;0m ifdef BOXED_SIGNS @@ -51,6 +53,12 @@ THIS = $(MAKE) -C examples/$$e TARGET=$@ > $(LOG) 2>&1 MINE = $(EXAMPLES_ALL) $(EXAMPLES_$(subst -,_,$@)) endif +ifeq ($(BUILD_TYPE),cooja) +JAVA = java -mx512m +THIS = $(SHELL) -c "cd `dirname $$e` && $(JAVA) -jar ../dist/cooja.jar -nogui=`basename $$e`" > $(LOG) 2>&1 +MINE = $(COOJA_TESTS) +endif + LOG = /tmp/$@_`echo $$e | sed 's:/:_:g'`.log %: diff --git a/.travis.yml b/.travis.yml index f7b5f976e..2e4cb53a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,11 @@ before_script: - "[ $BUILD_TYPE = multi ] && curl -s \ https://sourcery.mentor.com/public/gnu_toolchain/arm-none-eabi/arm-2008q3-66-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 \ | tar xjf - -C /tmp/ && sudo cp -f -r /tmp/arm-2008q3/* /usr/ && rm -rf /tmp/arm-2008q3 && arm-none-eabi-gcc --version || true" + ## Compile cooja.jar only when it's going to be needed + - "[ $BUILD_TYPE = cooja ] && java -version && ant -q -f tools/cooja/build.xml jar || true" + + ## IMPORTANT: The commands here have to end with `|| true`, + ## because it would make the test fail if BUILD_TYPE test fails script: ## The makefile called `.travis.mk` handles most of generic logic @@ -22,3 +27,4 @@ env: ## This magically kick-off parallel jobs for each of the for the sets ## of environment variable defined below - BUILD_TYPE='multi' MAKE_TARGETS='native minimal-net redbee-econotag sky' + - BUILD_TYPE='cooja' MAKE_TARGETS='cooja' TAIL=cat