From 7b0a7db2869ae0172ff838ce2aaf621cda590f5c Mon Sep 17 00:00:00 2001 From: smlng <s@mlng.net> Date: Thu, 18 Oct 2018 08:58:36 +0200 Subject: [PATCH] tests/cn-cbor: move from unittests to regular test This moves tests for the cn-cbor package from unittests to a regular test, which should help to decrease binary size of unittests. --- tests/pkg_cn-cbor/Makefile | 32 +++++++++++++++++++ .../tests-cn_cbor.c => pkg_cn-cbor/main.c} | 4 ++- tests/pkg_cn-cbor/tests/01-run.py | 18 +++++++++++ tests/unittests/tests-cn_cbor/Makefile | 8 ----- .../unittests/tests-cn_cbor/Makefile.include | 3 -- 5 files changed, 53 insertions(+), 12 deletions(-) create mode 100644 tests/pkg_cn-cbor/Makefile rename tests/{unittests/tests-cn_cbor/tests-cn_cbor.c => pkg_cn-cbor/main.c} (99%) create mode 100755 tests/pkg_cn-cbor/tests/01-run.py delete mode 100644 tests/unittests/tests-cn_cbor/Makefile delete mode 100644 tests/unittests/tests-cn_cbor/Makefile.include diff --git a/tests/pkg_cn-cbor/Makefile b/tests/pkg_cn-cbor/Makefile new file mode 100644 index 0000000000..9433aab248 --- /dev/null +++ b/tests/pkg_cn-cbor/Makefile @@ -0,0 +1,32 @@ +include ../Makefile.tests_common + +BOARD_BLACKLIST := arduino-duemilanove \ + arduino-mega2560 \ + arduino-uno \ + chronos \ + jiminy-mega256rfr2 \ + mega-xplained \ + msb-430 \ + msb-430h \ + telosb \ + waspmote-pro \ + wsn430-v1_3b \ + wsn430-v1_4 \ + z1 \ + # + +USEPKG += cn-cbor +USEMODULE += embunit +USEMODULE += fmt +USEMODULE += memarray + +# Tests will fail on platforms <64 bit if not set. +# Workaround for missing overflow detection in cn-cbor. +CFLAGS += -DCBOR_NO_LL + +# Skips test cases for floating point data types. +# CFLAGS += -DCBOR_NO_FLOAT + +TEST_ON_CI_WHITELIST += all + +include $(RIOTBASE)/Makefile.include diff --git a/tests/unittests/tests-cn_cbor/tests-cn_cbor.c b/tests/pkg_cn-cbor/main.c similarity index 99% rename from tests/unittests/tests-cn_cbor/tests-cn_cbor.c rename to tests/pkg_cn-cbor/main.c index 7d535837df..320cb1533d 100644 --- a/tests/unittests/tests-cn_cbor/tests-cn_cbor.c +++ b/tests/pkg_cn-cbor/main.c @@ -197,7 +197,9 @@ TestRef test_cn_cbor(void) return (TestRef) & tests_cn_cbor; } -void tests_cn_cbor(void) +int main(void) { + TESTS_START(); TESTS_RUN(test_cn_cbor()); + TESTS_END(); } diff --git a/tests/pkg_cn-cbor/tests/01-run.py b/tests/pkg_cn-cbor/tests/01-run.py new file mode 100755 index 0000000000..5fc8788f24 --- /dev/null +++ b/tests/pkg_cn-cbor/tests/01-run.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +# Copyright (C) 2017 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/tests-cn_cbor/Makefile b/tests/unittests/tests-cn_cbor/Makefile deleted file mode 100644 index 33ab903320..0000000000 --- a/tests/unittests/tests-cn_cbor/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -include $(RIOTBASE)/Makefile.base - -# Tests will fail on platforms <64 bit if not set. -# Workaround for missing overflow detection in cn-cbor. -CFLAGS += -DCBOR_NO_LL - -# Skips test cases for floating point data types. -# CFLAGS += -DCBOR_NO_FLOAT diff --git a/tests/unittests/tests-cn_cbor/Makefile.include b/tests/unittests/tests-cn_cbor/Makefile.include deleted file mode 100644 index defc626e78..0000000000 --- a/tests/unittests/tests-cn_cbor/Makefile.include +++ /dev/null @@ -1,3 +0,0 @@ -USEPKG += cn-cbor -USEMODULE += fmt -USEMODULE += memarray -- GitLab