Class: PATTERNS

Inherits:
Object show all
Defined in:
lib/ceedling/constants.rb

Constant Summary collapse

GLOB =
/[\*\?\{\}\[\]]/
RUBY_STRING_REPLACEMENT =
/#\{.+\}/
TOOL_EXECUTOR_ARGUMENT_REPLACEMENT =
/(\$\{(\d+)\})/
TEST_STDOUT_STATISTICS =
/\n-+\s*(\d+)\s+Tests\s+(\d+)\s+Failures\s+(\d+)\s+Ignored\s+(OK|FAIL)\s*/i
USER_INCLUDE_DIRECTIVE_FILENAME =
/#\s*include\s+\"\s*([\/\w\.\-]+)\s*\"/
SYSTEM_INCLUDE_DIRECTIVE_FILENAME =
/#\s*include\s+<\s*([\/\w\.\-]+)\s*>/
TEST_SOURCE_FILE =
/TEST_SOURCE_FILE\s*\(\s*\"\s*([^"]+)\s*\"\s*\)/
TEST_INCLUDE_PATH =
/TEST_INCLUDE_PATH\s*\(\s*\"\s*([^"]+)\s*\"\s*\)/
TEST_CASE_DIRECTIVE =

Unity's TEST_CASE()/TEST_RANGE()/TEST_MATRIX() are positional marker macros. Unity's runner generator only honors one when it sits (whitespace only in between) directly ahead of the void test_Foo(...) it configures. Captures one or more stacked calls (group 1) plus the name of the function they immediately precede (group 2). So, callers can re-associate the macro text with its function after preprocessing has separated them. The non-greedy \(.*?\) shares Unity's own limitation of not handling nested parens in macro arguments (see generate_test_runner.rb's identical fragment) -- parity, not a gap.

/((?:[ \t]*(?:TEST_CASE|TEST_RANGE|TEST_MATRIX)\s*\(.*?\)\s*)+)void\s+(\w+)\s*\(/m
PARTIAL_IMPL_FILENAME =
/\A#{PARTIAL_FILENAME_PREFIX}.+_impl#{Regexp.escape(EXTENSION_CORE_SOURCE)}\z/