mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
tests: make embUnit a normal sys module
There is nothing quite special about embUnit. This PR makes it a normal sys module, so that you can use it in any application / test.
This commit is contained in:
parent
bdfa6a26ee
commit
f684aa4b2d
@ -3,11 +3,4 @@ MODULE = $(APPLICATION)
|
||||
DIRS += $(RIOTCPU)/$(CPU) $(RIOTBOARD)/$(BOARD)
|
||||
DIRS += $(RIOTBASE)/core $(RIOTBASE)/drivers $(RIOTBASE)/sys
|
||||
|
||||
ifneq (,$(filter embunit,$(USEMODULE)))
|
||||
DIRS += $(RIOTBASE)/tests/unittests/embunit/embUnit
|
||||
endif
|
||||
ifneq (,$(filter embunit_textui,$(USEMODULE)))
|
||||
DIRS += $(RIOTBASE)/tests/unittests/embunit/textui
|
||||
endif
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
||||
|
@ -69,3 +69,13 @@ endif
|
||||
ifneq (,$(filter oneway_malloc,$(USEMODULE)))
|
||||
USEMODULE_INCLUDES += $(RIOTBASE)/sys/oneway-malloc/include
|
||||
endif
|
||||
|
||||
ifneq (,$(filter embunit,$(USEMODULE)))
|
||||
ifeq ($(OUTPUT),XML)
|
||||
CFLAGS += -DOUTPUT=OUTPUT_XML
|
||||
else ifeq ($(OUTPUT),TEXT)
|
||||
CFLAGS += -DOUTPUT=OUTPUT_TEXT
|
||||
else ifeq ($(OUTPUT),COMPILER)
|
||||
CFLAGS += -DOUTPUT=OUTPUT_COMPILER
|
||||
endif
|
||||
endif
|
||||
|
@ -32,7 +32,7 @@
|
||||
*
|
||||
* $Id: AssertImpl.c,v 1.5 2004/02/10 16:15:25 arms22 Exp $
|
||||
*/
|
||||
#include "config.h"
|
||||
#include "embUnit_config.h"
|
||||
#include "stdImpl.h"
|
||||
#include "AssertImpl.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
MODULE = embunit
|
||||
|
||||
INCLUDES += -I$(RIOTBASE)/tests/unittests/embunit
|
||||
INCLUDES += -I$(RIOTBASE)/sys/include/embUnit
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
@ -32,7 +32,7 @@
|
||||
*
|
||||
* $Id: TestRunner.c,v 1.6 2004/02/10 16:19:29 arms22 Exp $
|
||||
*/
|
||||
#include "config.h"
|
||||
#include "embUnit_config.h"
|
||||
#include "stdImpl.h"
|
||||
#include "Test.h"
|
||||
#include "TestListener.h"
|
@ -7,21 +7,18 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup unittests
|
||||
* @addtogroup unittests
|
||||
* @addtogroup sys
|
||||
* @{
|
||||
*
|
||||
* @file unittests.h
|
||||
* @brief Common header file for unittests
|
||||
* @file
|
||||
* @brief Common header file for unittests
|
||||
*
|
||||
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
|
||||
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
|
||||
*/
|
||||
|
||||
#ifndef __UNITTESTS__H
|
||||
#define __UNITTESTS__H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#ifndef __SYS__EMB_UNIT__H
|
||||
#define __SYS__EMB_UNIT__H
|
||||
|
||||
#include "embUnit/embUnit.h"
|
||||
|
||||
@ -31,17 +28,17 @@ extern "C" {
|
||||
# define OUTPUT_COMPILER (4)
|
||||
|
||||
# if (OUTPUT==OUTPUT_XML)
|
||||
# include "textui/XMLOutputter.h"
|
||||
# include "embUnit/XMLOutputter.h"
|
||||
# define OUTPUTTER (XMLOutputter_outputter())
|
||||
# elif (OUTPUT==OUTPUT_TEXT)
|
||||
# include "textui/TextOutputter.h"
|
||||
# include "embUnit/TextOutputter.h"
|
||||
# define OUTPUTTER (TextOutputter_outputter())
|
||||
# elif (OUTPUT==OUTPUT_COMPILER)
|
||||
# include "textui/CompilerOutputter.h"
|
||||
# include "embUnit/CompilerOutputter.h"
|
||||
# define OUTPUTTER (CompilerOutputter_outputter())
|
||||
# endif
|
||||
|
||||
# include "textui/TextUIRunner.h"
|
||||
# include "embUnit/TextUIRunner.h"
|
||||
|
||||
# define TESTS_START() TextUIRunner_start()
|
||||
# define TESTS_RUN(t) TextUIRunner_runTest(t)
|
||||
@ -52,8 +49,16 @@ extern "C" {
|
||||
# define TESTS_END() TestRunner_end()
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
@ -6,19 +6,6 @@ BOARD_INSUFFICIENT_RAM := chronos msb-430 msb-430h redbee-econotag stm32f0discov
|
||||
|
||||
USEMODULE += embunit
|
||||
|
||||
INCLUDES += -I$(RIOTBASE)/tests/unittests/embunit
|
||||
|
||||
ifeq ($(OUTPUT),XML)
|
||||
CFLAGS += -DOUTPUT=OUTPUT_XML
|
||||
USEMODULE += embunit_textui
|
||||
else ifeq ($(OUTPUT),TEXT)
|
||||
CFLAGS += -DOUTPUT=OUTPUT_TEXT
|
||||
USEMODULE += embunit_textui
|
||||
else ifeq ($(OUTPUT),COMPILER)
|
||||
CFLAGS += -DOUTPUT=OUTPUT_COMPILER
|
||||
USEMODULE += embunit_textui
|
||||
endif
|
||||
|
||||
# Some randomly generated but still deterministic values for testing
|
||||
CFLAGS += -DTEST_STRING8="\"o<\\\\rrB/q\""
|
||||
CFLAGS += -DTEST_STRING12="\"50U'HLKC3_ft\""
|
||||
|
@ -1,5 +0,0 @@
|
||||
MODULE = embunit_textui
|
||||
|
||||
INCLUDES += -I$(RIOTBASE)/tests/unittests/embunit
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
@ -6,9 +6,9 @@
|
||||
* directory for more details.
|
||||
*/
|
||||
|
||||
#include "unittests.h"
|
||||
#include "map.h"
|
||||
|
||||
#include "embUnit.h"
|
||||
#include "lpm.h"
|
||||
|
||||
#define UNCURRY(FUN, ARGS) FUN(ARGS)
|
||||
|
@ -18,7 +18,7 @@
|
||||
#ifndef __TESTS_BLOOM_H_
|
||||
#define __TESTS_BLOOM_H_
|
||||
|
||||
#include "../unittests.h"
|
||||
#include "embUnit.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -13,7 +13,7 @@
|
||||
* @author Jana Cavojska <jana.cavojska9@gmail.com>
|
||||
*/
|
||||
|
||||
#include "../unittests.h"
|
||||
#include "embUnit.h"
|
||||
|
||||
#include "bitarithm.h"
|
||||
#include "cbor.h"
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#include "embUnit/embUnit.h"
|
||||
#include "embUnit.h"
|
||||
|
||||
#include "atomic.h"
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "embUnit/embUnit.h"
|
||||
#include "embUnit.h"
|
||||
|
||||
#include "bitarithm.h"
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* directory for more details.
|
||||
*/
|
||||
|
||||
#include "embUnit/embUnit.h"
|
||||
#include "embUnit.h"
|
||||
|
||||
#include "byteorder.h"
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* directory for more details.
|
||||
*/
|
||||
|
||||
#include "embUnit/embUnit.h"
|
||||
#include "embUnit.h"
|
||||
|
||||
#include "cib.h"
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "embUnit/embUnit.h"
|
||||
#include "embUnit.h"
|
||||
|
||||
#include "clist.h"
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* directory for more details.
|
||||
*/
|
||||
|
||||
#include "embUnit/embUnit.h"
|
||||
#include "embUnit.h"
|
||||
|
||||
#include "lifo.h"
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
*/
|
||||
#include <string.h>
|
||||
|
||||
#include "embUnit/embUnit.h"
|
||||
#include "embUnit.h"
|
||||
|
||||
#include "priority_queue.h"
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
#ifndef __TESTS_CORE_H_
|
||||
#define __TESTS_CORE_H_
|
||||
|
||||
#include "../unittests.h"
|
||||
#include "embUnit.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -18,7 +18,7 @@
|
||||
#ifndef __TESTS_CRYPTO_H_
|
||||
#define __TESTS_CRYPTO_H_
|
||||
|
||||
#include "../unittests.h"
|
||||
#include "embUnit.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include "clist.h"
|
||||
|
||||
#include "embUnit/embUnit.h"
|
||||
#include "embUnit.h"
|
||||
|
||||
#include "netdev_dummy.h"
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
#ifndef __TESTS_NETDEV_DUMMY_H_
|
||||
#define __TESTS_NETDEV_DUMMY_H_
|
||||
|
||||
#include "../unittests.h"
|
||||
#include "embUnit.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <errno.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "embUnit/embUnit.h"
|
||||
#include "embUnit.h"
|
||||
|
||||
#include "pktbuf.h"
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
#ifndef __TESTS_PKTBUF_H_
|
||||
#define __TESTS_PKTBUF_H_
|
||||
|
||||
#include "../unittests.h"
|
||||
#include "embUnit.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -13,7 +13,7 @@
|
||||
*/
|
||||
#include <string.h>
|
||||
|
||||
#include "embUnit/embUnit.h"
|
||||
#include "embUnit.h"
|
||||
|
||||
#include "pktqueue.h"
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
#ifndef __TESTS_PKTQUEUE_H_
|
||||
#define __TESTS_PKTQUEUE_H_
|
||||
|
||||
#include "../unittests.h"
|
||||
#include "embUnit.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -29,7 +29,6 @@ extern "C" {
|
||||
*/
|
||||
void tests_pktqueue(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -19,7 +19,7 @@
|
||||
#ifndef __TESTS_TIMEX_H_
|
||||
#define __TESTS_TIMEX_H_
|
||||
|
||||
#include "../unittests.h"
|
||||
#include "embUnit.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
#include "tests-ubjson.h"
|
||||
#include "kernel.h"
|
||||
|
||||
typedef enum {
|
||||
BEFORE_ARRAY_1 = __LINE__,
|
||||
|
@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
#include "tests-ubjson.h"
|
||||
#include "kernel.h"
|
||||
|
||||
typedef enum {
|
||||
BEFORE_ARRAY_1 = __LINE__,
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include "sched.h"
|
||||
#include "msg.h"
|
||||
#include "mutex.h"
|
||||
#include "pipe.h"
|
||||
#include "irq.h"
|
||||
|
||||
static pipe_t communication_pipe;
|
||||
static ringbuffer_t pipe_rb;
|
||||
|
@ -29,13 +29,9 @@
|
||||
#ifndef TESTS__UBJSON_H__
|
||||
#define TESTS__UBJSON_H__
|
||||
|
||||
#include "../unittests.h"
|
||||
#include "msg.h"
|
||||
#include "kernel_macros.h"
|
||||
#include "irq.h"
|
||||
#include "embUnit.h"
|
||||
|
||||
#include "ubjson.h"
|
||||
#include "pipe.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
Loading…
Reference in New Issue
Block a user