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

Merge pull request #11855 from cladmi/pr/tests/unittest/split/devfs

tests/devfs: move tests-devfs out of unittests
This commit is contained in:
Martine Lenders 2019-07-17 16:42:55 +02:00 committed by GitHub
commit 6320fdebe9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 37 additions and 48 deletions

12
tests/devfs/Makefile Normal file
View File

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

View File

@ -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;
}
/** @} */

18
tests/devfs/tests/01-run.py Executable file
View File

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

View File

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

View File

@ -1,4 +0,0 @@
USEMODULE += vfs
USEMODULE += devfs
USEMODULE += devfs_random
USEMODULE += devfs_hwrng

View File

@ -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 <joakim.nohlgard@eistec.se>
*/
#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 */
/** @} */