Skip to content

Commit

Permalink
protect against capturing both declaration and definitions and theref…
Browse files Browse the repository at this point in the history
…ore creating a runner which runs that test twice.
  • Loading branch information
mvandervoord committed Jul 21, 2015
1 parent 16a7d30 commit ab7e322
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions auto/generate_test_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ def generate(input_file, output_file, tests, used_mocks, testfile_includes)
end

def find_tests(source)
tests_raw = []
tests_args = []
tests_and_line_numbers = []

source_scrubbed = source.gsub(/\/\/.*$/, '') # remove line comments
Expand All @@ -101,9 +99,9 @@ def find_tests(source)
arguments.scan(/\s*TEST_CASE\s*\((.*)\)\s*$/) {|a| args << a[0]}
end
tests_and_line_numbers << { :test => name, :args => args, :call => call, :line_number => 0 }
tests_args = []
end
end
tests_and_line_numbers.uniq! {|v| v[:test] }

#determine line numbers and create tests to run
source_lines = source.split("\n")
Expand Down

0 comments on commit ab7e322

Please sign in to comment.