You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Runner generation using generate_test_runner.rb does not work with fixtures. #789
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
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?
TEST(PassiveTimer, can_detect_expired_timers) is not a valid function name. Where did you get this TEST macro as requirement? Just simply take the example test as your template and write functions as normal C functions, except that it should have test_ to be picked up as test case by scripting.
Activity
Letme commentedon Jun 25, 2025
TEST(PassiveTimer, can_detect_expired_timers)is not a valid function name. Where did you get this TEST macro as requirement? Just simply take the example test as your template and write functions as normal C functions, except that it should havetest_to be picked up as test case by scripting.https://github.com/ThrowTheSwitch/Unity/blob/master/examples/example_4/test/TestProductionCode.c
So in your case