Structured the Contiki tests according to what they are supposed to test and broke them out as multiple parallel jobs.

This commit is contained in:
Adam Dunkels 2012-11-21 23:55:09 +01:00
parent 3a669d0caa
commit 4d811b41cc
2 changed files with 131 additions and 10 deletions

View file

@ -50,8 +50,42 @@ EXCLUDE_avr_raven = ipv6/rpl-collect
EXAMPLES_sky = $(EXAMPLES_most_non_native) sky-shell EXAMPLES_sky = $(EXAMPLES_most_non_native) sky-shell
COOJA_TESTS_DIR = tools/cooja/contiki_tests COOJA_TESTS_DIR = tools/cooja/contiki_tests
COOJA_TESTS_ALL = $(COOJA_TESTS_DIR)/*_helloworld.csc COOJA_TESTS_HELLO_WORLD = $(COOJA_TESTS_DIR)/*_helloworld.csc
COOJA_TESTS_BASE = $(COOJA_TESTS_DIR)/multithreading.csc \
$(COOJA_TESTS_DIR)/sky_coffee.csc
# $(COOJA_TESTS_DIR)/crosslevel.csc
# The crosslevel test is unstable and therefore not included yet
COOJA_TESTS_RIME = $(COOJA_TESTS_DIR)/rime_abc.csc \
$(COOJA_TESTS_DIR)/rime_rucb.csc \
$(COOJA_TESTS_DIR)/rime_runicast.csc \
$(COOJA_TESTS_DIR)/sky_deluge.csc \
$(COOJA_TESTS_DIR)/sky_collect.csc
# $(COOJA_TESTS_DIR)/rime_trickle.csc
# The rime_trickle test sometimes fails so it isn't included here
COOJA_TESTS_NETPERF = $(COOJA_TESTS_DIR)/netperf-*.csc
COOJA_TESTS_SKY_SHELL = $(COOJA_TESTS_DIR)/sky_shell_basic_commands.csc \
$(COOJA_TESTS_DIR)/sky_shell_compliation_test.csc \
$(COOJA_TESTS_DIR)/sky_shell_download.csc \
$(COOJA_TESTS_DIR)/sky_checkpointing.csc \
$(COOJA_TESTS_DIR)/sky_shell_sendcmd.csc
COOJA_TESTS_ELFLOADER = $(COOJA_TESTS_DIR)/sky_shell_exec_serial.csc
COOJA_TESTS_COLLECT = $(COOJA_TESTS_DIR)/rime_collect.csc \
$(COOJA_TESTS_DIR)/rime_collect_sky.csc
COOJA_TESTS_COLLECT_SKY = $(COOJA_TESTS_DIR)/sky_shell_collect.csc
COOJA_TESTS_COLLECT_LOSSY = $(COOJA_TESTS_DIR)/sky_shell_collect_lossy.csc
COOJA_TESTS_IPV6 = $(COOJA_TESTS_DIR)/sky-ipv6-rpl-collect.csc \
$(COOJA_TESTS_DIR)/sky_ipv6_udp.csc \
$(COOJA_TESTS_DIR)/sky_ipv6_udp_fragmentation.csc \
$(COOJA_TESTS_DIR)/cooja_ipv6_udp.csc
COOJA_TESTS_IPV6_APPS = $(COOJA_TESTS_DIR)/servreg-hack.csc \
$(COOJA_TESTS_DIR)/rest_rpl_coap.csc
# The IPv4 test are not stable yet:
#COOJA_TESTS_IPV4 = $(COOJA_TESTS_DIR)/ip_cooja_telnet_ping.csc \
# $(COOJA_TESTS_DIR)/ip_sky_telnet_ping.csc \
# $(COOJA_TESTS_DIR)/ip_sky_webserver_wget.csc
## Some Cooja tests can also be excluded: ## Some Cooja tests can also be excluded:
#EXCLUDE_COOJA_TESTS = servreg-hack.csc sky_coffee.csc rime_collect.csc rime_trickle.csc #EXCLUDE_COOJA_TESTS = servreg-hack.csc sky_coffee.csc rime_collect.csc rime_trickle.csc
## And some can also be marked: ## And some can also be marked:
@ -75,16 +109,93 @@ SKIP = (echo $(SKIP_LIST) | grep -q $$e && (echo "\033[1;36m $(SKIP_SIGN) ➝
FAIL = (echo "\033[1;35m $(FAIL_SIGN) $$e ∉ $@ $(CT)"; $(TAIL) $(LOG); echo fail >> results) FAIL = (echo "\033[1;35m $(FAIL_SIGN) $$e ∉ $@ $(CT)"; $(TAIL) $(LOG); echo fail >> results)
PASS = (echo "\033[1;32m $(PASS_SIGN) $$e ∈ $@ $(CT)"; echo pass >> results) PASS = (echo "\033[1;32m $(PASS_SIGN) $$e ∈ $@ $(CT)"; echo pass >> results)
ifeq ($(BUILD_TYPE),multi)
# This is the definition of the basic compilation test
ifeq ($(BUILD_TYPE),compile)
THIS = $(MAKE) -C examples/$$e TARGET=$@ > $(LOG) 2>&1 THIS = $(MAKE) -C examples/$$e TARGET=$@ > $(LOG) 2>&1
MINE = $(filter-out $(EXCLUDE_$(subst -,_,$@)), $(EXAMPLES_ALL) $(EXAMPLES_$(subst -,_,$@))) MINE = $(filter-out $(EXCLUDE_$(subst -,_,$@)), $(EXAMPLES_ALL) $(EXAMPLES_$(subst -,_,$@)))
SKIP_LIST = $(MARK_EXAMPLES_$(subst -,_,$@)) SKIP_LIST = $(MARK_EXAMPLES_$(subst -,_,$@))
endif endif
ifeq ($(BUILD_TYPE),cooja) # Below are the Contiki functional tests, which all use Cooja so we
# need to define JAVA and the COOJA_COMMAND
JAVA = java -mx512m JAVA = java -mx512m
THIS = $(SHELL) -x -c "cd `dirname $$e` && $(JAVA) -jar ../dist/cooja.jar -nogui=`basename $$e`" > $(LOG) #2>&1 COOJA_COMMAND = $(SHELL) -x -c "cd `dirname $$e` && $(JAVA) -jar ../dist/cooja.jar -nogui=`basename $$e`" > $(LOG) #2>&1
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), $(wildcard $(COOJA_TESTS_ALL)))
ifeq ($(BUILD_TYPE),helloworld)
THIS = $(COOJA_COMMAND)
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), \
$(wildcard $(COOJA_TESTS_HELLO_WORLD)))
SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS))
endif
ifeq ($(BUILD_TYPE),base)
THIS = $(COOJA_COMMAND)
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), \
$(wildcard $(COOJA_TESTS_BASE)))
SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS))
endif
ifeq ($(BUILD_TYPE),rime)
THIS = $(COOJA_COMMAND)
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), \
$(wildcard $(COOJA_TESTS_RIME)))
SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS))
endif
ifeq ($(BUILD_TYPE),netperf)
THIS = $(COOJA_COMMAND)
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), \
$(wildcard $(COOJA_TESTS_NETPERF)))
SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS))
endif
ifeq ($(BUILD_TYPE),sky-shell)
THIS = $(COOJA_COMMAND)
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), \
$(wildcard $(COOJA_TESTS_SKY_SHELL)))
SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS))
endif
ifeq ($(BUILD_TYPE),elfloader)
THIS = $(COOJA_COMMAND)
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), \
$(wildcard $(COOJA_TESTS_ELFLOADER)))
SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS))
endif
ifeq ($(BUILD_TYPE),collect)
THIS = $(COOJA_COMMAND)
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), \
$(wildcard $(COOJA_TESTS_COLLECT)))
SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS))
endif
ifeq ($(BUILD_TYPE),collect-sky)
THIS = $(COOJA_COMMAND)
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), \
$(wildcard $(COOJA_TESTS_COLLECT_SKY)))
SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS))
endif
ifeq ($(BUILD_TYPE),collect-lossy)
THIS = $(COOJA_COMMAND)
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), \
$(wildcard $(COOJA_TESTS_COLLECT_LOSSY)))
SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS))
endif
ifeq ($(BUILD_TYPE),ipv6)
THIS = $(COOJA_COMMAND)
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), \
$(wildcard $(COOJA_TESTS_IPV6)))
SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS))
endif
ifeq ($(BUILD_TYPE),ipv6-apps)
THIS = $(COOJA_COMMAND)
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), \
$(wildcard $(COOJA_TESTS_IPV6_APPS)))
SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS)) SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS))
endif endif

View file

@ -5,11 +5,11 @@ before_script:
- "sudo apt-get -qq install gcc-msp430 || true" - "sudo apt-get -qq install gcc-msp430 || true"
- "sudo apt-get -qq install gcc-avr avr-libc || true" - "sudo apt-get -qq install gcc-avr avr-libc || true"
## Install toolchain for mc1233x in care-free way ## Install toolchain for mc1233x in care-free way
- "[ $BUILD_TYPE = multi ] && curl -s \ - "[ $BUILD_TYPE = compile ] && curl -s \
https://sourcery.mentor.com/public/gnu_toolchain/arm-none-eabi/arm-2008q3-66-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 \ 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" | 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 ## 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" - "[ $MAKE_TARGETS = cooja ] && java -version && ant -q -f tools/cooja/build.xml jar || true"
## IMPORTANT: The commands here have to end with `|| true`, ## IMPORTANT: The commands here have to end with `|| true`,
## because it would make the test fail if BUILD_TYPE test fails ## because it would make the test fail if BUILD_TYPE test fails
@ -28,5 +28,15 @@ after_script:
env: env:
## This magically kick-off parallel jobs for each of the for the sets ## This magically kick-off parallel jobs for each of the for the sets
## of environment variable defined below ## of environment variable defined below
- BUILD_TYPE='multi' MAKE_TARGETS='native minimal-net econotag sky micaz avr-raven' - BUILD_TYPE='compile' MAKE_TARGETS='native minimal-net econotag sky micaz avr-raven'
- BUILD_TYPE='cooja' MAKE_TARGETS='cooja' TAIL=cat - BUILD_TYPE='ipv6' MAKE_TARGETS='cooja' TAIL=cat
- BUILD_TYPE='collect-lossy' MAKE_TARGETS='cooja' TAIL=cat
- BUILD_TYPE='collect-sky' MAKE_TARGETS='cooja' TAIL=cat
- BUILD_TYPE='collect' MAKE_TARGETS='cooja' TAIL=cat
- BUILD_TYPE='helloworld' MAKE_TARGETS='cooja' TAIL=cat
- BUILD_TYPE='base' MAKE_TARGETS='cooja' TAIL=cat
- BUILD_TYPE='rime' MAKE_TARGETS='cooja' TAIL=cat
- BUILD_TYPE='netperf' MAKE_TARGETS='cooja' TAIL=cat
- BUILD_TYPE='sky-shell' MAKE_TARGETS='cooja' TAIL=cat
- BUILD_TYPE='elfloader' MAKE_TARGETS='cooja' TAIL=cat
- BUILD_TYPE='ipv6-apps' MAKE_TARGETS='cooja' TAIL=cat