1
0
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:
Francisco Molina 2021-02-16 17:15:52 +01:00
parent 60825adc49
commit 2bb8cb4b55
No known key found for this signature in database
GPG Key ID: 3E94EAC3DBDEEDA8
7 changed files with 39 additions and 41 deletions

View File

@ -0,0 +1,8 @@
include ../Makefile.tests_common
USEMODULE += embunit
# avoid running Kconfig by default
SHOULD_RUN_KCONFIG ?=
include $(RIOTBASE)/Makefile.include

View 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

View File

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

View 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())

View File

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

View File

@ -1 +0,0 @@
FEATURES_REQUIRED += periph_flashpage

View File

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