1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #10212 from bergzand/pr/pkg/littlefs_move

tests/littlefs: Move from unittests to regular test
This commit is contained in:
Gaëtan Harter 2019-05-28 18:03:42 +02:00 committed by GitHub
commit 7db8984f85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 58 additions and 50 deletions

View File

@ -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

View File

@ -21,9 +21,7 @@
#include <string.h>
#include <unistd.h>
#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;
}
/** @} */

View File

@ -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))

View File

@ -1 +0,0 @@
include $(RIOTBASE)/Makefile.base

View File

@ -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

View File

@ -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 <vincent@otakeys.com>
*/
#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 */
/** @} */