Browse Source

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.
dev/timer
René Kijewski 8 years ago
parent
commit
f684aa4b2d
  1. 7
      Makefile.application
  2. 10
      sys/Makefile.include
  3. 0
      sys/embunit/AUTHORS
  4. 2
      sys/embunit/AssertImpl.c
  5. 0
      sys/embunit/COPYING
  6. 0
      sys/embunit/CompilerOutputter.c
  7. 2
      sys/embunit/Makefile
  8. 0
      sys/embunit/RepeatedTest.c
  9. 0
      sys/embunit/TestCaller.c
  10. 0
      sys/embunit/TestCase.c
  11. 0
      sys/embunit/TestResult.c
  12. 2
      sys/embunit/TestRunner.c
  13. 0
      sys/embunit/TestSuite.c
  14. 0
      sys/embunit/TextOutputter.c
  15. 0
      sys/embunit/TextUIRunner.c
  16. 0
      sys/embunit/XMLOutputter.c
  17. 0
      sys/embunit/readme_en.txt
  18. 0
      sys/embunit/stdImpl.c
  19. 33
      sys/include/embUnit.h
  20. 0
      sys/include/embUnit/AssertImpl.h
  21. 0
      sys/include/embUnit/CompilerOutputter.h
  22. 0
      sys/include/embUnit/HelperMacro.h
  23. 0
      sys/include/embUnit/Outputter.h
  24. 0
      sys/include/embUnit/RepeatedTest.h
  25. 0
      sys/include/embUnit/Test.h
  26. 0
      sys/include/embUnit/TestCaller.h
  27. 0
      sys/include/embUnit/TestCase.h
  28. 0
      sys/include/embUnit/TestListener.h
  29. 0
      sys/include/embUnit/TestResult.h
  30. 0
      sys/include/embUnit/TestRunner.h
  31. 0
      sys/include/embUnit/TestSuite.h
  32. 0
      sys/include/embUnit/TextOutputter.h
  33. 0
      sys/include/embUnit/TextUIRunner.h
  34. 0
      sys/include/embUnit/XMLOutputter.h
  35. 0
      sys/include/embUnit/embUnit.h
  36. 0
      sys/include/embUnit/embUnit_config.h
  37. 0
      sys/include/embUnit/stdImpl.h
  38. 13
      tests/unittests/Makefile
  39. 5
      tests/unittests/embunit/textui/Makefile
  40. 2
      tests/unittests/main.c
  41. 2
      tests/unittests/tests-bloom/tests-bloom.h
  42. 2
      tests/unittests/tests-cbor/tests-cbor.c
  43. 2
      tests/unittests/tests-core/tests-core-atomic.c
  44. 2
      tests/unittests/tests-core/tests-core-bitarithm.c
  45. 2
      tests/unittests/tests-core/tests-core-byteorder.c
  46. 2
      tests/unittests/tests-core/tests-core-cib.c
  47. 2
      tests/unittests/tests-core/tests-core-clist.c
  48. 2
      tests/unittests/tests-core/tests-core-lifo.c
  49. 2
      tests/unittests/tests-core/tests-core-priority-queue.c
  50. 2
      tests/unittests/tests-core/tests-core.h
  51. 2
      tests/unittests/tests-crypto/tests-crypto.h
  52. 2
      tests/unittests/tests-netdev_dummy/tests-netdev_dummy.c
  53. 2
      tests/unittests/tests-netdev_dummy/tests-netdev_dummy.h
  54. 2
      tests/unittests/tests-pktbuf/tests-pktbuf.c
  55. 2
      tests/unittests/tests-pktbuf/tests-pktbuf.h
  56. 2
      tests/unittests/tests-pktqueue/tests-pktqueue.c
  57. 3
      tests/unittests/tests-pktqueue/tests-pktqueue.h
  58. 2
      tests/unittests/tests-timex/tests-timex.h
  59. 1
      tests/unittests/tests-ubjson/test-ubjson-empty-array.c
  60. 1
      tests/unittests/tests-ubjson/test-ubjson-empty-object.c
  61. 2
      tests/unittests/tests-ubjson/tests-ubjson.c
  62. 6
      tests/unittests/tests-ubjson/tests-ubjson.h

7
Makefile.application

@ -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

10
sys/Makefile.include

@ -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

0
tests/unittests/embunit/AUTHORS → sys/embunit/AUTHORS

2
tests/unittests/embunit/embUnit/AssertImpl.c → sys/embunit/AssertImpl.c

@ -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"

0
tests/unittests/embunit/COPYING → sys/embunit/COPYING

0
tests/unittests/embunit/textui/CompilerOutputter.c → sys/embunit/CompilerOutputter.c

2
tests/unittests/embunit/embUnit/Makefile → sys/embunit/Makefile

@ -1,5 +1,5 @@
MODULE = embunit
INCLUDES += -I$(RIOTBASE)/tests/unittests/embunit
INCLUDES += -I$(RIOTBASE)/sys/include/embUnit
include $(RIOTBASE)/Makefile.base

0
tests/unittests/embunit/embUnit/RepeatedTest.c → sys/embunit/RepeatedTest.c

0
tests/unittests/embunit/embUnit/TestCaller.c → sys/embunit/TestCaller.c

0
tests/unittests/embunit/embUnit/TestCase.c → sys/embunit/TestCase.c

0
tests/unittests/embunit/embUnit/TestResult.c → sys/embunit/TestResult.c

2
tests/unittests/embunit/embUnit/TestRunner.c → sys/embunit/TestRunner.c

@ -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"

0
tests/unittests/embunit/embUnit/TestSuite.c → sys/embunit/TestSuite.c

0
tests/unittests/embunit/textui/TextOutputter.c → sys/embunit/TextOutputter.c

0
tests/unittests/embunit/textui/TextUIRunner.c → sys/embunit/TextUIRunner.c

0
tests/unittests/embunit/textui/XMLOutputter.c → sys/embunit/XMLOutputter.c

0
tests/unittests/embunit/readme_en.txt → sys/embunit/readme_en.txt

0
tests/unittests/embunit/embUnit/stdImpl.c → sys/embunit/stdImpl.c

33
tests/unittests/unittests.h → sys/include/embUnit.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
/**
* @}
*/

0
tests/unittests/embunit/embUnit/AssertImpl.h → sys/include/embUnit/AssertImpl.h

0
tests/unittests/embunit/textui/CompilerOutputter.h → sys/include/embUnit/CompilerOutputter.h

0
tests/unittests/embunit/embUnit/HelperMacro.h → sys/include/embUnit/HelperMacro.h

0
tests/unittests/embunit/textui/Outputter.h → sys/include/embUnit/Outputter.h

0
tests/unittests/embunit/embUnit/RepeatedTest.h → sys/include/embUnit/RepeatedTest.h

0
tests/unittests/embunit/embUnit/Test.h → sys/include/embUnit/Test.h

0
tests/unittests/embunit/embUnit/TestCaller.h → sys/include/embUnit/TestCaller.h

0
tests/unittests/embunit/embUnit/TestCase.h → sys/include/embUnit/TestCase.h

0
tests/unittests/embunit/embUnit/TestListener.h → sys/include/embUnit/TestListener.h

0
tests/unittests/embunit/embUnit/TestResult.h → sys/include/embUnit/TestResult.h

0
tests/unittests/embunit/embUnit/TestRunner.h → sys/include/embUnit/TestRunner.h

0
tests/unittests/embunit/embUnit/TestSuite.h → sys/include/embUnit/TestSuite.h

0
tests/unittests/embunit/textui/TextOutputter.h → sys/include/embUnit/TextOutputter.h

0
tests/unittests/embunit/textui/TextUIRunner.h → sys/include/embUnit/TextUIRunner.h

0
tests/unittests/embunit/textui/XMLOutputter.h → sys/include/embUnit/XMLOutputter.h

0
tests/unittests/embunit/embUnit/embUnit.h → sys/include/embUnit/embUnit.h

0
tests/unittests/embunit/embUnit/config.h → sys/include/embUnit/embUnit_config.h

0
tests/unittests/embunit/embUnit/stdImpl.h → sys/include/embUnit/stdImpl.h

13
tests/unittests/Makefile

@ -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\""

5
tests/unittests/embunit/textui/Makefile

@ -1,5 +0,0 @@
MODULE = embunit_textui
INCLUDES += -I$(RIOTBASE)/tests/unittests/embunit
include $(RIOTBASE)/Makefile.base

2
tests/unittests/main.c

@ -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)

2
tests/unittests/tests-bloom/tests-bloom.h

@ -18,7 +18,7 @@
#ifndef __TESTS_BLOOM_H_
#define __TESTS_BLOOM_H_
#include "../unittests.h"
#include "embUnit.h"
#ifdef __cplusplus
extern "C" {

2
tests/unittests/tests-cbor/tests-cbor.c

@ -13,7 +13,7 @@
* @author Jana Cavojska <jana.cavojska9@gmail.com>
*/
#include "../unittests.h"
#include "embUnit.h"
#include "bitarithm.h"
#include "cbor.h"

2
tests/unittests/tests-core/tests-core-atomic.c

@ -8,7 +8,7 @@
#include <limits.h>
#include "embUnit/embUnit.h"
#include "embUnit.h"
#include "atomic.h"

2
tests/unittests/tests-core/tests-core-bitarithm.c

@ -9,7 +9,7 @@
#include <limits.h>
#include <stdint.h>
#include "embUnit/embUnit.h"
#include "embUnit.h"
#include "bitarithm.h"

2
tests/unittests/tests-core/tests-core-byteorder.c

@ -6,7 +6,7 @@
* directory for more details.
*/
#include "embUnit/embUnit.h"
#include "embUnit.h"
#include "byteorder.h"

2
tests/unittests/tests-core/tests-core-cib.c

@ -6,7 +6,7 @@
* directory for more details.
*/
#include "embUnit/embUnit.h"
#include "embUnit.h"
#include "cib.h"

2
tests/unittests/tests-core/tests-core-clist.c

@ -8,7 +8,7 @@
#include <string.h>
#include "embUnit/embUnit.h"
#include "embUnit.h"
#include "clist.h"

2
tests/unittests/tests-core/tests-core-lifo.c

@ -6,7 +6,7 @@
* directory for more details.
*/
#include "embUnit/embUnit.h"
#include "embUnit.h"
#include "lifo.h"

2
tests/unittests/tests-core/tests-core-priority-queue.c

@ -7,7 +7,7 @@
*/
#include <string.h>
#include "embUnit/embUnit.h"
#include "embUnit.h"
#include "priority_queue.h"

2
tests/unittests/tests-core/tests-core.h

@ -18,7 +18,7 @@
#ifndef __TESTS_CORE_H_
#define __TESTS_CORE_H_
#include "../unittests.h"
#include "embUnit.h"
#ifdef __cplusplus
extern "C" {

2
tests/unittests/tests-crypto/tests-crypto.h

@ -18,7 +18,7 @@
#ifndef __TESTS_CRYPTO_H_
#define __TESTS_CRYPTO_H_
#include "../unittests.h"
#include "embUnit.h"
#ifdef __cplusplus
extern "C" {

2
tests/unittests/tests-netdev_dummy/tests-netdev_dummy.c

@ -12,7 +12,7 @@
#include "clist.h"
#include "embUnit/embUnit.h"
#include "embUnit.h"
#include "netdev_dummy.h"

2
tests/unittests/tests-netdev_dummy/tests-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" {

2
tests/unittests/tests-pktbuf/tests-pktbuf.c

@ -14,7 +14,7 @@
#include <errno.h>
#include <stdint.h>
#include "embUnit/embUnit.h"
#include "embUnit.h"
#include "pktbuf.h"

2
tests/unittests/tests-pktbuf/tests-pktbuf.h

@ -18,7 +18,7 @@
#ifndef __TESTS_PKTBUF_H_
#define __TESTS_PKTBUF_H_
#include "../unittests.h"
#include "embUnit.h"
#ifdef __cplusplus
extern "C" {

2
tests/unittests/tests-pktqueue/tests-pktqueue.c

@ -13,7 +13,7 @@
*/
#include <string.h>
#include "embUnit/embUnit.h"
#include "embUnit.h"
#include "pktqueue.h"

3
tests/unittests/tests-pktqueue/tests-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

2
tests/unittests/tests-timex/tests-timex.h

@ -19,7 +19,7 @@
#ifndef __TESTS_TIMEX_H_
#define __TESTS_TIMEX_H_
#include "../unittests.h"
#include "embUnit.h"
#ifdef __cplusplus
extern "C" {

1
tests/unittests/tests-ubjson/test-ubjson-empty-array.c

@ -17,6 +17,7 @@
*/
#include "tests-ubjson.h"
#include "kernel.h"
typedef enum {
BEFORE_ARRAY_1 = __LINE__,

1
tests/unittests/tests-ubjson/test-ubjson-empty-object.c

@ -17,6 +17,7 @@
*/
#include "tests-ubjson.h"
#include "kernel.h"
typedef enum {
BEFORE_ARRAY_1 = __LINE__,

2
tests/unittests/tests-ubjson/tests-ubjson.c

@ -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;

6
tests/unittests/tests-ubjson/tests-ubjson.h

@ -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…
Cancel
Save