diff --git a/.travis.yml b/.travis.yml index 6e6a964a019f8457a0f163e636393b565a7c1d06..7f4b815388e04d944f84710314a470e5e4dd0274 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,10 +17,12 @@ install: - sudo apt-get install gcc-arm-none-eabi - sudo apt-get install gcc-msp430 - sudo apt-get install pcregrep libpcre3 + - sudo apt-get install qemu-system-x86 python3 script: - ./dist/tools/compile_test/compile_test.py - - make -C ./tests/unittests term + - make -C ./tests/unittests test BOARD=native + - make -C ./tests/unittests test BOARD=qemu-i386 - ./dist/tools/licenses/check.sh master notifications: diff --git a/boards/qemu-i386/x86_board_lpm.c b/boards/qemu-i386/x86_board_lpm.c index 0df2580107ef87b93f639cd16fb7c0c13c2a1433..c64a09c7c4757d143ab5fd9c68c103993547c059 100644 --- a/boards/qemu-i386/x86_board_lpm.c +++ b/boards/qemu-i386/x86_board_lpm.c @@ -21,23 +21,27 @@ * @{ * * @file - * @brief Placeholder if someone uses x86-multiboot as a board. + * @brief Low-power mode emulation for qemu-i386. * * @author René Kijewski <rene.kijewski@fu-berlin.de> * * @} */ -#include <lpm.h> +#include "lpm.h" +#include "x86_reboot.h" void lpm_init(void) { - // void + /* void */ } enum lpm_mode lpm_set(enum lpm_mode target) { if (target != LPM_ON) { + if (target == LPM_POWERDOWN) { + x86_shutdown(); + } asm volatile ("hlt"); } return LPM_UNKNOWN; @@ -45,15 +49,15 @@ enum lpm_mode lpm_set(enum lpm_mode target) void lpm_awake(void) { - // void + /* void */ } void lpm_begin_awake(void) { - // void + /* void */ } void lpm_end_awake(void) { - // void + /* void */ } diff --git a/tests/unittests/Makefile b/tests/unittests/Makefile index 709d0d44221521ac415ae0b49ab5b1cbdca41021..eb328c3ce5a46736f55bd2244c989e0713b14d12 100644 --- a/tests/unittests/Makefile +++ b/tests/unittests/Makefile @@ -40,3 +40,9 @@ ifeq (, $(UNIT_TESTS)) else CFLAGS += -DTEST_SUITES='$(subst $() $(),$(charCOMMA),$(UNIT_TESTS:tests-%=%))' endif + +test: SHELL=bash +test: + @exec 5>&1 && \ + LOG=$$("$(MAKE)" -s term | tee >(cat - >&5)) && \ + grep 'OK ([1-9][0-9]* tests)' <<< $${LOG} > /dev/null diff --git a/tests/unittests/main.c b/tests/unittests/main.c index b9869d75fdb515ca23aeddae909313310771eed4..e21f643740eec3be7444724d4ef569ef839bda9f 100644 --- a/tests/unittests/main.c +++ b/tests/unittests/main.c @@ -31,11 +31,6 @@ int main(void) #endif TESTS_END(); -#if defined (BOARD_NATIVE) && !defined (OUTPUT) - void _exit(int); - _exit(TestRunnerHadErrors); -#endif - lpm_set(LPM_POWERDOWN); return 0; }