mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-23 00:15:58 +01:00
Merge pull request #690 from ThrowTheSwitch/feature/updated-build-directives
Add/update build directives
This commit is contained in:
@@ -210,7 +210,7 @@ class UnityTestRunnerGenerator
|
|||||||
includes = {
|
includes = {
|
||||||
local: source.scan(/^\s*#include\s+\"\s*(.+\.#{@options[:include_extensions]})\s*\"/).flatten,
|
local: source.scan(/^\s*#include\s+\"\s*(.+\.#{@options[:include_extensions]})\s*\"/).flatten,
|
||||||
system: source.scan(/^\s*#include\s+<\s*(.+)\s*>/).flatten.map { |inc| "<#{inc}>" },
|
system: source.scan(/^\s*#include\s+<\s*(.+)\s*>/).flatten.map { |inc| "<#{inc}>" },
|
||||||
linkonly: source.scan(/^TEST_FILE\(\s*\"\s*(.+\.#{@options[:source_extensions]})\s*\"/).flatten
|
linkonly: source.scan(/^TEST_SOURCE_FILE\(\s*\"\s*(.+\.#{@options[:source_extensions]})\s*\"/).flatten
|
||||||
}
|
}
|
||||||
includes
|
includes
|
||||||
end
|
end
|
||||||
|
|||||||
16
src/unity.h
16
src/unity.h
@@ -113,9 +113,19 @@ void verifyTest(void);
|
|||||||
#define TEST_PASS() TEST_ABORT()
|
#define TEST_PASS() TEST_ABORT()
|
||||||
#define TEST_PASS_MESSAGE(message) do { UnityMessage((message), __LINE__); TEST_ABORT(); } while (0)
|
#define TEST_PASS_MESSAGE(message) do { UnityMessage((message), __LINE__); TEST_ABORT(); } while (0)
|
||||||
|
|
||||||
/* This macro does nothing, but it is useful for build tools (like Ceedling) to make use of this to figure out
|
/*-------------------------------------------------------
|
||||||
* which files should be linked to in order to perform a test. Use it like TEST_FILE("sandwiches.c") */
|
* Build Directives
|
||||||
#define TEST_FILE(a)
|
*-------------------------------------------------------
|
||||||
|
|
||||||
|
* These macros do nothing, but they are useful for additional build context.
|
||||||
|
* Tools (like Ceedling) can scan for these directives and make use of them for
|
||||||
|
* per-test-executable #include search paths and linking. */
|
||||||
|
|
||||||
|
/* Add source files to a test executable's compilation and linking. Ex: TEST_SOURCE_FILE("sandwiches.c") */
|
||||||
|
#define TEST_SOURCE_FILE(a)
|
||||||
|
|
||||||
|
/* Customize #include search paths for a test executable's compilation. Ex: TEST_INCLUDE_PATH("src/module_a/inc") */
|
||||||
|
#define TEST_INCLUDE_PATH(a)
|
||||||
|
|
||||||
/*-------------------------------------------------------
|
/*-------------------------------------------------------
|
||||||
* Test Asserts (simple)
|
* Test Asserts (simple)
|
||||||
|
|||||||
2
test/testdata/testRunnerGeneratorSmall.c
vendored
2
test/testdata/testRunnerGeneratorSmall.c
vendored
@@ -4,7 +4,7 @@
|
|||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
#include "Defs.h"
|
#include "Defs.h"
|
||||||
|
|
||||||
TEST_FILE("some_file.c")
|
TEST_SOURCE_FILE("some_file.c")
|
||||||
|
|
||||||
/* Notes about prefixes:
|
/* Notes about prefixes:
|
||||||
test - normal default prefix. these are "always run" tests for this procedure
|
test - normal default prefix. these are "always run" tests for this procedure
|
||||||
|
|||||||
Reference in New Issue
Block a user