mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-26 18:01:35 +01:00
protect against capturing both declaration and definitions and therefore creating a runner which runs that test twice.
This commit is contained in:
@@ -80,8 +80,6 @@ class UnityTestRunnerGenerator
|
|||||||
end
|
end
|
||||||
|
|
||||||
def find_tests(source)
|
def find_tests(source)
|
||||||
tests_raw = []
|
|
||||||
tests_args = []
|
|
||||||
tests_and_line_numbers = []
|
tests_and_line_numbers = []
|
||||||
|
|
||||||
source_scrubbed = source.gsub(/\/\/.*$/, '') # remove line comments
|
source_scrubbed = source.gsub(/\/\/.*$/, '') # remove line comments
|
||||||
@@ -101,9 +99,9 @@ class UnityTestRunnerGenerator
|
|||||||
arguments.scan(/\s*TEST_CASE\s*\((.*)\)\s*$/) {|a| args << a[0]}
|
arguments.scan(/\s*TEST_CASE\s*\((.*)\)\s*$/) {|a| args << a[0]}
|
||||||
end
|
end
|
||||||
tests_and_line_numbers << { :test => name, :args => args, :call => call, :line_number => 0 }
|
tests_and_line_numbers << { :test => name, :args => args, :call => call, :line_number => 0 }
|
||||||
tests_args = []
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
tests_and_line_numbers.uniq! {|v| v[:test] }
|
||||||
|
|
||||||
#determine line numbers and create tests to run
|
#determine line numbers and create tests to run
|
||||||
source_lines = source.split("\n")
|
source_lines = source.split("\n")
|
||||||
|
|||||||
Reference in New Issue
Block a user