diff --git a/tests/pkg_littlefs/Makefile b/tests/pkg_littlefs/Makefile new file mode 100644 index 0000000000..59c55aaf8a --- /dev/null +++ b/tests/pkg_littlefs/Makefile @@ -0,0 +1,33 @@ +include ../Makefile.tests_common + +BOARD_INSUFFICIENT_MEMORY := arduino-duemilanove \ + arduino-leonardo \ + arduino-nano \ + arduino-uno \ + i-nucleo-lrwan1 \ + nucleo-f031k6 \ + nucleo-f042k6 \ + nucleo-l031k6 \ + nucleo-l053r8 \ + nucleo-f030r8 \ + stm32f0discovery \ + +BOARD_BLACKLIST := chronos \ + msb-430 \ + msb-430h \ + telosb \ + wsn430-v1_3b \ + wsn430-v1_4 \ + z1 \ + +TEST_ON_CI_WHITELIST += all + +# Set vfs file and dir buffer sizes +CFLAGS += -DVFS_FILE_BUFFER_SIZE=56 -DVFS_DIR_BUFFER_SIZE=44 +# Reduce LFS_NAME_MAX to 31 (as VFS_NAME_MAX default) +CFLAGS += -DLFS_NAME_MAX=31 + +USEMODULE += littlefs +USEMODULE += embunit + +include $(RIOTBASE)/Makefile.include diff --git a/tests/unittests/tests-littlefs/tests-littlefs.c b/tests/pkg_littlefs/main.c similarity index 98% rename from tests/unittests/tests-littlefs/tests-littlefs.c rename to tests/pkg_littlefs/main.c index e98971b758..ed4e86c4f6 100644 --- a/tests/unittests/tests-littlefs/tests-littlefs.c +++ b/tests/pkg_littlefs/main.c @@ -21,9 +21,7 @@ #include #include -#include "embUnit/embUnit.h" - -#include "tests-littlefs.h" +#include "embUnit.h" /* Define MTD_0 in board.h to use the board mtd if any */ #ifdef MTD_0 @@ -404,7 +402,7 @@ static void tests_littlefs_statvfs(void) TEST_ASSERT(stat1.f_bavail > stat2.f_bavail); } -Test *tests_littlefs_tests(void) +Test *tests_littlefs(void) { #ifndef MTD_0 memset(dummy_memory, 0xff, sizeof(dummy_memory)); @@ -426,8 +424,11 @@ Test *tests_littlefs_tests(void) return (Test *)&littlefs_tests; } -void tests_littlefs(void) +int main(void) { - TESTS_RUN(tests_littlefs_tests()); + TESTS_START(); + TESTS_RUN(tests_littlefs()); + TESTS_END(); + return 0; } /** @} */ diff --git a/tests/pkg_littlefs/tests/01-run.py b/tests/pkg_littlefs/tests/01-run.py new file mode 100755 index 0000000000..5fc8788f24 --- /dev/null +++ b/tests/pkg_littlefs/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-littlefs/Makefile b/tests/unittests/tests-littlefs/Makefile deleted file mode 100644 index 48422e909a..0000000000 --- a/tests/unittests/tests-littlefs/Makefile +++ /dev/null @@ -1 +0,0 @@ -include $(RIOTBASE)/Makefile.base diff --git a/tests/unittests/tests-littlefs/Makefile.include b/tests/unittests/tests-littlefs/Makefile.include deleted file mode 100644 index b73373a734..0000000000 --- a/tests/unittests/tests-littlefs/Makefile.include +++ /dev/null @@ -1,6 +0,0 @@ -USEMODULE += littlefs - -# Set vfs file and dir buffer sizes -CFLAGS += -DVFS_FILE_BUFFER_SIZE=56 -DVFS_DIR_BUFFER_SIZE=44 -# Reduce LFS_NAME_MAX to 31 (as VFS_NAME_MAX default) -CFLAGS += -DLFS_NAME_MAX=31 diff --git a/tests/unittests/tests-littlefs/tests-littlefs.h b/tests/unittests/tests-littlefs/tests-littlefs.h deleted file mode 100644 index 5e983bedb1..0000000000 --- a/tests/unittests/tests-littlefs/tests-littlefs.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2017 OTA keys S.A. - * - * 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 littlefs - * - * @author Vincent Dupont - */ -#ifndef TESTS_LITTLEFS_H -#define TESTS_LITTLEFS_H - -#include "embUnit.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief The entry point of this test suite. - */ -void tests_littlefs(void); - -#ifdef __cplusplus -} -#endif - -#endif /* TESTS_LITTLEFS_H */ -/** @} */