1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-27 18:24:27 +01:00

- unity_test_summary script callable from command line again

- fixed obj_file sorting in rakefiles
- gave better anchors for gcc to grab on test pass/fail by breaking them out as functions
- fixed minor type issues

git-svn-id: http://unity.svn.sourceforge.net/svnroot/unity/trunk@137 e7d17a6e-8845-0410-bbbc-c8efb4fdad7e
This commit is contained in:
mvandervoord
2012-01-02 21:38:36 +00:00
parent 3a82e1eeab
commit d0d5ec5d75
6 changed files with 62 additions and 41 deletions

View File

@@ -79,16 +79,17 @@ class UnityTestSummary
end
def usage(err_msg=nil)
puts "\nERROR: "
puts err_msg if err_msg
puts "Usage: unity_test_summary.rb"
puts "\nUsage: unity_test_summary.rb result_file_directoy/ root_path/"
puts " result_file_directory - The location of your relults files."
puts " Defaults to current directory if not specified."
puts " Should end in / if specified."
puts " root_path - Helpful for producing more verbose output if using relative paths."
exit 1
end
protected
@@targets=nil
@@path=nil
@@root=nil
def get_details(result_file, lines)
results = { :failures => [], :ignores => [], :successes => [] }
@@ -117,10 +118,22 @@ class UnityTestSummary
end
if $0 == __FILE__
script = UnityTestSummary.new
uts = UnityTestSummary.new
begin
script.run
#look in the specified or current directory for result files
ARGV[0] ||= './'
targets = "#{ARGV[0].gsub(/\\/, '/')}*.test*"
results = Dir[targets]
raise "No *.testpass or *.testfail files found in '#{targets}'" if results.empty?
uts.set_targets(results)
#set the root path
ARGV[1] ||= File.expand_path(File.dirname(__FILE__)) + '/'
uts.set_root_path(ARGV[1])
#run the summarizer
puts uts.run
rescue Exception => e
script.usage e.message
uts.usage e.message
end
end