Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/devfs: move tests-devfs out of unittests [backport 2019.07] #11858

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tests/devfs/Makefile
Original file line number Diff line number Diff line change
@@ -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
13 changes: 7 additions & 6 deletions tests/unittests/tests-devfs/tests-devfs.c → tests/devfs/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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),
Expand All @@ -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 changes: 18 additions & 0 deletions tests/devfs/tests/01-run.py
Original file line number Diff line number Diff line change
@@ -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 change: 0 additions & 1 deletion tests/unittests/tests-devfs/Makefile

This file was deleted.

4 changes: 0 additions & 4 deletions tests/unittests/tests-devfs/Makefile.include

This file was deleted.

37 changes: 0 additions & 37 deletions tests/unittests/tests-devfs/tests-devfs.h

This file was deleted.