Merge pull request #11855 from cladmi/pr/tests/unittest/split/devfs
tests/devfs: move tests-devfs out of unittests
This commit is contained in:
commit
6320fdebe9
12
tests/devfs/Makefile
Normal file
12
tests/devfs/Makefile
Normal 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
|
||||||
@ -23,9 +23,7 @@
|
|||||||
#include "fs/devfs.h"
|
#include "fs/devfs.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
|
|
||||||
#include "embUnit/embUnit.h"
|
#include "embUnit.h"
|
||||||
|
|
||||||
#include "tests-devfs.h"
|
|
||||||
|
|
||||||
static int _mock_open(vfs_file_t *filp, const char *name, int flags, mode_t mode, const char *abs_path);
|
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);
|
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_ASSERT(memcmp(zeroes, buf, sizeof(buf)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Test *tests_devfs_tests(void)
|
Test *tests_devfs(void)
|
||||||
{
|
{
|
||||||
EMB_UNIT_TESTFIXTURES(fixtures) {
|
EMB_UNIT_TESTFIXTURES(fixtures) {
|
||||||
new_TestFixture(test_devfs_register),
|
new_TestFixture(test_devfs_register),
|
||||||
@ -183,13 +181,16 @@ Test *tests_devfs_tests(void)
|
|||||||
return (Test *)&devfs_tests;
|
return (Test *)&devfs_tests;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tests_devfs(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
extern void auto_init_devfs(void);
|
extern void auto_init_devfs(void);
|
||||||
auto_init_devfs();
|
auto_init_devfs();
|
||||||
|
|
||||||
random_init(1);
|
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
18
tests/devfs/tests/01-run.py
Executable 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))
|
||||||
@ -1 +0,0 @@
|
|||||||
include $(RIOTBASE)/Makefile.base
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
USEMODULE += vfs
|
|
||||||
USEMODULE += devfs
|
|
||||||
USEMODULE += devfs_random
|
|
||||||
USEMODULE += devfs_hwrng
|
|
||||||
@ -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 */
|
|
||||||
/** @} */
|
|
||||||
Loading…
x
Reference in New Issue
Block a user