-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
We are using fixtures, but unfortunately the runner generation using generate_test_runner.rb is not working anymore. It simply does not find any test. This seems to be due to the regular expressions, that are used to find tests in the code. So e.g.
TEST(PassiveTimer, can_detect_expired_timers) {
is not detected as a test, unless you manually add a line
void TEST_PassiveTimer_can_detect_expired_timers_(void);
as well. This is actually the preprocessor macro expansion, the TEST macro does perform. So far I could fix it locally by adding an additional replacement in the find_tests method UnityTestRunnerGenerator class:
# resolve fixtures if found
line = line.gsub(/TEST\s*\(\s*([A-Za-z_][A-Za-z0-9_]*)\s*\s*,\s*([A-Za-z_][A-Za-z0-9_]*)\s*\)/, 'void ' + @options[:test_prefix] + '\1_\2_(void)')
The line above simply perfoms the same expansion, the preprocessor would do anyway. Is this the right approach? Or am I using it totally wrong?