mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-09-18 16:19:58 +00:00
- fixed summarizer to handle more generic input
- ignore comments in test parser - fixed a couple bugs in 16-bit support - fixed minor compiler errors for less lenient compilers - fixed error in docs. - renamed link to link_it in rakefiles to avoid collision in new versions of rake git-svn-id: http://unity.svn.sourceforge.net/svnroot/unity/trunk@136 e7d17a6e-8845-0410-bbbc-c8efb4fdad7e
This commit is contained in:
@@ -111,12 +111,17 @@ class UnityTestRunnerGenerator
|
||||
|
||||
def find_includes(input_file)
|
||||
input_file.rewind
|
||||
includes = []
|
||||
input_file.readlines.each do |line|
|
||||
scan_results = line.scan(/^\s*#include\s+\"\s*(.+)\.[hH]\s*\"/)
|
||||
includes << scan_results[0][0] if (scan_results.size > 0)
|
||||
end
|
||||
return includes
|
||||
|
||||
#read in file
|
||||
source = input_file.read
|
||||
|
||||
#remove comments (block and line, in three steps to ensure correct precedence)
|
||||
source.gsub!(/\/\/(?:.+\/\*|\*(?:$|[^\/])).*$/, '') # remove line comments that comment out the start of blocks
|
||||
source.gsub!(/\/\*.*?\*\//m, '') # remove block comments
|
||||
source.gsub!(/\/\/.*$/, '') # remove line comments (all that remain)
|
||||
|
||||
#parse out includes
|
||||
return source.scan(/^\s*#include\s+\"\s*(.+)\.[hH]\s*\"/).flatten
|
||||
end
|
||||
|
||||
def find_mocks(includes)
|
||||
|
||||
@@ -105,7 +105,7 @@ class UnityTestSummary
|
||||
end
|
||||
|
||||
def parse_test_summary(summary)
|
||||
if summary[-3..-1].join("\n") =~ /(\d+) Tests (\d+) Failures (\d+) Ignored/
|
||||
if summary.find { |v| v =~ /(\d+) Tests (\d+) Failures (\d+) Ignored/ }
|
||||
[$1.to_i,$2.to_i,$3.to_i]
|
||||
else
|
||||
raise "Couldn't parse test results: #{summary}"
|
||||
|
||||
Reference in New Issue
Block a user