mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
tests/unittests/tests-flashpage: move out of unittests
Co-authored-by: Martine Lenders <mlenders@inf.fu-berlin.de>
This commit is contained in:
parent
60825adc49
commit
2bb8cb4b55
8
tests/periph_flashpage_unittest/Makefile
Normal file
8
tests/periph_flashpage_unittest/Makefile
Normal file
@ -0,0 +1,8 @@
|
||||
include ../Makefile.tests_common
|
||||
|
||||
USEMODULE += embunit
|
||||
|
||||
# avoid running Kconfig by default
|
||||
SHOULD_RUN_KCONFIG ?=
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
3
tests/periph_flashpage_unittest/app.config.test
Normal file
3
tests/periph_flashpage_unittest/app.config.test
Normal file
@ -0,0 +1,3 @@
|
||||
# this file enables modules defined in Kconfig. Do not use this file for
|
||||
# application configuration. This is only needed during migration.
|
||||
CONFIG_MODULE_EMBUNIT=y
|
@ -7,17 +7,22 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup tests
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Unittests for the ``flashpage`` periph driver
|
||||
*
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "cpu.h"
|
||||
#include "embUnit.h"
|
||||
#include "embUnit/embUnit.h"
|
||||
#include "tests-flashpage.h"
|
||||
|
||||
/* need to define these values before including the header */
|
||||
#ifndef FLASHPAGE_SIZE
|
||||
@ -32,6 +37,10 @@
|
||||
|
||||
#include "periph/flashpage.h"
|
||||
|
||||
#if (defined(BOARD_NATIVE) && !IS_USED(MODULE_PERIPH_FLASHPAGE))
|
||||
char _native_flash[FLASHPAGE_SIZE * FLASHPAGE_NUMOF];
|
||||
#endif
|
||||
|
||||
static void test_flashbase_addr(void)
|
||||
{
|
||||
void *addr;
|
||||
@ -72,8 +81,11 @@ Test *tests_flashpage_tests(void)
|
||||
return (Test *)&flashbase_tests;
|
||||
}
|
||||
|
||||
void tests_flashpage(void)
|
||||
int main(void)
|
||||
{
|
||||
TESTS_START();
|
||||
TESTS_RUN(tests_flashpage_tests());
|
||||
TESTS_END();
|
||||
return 0;
|
||||
}
|
||||
/** @} */
|
14
tests/periph_flashpage_unittest/tests/01-run.py
Executable file
14
tests/periph_flashpage_unittest/tests/01-run.py
Executable file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright (C) 2021 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_check_unittests
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(run_check_unittests())
|
@ -1 +0,0 @@
|
||||
include $(RIOTBASE)/Makefile.base
|
@ -1 +0,0 @@
|
||||
FEATURES_REQUIRED += periph_flashpage
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup unittests
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Unittests for the ``flashpage`` periph driver
|
||||
*
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*/
|
||||
#ifndef TESTS_FLASHPAGE_H
|
||||
#define TESTS_FLASHPAGE_H
|
||||
|
||||
#include "embUnit.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Entry point of this test suite
|
||||
*/
|
||||
void tests_flashpage(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* TESTS_FLASHPAGE_H */
|
||||
/** @} */
|
Loading…
Reference in New Issue
Block a user