diff --git a/tests/devfs/Makefile b/tests/devfs/Makefile new file mode 100644 index 0000000000..87968a1f94 --- /dev/null +++ b/tests/devfs/Makefile @@ -0,0 +1,12 @@ +include ../Makefile.tests_common + +USEMODULE += embunit + +USEMODULE += vfs +USEMODULE += devfs +USEMODULE += devfs_random +USEMODULE += devfs_hwrng + +TEST_ON_CI_WHITELIST += all + +include $(RIOTBASE)/Makefile.include diff --git a/tests/unittests/tests-devfs/tests-devfs.c b/tests/devfs/main.c similarity index 96% rename from tests/unittests/tests-devfs/tests-devfs.c rename to tests/devfs/main.c index 48420ce203..99e939baa3 100644 --- a/tests/unittests/tests-devfs/tests-devfs.c +++ b/tests/devfs/main.c @@ -23,9 +23,7 @@ #include "fs/devfs.h" #include "random.h" -#include "embUnit/embUnit.h" - -#include "tests-devfs.h" +#include "embUnit.h" static int _mock_open(vfs_file_t *filp, const char *name, int flags, mode_t mode, const char *abs_path); static ssize_t _mock_read(vfs_file_t *filp, void *dest, size_t nbytes); @@ -169,7 +167,7 @@ static void test_devfs_hwrng(void) TEST_ASSERT(memcmp(zeroes, buf, sizeof(buf))); } -Test *tests_devfs_tests(void) +Test *tests_devfs(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture(test_devfs_register), @@ -183,13 +181,16 @@ Test *tests_devfs_tests(void) return (Test *)&devfs_tests; } -void tests_devfs(void) +int main(void) { extern void auto_init_devfs(void); auto_init_devfs(); random_init(1); - TESTS_RUN(tests_devfs_tests()); + TESTS_START(); + TESTS_RUN(tests_devfs()); + TESTS_END(); + return 0; } /** @} */ diff --git a/tests/devfs/tests/01-run.py b/tests/devfs/tests/01-run.py new file mode 100755 index 0000000000..1dcdd41c14 --- /dev/null +++ b/tests/devfs/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/tests-devfs/Makefile b/tests/unittests/tests-devfs/Makefile deleted file mode 100644 index 48422e909a..0000000000 --- a/tests/unittests/tests-devfs/Makefile +++ /dev/null @@ -1 +0,0 @@ -include $(RIOTBASE)/Makefile.base diff --git a/tests/unittests/tests-devfs/Makefile.include b/tests/unittests/tests-devfs/Makefile.include deleted file mode 100644 index e337f4691a..0000000000 --- a/tests/unittests/tests-devfs/Makefile.include +++ /dev/null @@ -1,4 +0,0 @@ -USEMODULE += vfs -USEMODULE += devfs -USEMODULE += devfs_random -USEMODULE += devfs_hwrng diff --git a/tests/unittests/tests-devfs/tests-devfs.h b/tests/unittests/tests-devfs/tests-devfs.h deleted file mode 100644 index 1d9a45e66a..0000000000 --- a/tests/unittests/tests-devfs/tests-devfs.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2016 Eistec AB - * - * 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. - */ - -/** - * @addtogroup unittests - * @{ - * - * @file - * @brief Unittests for DevFS - * - * @author Joakim NohlgÄrd - */ -#ifndef TESTS_DEVFS_H -#define TESTS_DEVFS_H - -#include "embUnit.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief The entry point of this test suite. - */ -void tests_devfs(void); - -#ifdef __cplusplus -} -#endif - -#endif /* TESTS_DEVFS_H */ -/** @} */