-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unittests: use subfolders for different tests
Unittests for e.g. different libraries can be put into `tests/unittests/tests-XXX`, where `XXX` is your test suite. If `unittests` is made with `make all` (or any explicit argument), then all test suites get built. If you use `make tests-XXX tests-YYY …` then only the test suites `XXX` and `YYY` get built.
- Loading branch information
Showing
3 changed files
with
76 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright (C) 2014 Martin Lenders | ||
* | ||
* This file is subject to the terms and conditions of the GNU Lesser General | ||
* Public License. See the file LICENSE in the top level directory for more | ||
* details. | ||
*/ | ||
|
||
/** | ||
* @addtogroup unittests | ||
* @{ | ||
* | ||
* @file unittests.h | ||
* @brief Common header file for unittests | ||
* | ||
* @author Freie Universität Berlin, Computer Systems & Telematics | ||
* @author Martine Lenders <mlenders@inf.fu-berlin.de> | ||
*/ | ||
|
||
#ifndef __UNITTESTS__H | ||
#define __UNITTESTS__H | ||
|
||
#include "embUnit/embUnit.h" | ||
|
||
#ifdef OUTPUT | ||
# define OUTPUT_XML (1) | ||
# define OUTPUT_TEXT (2) | ||
# define OUTPUT_COMPILER (4) | ||
|
||
# if (OUTPUT==OUTPUT_XML) | ||
# include "textui/XMLOutputter.h" | ||
# define OUTPUTTER (XMLOutputter_outputter()) | ||
# elif (OUTPUT==OUTPUT_TEXT) | ||
# include "textui/TextOutputter.h" | ||
# define OUTPUTTER (TextOutputter_outputter()) | ||
# elif (OUTPUT==OUTPUT_COMPILER) | ||
# include "textui/CompilerOutputter.h" | ||
# define OUTPUTTER (CompilerOutputter_outputter()) | ||
# endif | ||
|
||
# include "textui/TextUIRunner.h" | ||
|
||
# define TESTS_START() TextUIRunner_start() | ||
# define TESTS_RUN(t) TextUIRunner_runTest(t) | ||
# define TESTS_END() TextUIRunner_end() | ||
#else | ||
# define TESTS_START() TestRunner_start() | ||
# define TESTS_RUN(t) TestRunner_runTest(t) | ||
# define TESTS_END() TestRunner_end() | ||
#endif | ||
|
||
#endif |