From 1ec4e45f7713261eb82fde4cb7e6c93518fdcc8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Thu, 22 Aug 2019 10:45:42 +0200 Subject: [PATCH 1/3] tests/unittests: blacklist 8/16bit boards as they do not compile The boards do not compile the unittests due to issue with too long integers and other issues. --- tests/unittests/Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/unittests/Makefile b/tests/unittests/Makefile index bb66096f82..72e1b42aee 100644 --- a/tests/unittests/Makefile +++ b/tests/unittests/Makefile @@ -1,6 +1,24 @@ DEVELHELP ?= 0 include ../Makefile.tests_common +# Issue with integer width +# There are present for a long time but hidden by being not compiled +BOARD_BLACKLIST += arduino-duemilanove +BOARD_BLACKLIST += arduino-leonardo +BOARD_BLACKLIST += arduino-mega2560 +BOARD_BLACKLIST += arduino-nano +BOARD_BLACKLIST += arduino-uno +BOARD_BLACKLIST += chronos +BOARD_BLACKLIST += jiminy-mega256rfr2 +BOARD_BLACKLIST += mega-xplained +BOARD_BLACKLIST += msb-430 +BOARD_BLACKLIST += msb-430h +BOARD_BLACKLIST += telosb +BOARD_BLACKLIST += waspmote-pro +BOARD_BLACKLIST += wsn430-v1_3b +BOARD_BLACKLIST += wsn430-v1_4 +BOARD_BLACKLIST += z1 + BOARD_INSUFFICIENT_MEMORY := airfy-beacon \ arduino-duemilanove \ arduino-leonardo \ From 5638881e5b8c390a185788c32bb91d8b7719a5fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Tue, 20 Aug 2019 15:15:53 +0200 Subject: [PATCH 2/3] tests/cpp_ctors: move tests-cpp_ctors out of unittests This moves 'unittests/tests-cpp_ctors' to its own test. It prevents requiring 'cpp' in the 'unittests' that forced almost all architectures to link the unittests with `g++`. It also removes the need to have disabled tests for architectures. Some boards were actually not big enough to compile unittests. But were hidden by the 'cpp' missing feature. Blacklist boards that were disabled for cpp test even though they provide the 'cpp' feature. --- tests/cpp_ctors/Makefile | 13 +++++++++++++ .../tests-cpp_ctors => cpp_ctors}/README.md | 0 .../main.c} | 6 ++++-- .../tests-cpp_ctors-class.cpp | 0 .../tests-cpp_ctors.cpp | 0 .../tests-cpp_ctors.h | 9 +-------- tests/cpp_ctors/tests/01-run.py | 18 ++++++++++++++++++ tests/unittests/Makefile | 17 ++++++++--------- tests/unittests/tests-cpp_ctors/Makefile | 1 - .../unittests/tests-cpp_ctors/Makefile.include | 1 - 10 files changed, 44 insertions(+), 21 deletions(-) create mode 100644 tests/cpp_ctors/Makefile rename tests/{unittests/tests-cpp_ctors => cpp_ctors}/README.md (100%) rename tests/{unittests/tests-cpp_ctors/tests-cpp_ctors-trampoline.c => cpp_ctors/main.c} (96%) rename tests/{unittests/tests-cpp_ctors => cpp_ctors}/tests-cpp_ctors-class.cpp (100%) rename tests/{unittests/tests-cpp_ctors => cpp_ctors}/tests-cpp_ctors.cpp (100%) rename tests/{unittests/tests-cpp_ctors => cpp_ctors}/tests-cpp_ctors.h (88%) create mode 100755 tests/cpp_ctors/tests/01-run.py delete mode 100644 tests/unittests/tests-cpp_ctors/Makefile delete mode 100644 tests/unittests/tests-cpp_ctors/Makefile.include diff --git a/tests/cpp_ctors/Makefile b/tests/cpp_ctors/Makefile new file mode 100644 index 0000000000..7d5fddbbf9 --- /dev/null +++ b/tests/cpp_ctors/Makefile @@ -0,0 +1,13 @@ +include ../Makefile.tests_common + +# HACK were disabled for `armv7` in unittests and fail to pass the test +BOARD_BLACKLIST += avsextrem +BOARD_BLACKLIST += msba2 + +USEMODULE += embunit + +FEATURES_REQUIRED += cpp + +DISABLE_MODULE += auto_init + +include $(RIOTBASE)/Makefile.include diff --git a/tests/unittests/tests-cpp_ctors/README.md b/tests/cpp_ctors/README.md similarity index 100% rename from tests/unittests/tests-cpp_ctors/README.md rename to tests/cpp_ctors/README.md diff --git a/tests/unittests/tests-cpp_ctors/tests-cpp_ctors-trampoline.c b/tests/cpp_ctors/main.c similarity index 96% rename from tests/unittests/tests-cpp_ctors/tests-cpp_ctors-trampoline.c rename to tests/cpp_ctors/main.c index ab98e75ea6..93316164f4 100644 --- a/tests/unittests/tests-cpp_ctors/tests-cpp_ctors-trampoline.c +++ b/tests/cpp_ctors/main.c @@ -7,7 +7,6 @@ */ #include "embUnit.h" -#include "embUnit/embUnit.h" #include "tests-cpp_ctors.h" #include "thread.h" /* For thread_getpid() */ @@ -57,7 +56,10 @@ Test *tests_cpp_ctors_tests(void) return (Test *)&cpp_tests; } -void tests_cpp_ctors(void) +int main(void) { + TESTS_START(); TESTS_RUN(tests_cpp_ctors_tests()); + TESTS_END(); + return 0; } diff --git a/tests/unittests/tests-cpp_ctors/tests-cpp_ctors-class.cpp b/tests/cpp_ctors/tests-cpp_ctors-class.cpp similarity index 100% rename from tests/unittests/tests-cpp_ctors/tests-cpp_ctors-class.cpp rename to tests/cpp_ctors/tests-cpp_ctors-class.cpp diff --git a/tests/unittests/tests-cpp_ctors/tests-cpp_ctors.cpp b/tests/cpp_ctors/tests-cpp_ctors.cpp similarity index 100% rename from tests/unittests/tests-cpp_ctors/tests-cpp_ctors.cpp rename to tests/cpp_ctors/tests-cpp_ctors.cpp diff --git a/tests/unittests/tests-cpp_ctors/tests-cpp_ctors.h b/tests/cpp_ctors/tests-cpp_ctors.h similarity index 88% rename from tests/unittests/tests-cpp_ctors/tests-cpp_ctors.h rename to tests/cpp_ctors/tests-cpp_ctors.h index 3c9ed8435e..c095f50a0d 100644 --- a/tests/unittests/tests-cpp_ctors/tests-cpp_ctors.h +++ b/tests/cpp_ctors/tests-cpp_ctors.h @@ -20,14 +20,7 @@ #ifdef __cplusplus extern "C" { -#endif - -/** - * @brief The entry point of this test suite. - */ -void tests_cpp(void); - -#ifdef __cplusplus + /* static test complains if this is not there */ } #endif diff --git a/tests/cpp_ctors/tests/01-run.py b/tests/cpp_ctors/tests/01-run.py new file mode 100755 index 0000000000..1dcdd41c14 --- /dev/null +++ b/tests/cpp_ctors/tests/01-run.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +# Copyright (C) 2019 Freie Universität Berlin +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. + +import sys +from testrunner import run + + +def testfunc(child): + child.expect(r'OK \(\d+ tests\)') + + +if __name__ == "__main__": + sys.exit(run(testfunc)) diff --git a/tests/unittests/Makefile b/tests/unittests/Makefile index 72e1b42aee..040261062b 100644 --- a/tests/unittests/Makefile +++ b/tests/unittests/Makefile @@ -36,9 +36,14 @@ BOARD_INSUFFICIENT_MEMORY := airfy-beacon \ cc2650-launchpad \ cc2650stk \ chronos \ + esp8266-esp-12x \ + esp8266-olimex-mod \ + esp8266-sparkfun-thing \ ek-lm4f120xl \ feather-m0 \ hamilton \ + hifive1 \ + hifive1b \ i-nucleo-lrwan1 \ ikea-tradfri \ limifrog-v1 maple-mini \ @@ -109,7 +114,7 @@ endif ARM7_BOARDS := avsextrem \ msba2 \ # -DISABLE_TEST_FOR_ARM7 := tests-cpp_% +DISABLE_TEST_FOR_ARM7 := ARM_CORTEX_M_BOARDS := airfy-beacon \ arduino-due \ @@ -220,7 +225,7 @@ AVR_BOARDS := arduino-duemilanove \ arduino-uno \ waspmote-pro \ # -DISABLE_TEST_FOR_AVR := tests-cpp_% +DISABLE_TEST_FOR_AVR := MSP430_BOARDS := chronos \ msb-430 \ @@ -230,7 +235,7 @@ MSP430_BOARDS := chronos \ wsn430-v1_4 \ z1 \ # -DISABLE_TEST_FOR_MSP430 := tests-cpp_% +DISABLE_TEST_FOR_MSP430 := ifneq (, $(filter $(ARM7_BOARDS), $(BOARD))) UNIT_TESTS := $(filter-out $(DISABLE_TEST_FOR_ARM7), $(UNIT_TESTS)) @@ -248,12 +253,6 @@ ifneq (, $(filter $(MSP430_BOARDS), $(BOARD))) UNIT_TESTS := $(filter-out $(DISABLE_TEST_FOR_MSP430), $(UNIT_TESTS)) endif -ifneq (,$(filter tests-cpp_%, $(UNIT_TESTS))) - # We need to tell the build system to use the C++ compiler for linking - export FEATURES_REQUIRED += cpp - export CPPMIX := 1 -endif - DISABLE_MODULE += auto_init # Pull in `Makefile.include`s from the test suites: diff --git a/tests/unittests/tests-cpp_ctors/Makefile b/tests/unittests/tests-cpp_ctors/Makefile deleted file mode 100644 index 48422e909a..0000000000 --- a/tests/unittests/tests-cpp_ctors/Makefile +++ /dev/null @@ -1 +0,0 @@ -include $(RIOTBASE)/Makefile.base diff --git a/tests/unittests/tests-cpp_ctors/Makefile.include b/tests/unittests/tests-cpp_ctors/Makefile.include deleted file mode 100644 index e355de5d71..0000000000 --- a/tests/unittests/tests-cpp_ctors/Makefile.include +++ /dev/null @@ -1 +0,0 @@ -FEATURES_REQUIRED += cpp From 1e0ca7ca7f7fcb56a208645736a95acc88585b52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Tue, 20 Aug 2019 15:19:53 +0200 Subject: [PATCH 3/3] tests/unittests: remove the 'DISABLE_TEST_FOR_ARCH' Remove the arch disabling tests handling as now unused. If something like this is necessary again the test must be put outside of unittests. --- tests/unittests/Makefile | 142 --------------------------------------- 1 file changed, 142 deletions(-) diff --git a/tests/unittests/Makefile b/tests/unittests/Makefile index 040261062b..5b3b12584d 100644 --- a/tests/unittests/Makefile +++ b/tests/unittests/Makefile @@ -111,148 +111,6 @@ else UNIT_TESTS := $(filter tests-%, $(MAKECMDGOALS)) endif -ARM7_BOARDS := avsextrem \ - msba2 \ - # -DISABLE_TEST_FOR_ARM7 := - -ARM_CORTEX_M_BOARDS := airfy-beacon \ - arduino-due \ - arduino-mkr1000 \ - arduino-mkrfox1200 \ - arduino-mkrzero \ - arduino-zero \ - b-l072z-lrwan1 \ - bluepill \ - calliope-mini \ - cc2538dk \ - cc2650-launchpad \ - cc2650stk \ - ek-lm4f120xl \ - f4vi1 \ - feather-m0 \ - firefly \ - fox \ - frdm-k22f \ - frdm-k64f \ - frdm-kw41z \ - i-nucleo-lrwan1 \ - ikea-tradfri \ - iotlab-a8-m3 \ - iotlab-m3 \ - limifrog-v1 \ - lsn50 \ - maple-mini \ - mbed_lpc1768 \ - microbit \ - msbiot \ - mulle \ - nrf51dk \ - nrf51dongle \ - nrf52840dk \ - nrf52dk \ - nrf6310 \ - nucleo-f207zg \ - nucleo-f303ze \ - nucleo-f412zg \ - nucleo-f413zh \ - nucleo-f429zi \ - nucleo-f446ze \ - nucleo-f722ze \ - nucleo-f746zg \ - nucleo-f767zi \ - nucleo-f031k6 \ - nucleo-f042k6 \ - nucleo-f303k8 \ - nucleo-l031k6 \ - nucleo-l432kc \ - nucleo-f030r8 \ - nucleo-f070rb \ - nucleo-f072rb \ - nucleo-f091rc \ - nucleo-f103rb \ - nucleo-f302r8 \ - nucleo-f303re \ - nucleo-f334r8 \ - nucleo-f401re \ - nucleo-f410rb \ - nucleo-f411re \ - nucleo-f446re \ - nucleo-l053r8 \ - nucleo-l073rz \ - nucleo-l152re \ - nucleo-l433rc \ - nucleo-l476rg \ - nucleo-l496zg \ - nz32-sc151 \ - opencm904 \ - openmote-cc2538 \ - pba-d-01-kw2x \ - remote-pa \ - remote-reva \ - remote-revb \ - saml10-xpro \ - saml11-xpro \ - samd21-xpro \ - saml21-xpro \ - samr21-xpro \ - samr30-xpro \ - seeeduino_arch-pro \ - slstk3401a \ - slstk3402a \ - sltb001a \ - slwstk6000b \ - slwstk6220a \ - sodaq-autonomo \ - sodaq-explorer \ - sodaq-one \ - spark-core \ - stk3600 \ - stk3700 \ - stm32f0discovery \ - stm32f3discovery \ - stm32f4discovery \ - stm32f769i-disco \ - stm32l0538-disco \ - udoo \ - usb-kw41z \ - yunjia-nrf51822 \ - # -DISABLE_TEST_FOR_ARM_CORTEX_M := - -AVR_BOARDS := arduino-duemilanove \ - arduino-mega2560 \ - arduino-uno \ - waspmote-pro \ - # -DISABLE_TEST_FOR_AVR := - -MSP430_BOARDS := chronos \ - msb-430 \ - msb-430h \ - telosb \ - wsn430-v1_3b \ - wsn430-v1_4 \ - z1 \ - # -DISABLE_TEST_FOR_MSP430 := - -ifneq (, $(filter $(ARM7_BOARDS), $(BOARD))) - UNIT_TESTS := $(filter-out $(DISABLE_TEST_FOR_ARM7), $(UNIT_TESTS)) -endif - -ifneq (, $(filter $(ARM_CORTEX_M_BOARDS), $(BOARD))) - UNIT_TESTS := $(filter-out $(DISABLE_TEST_FOR_ARM_CORTEX_M), $(UNIT_TESTS)) -endif - -ifneq (, $(filter $(AVR_BOARDS), $(BOARD))) - UNIT_TESTS := $(filter-out $(DISABLE_TEST_FOR_AVR), $(UNIT_TESTS)) -endif - -ifneq (, $(filter $(MSP430_BOARDS), $(BOARD))) - UNIT_TESTS := $(filter-out $(DISABLE_TEST_FOR_MSP430), $(UNIT_TESTS)) -endif - DISABLE_MODULE += auto_init # Pull in `Makefile.include`s from the test suites: