Skip to content

Commit

Permalink
More complete error handling when suppressing errors in the example
Browse files Browse the repository at this point in the history
  • Loading branch information
mvandervoord committed Apr 8, 2017
1 parent f1789ba commit fbcffe6
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions scripts/test_summary.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@

suppress_error = !ARGV.nil? && !ARGV.empty? && (ARGV[0].upcase == "--SILENT")

require "#{ENV['UNITY_DIR']}/auto/unity_test_summary.rb"
begin
require "#{ENV['UNITY_DIR']}/auto/unity_test_summary.rb"

build_dir = ENV.fetch('BUILD_DIR', './build')
test_build_dir = ENV.fetch('TEST_BUILD_DIR', File.join(build_dir, 'test'))
build_dir = ENV.fetch('BUILD_DIR', './build')
test_build_dir = ENV.fetch('TEST_BUILD_DIR', File.join(build_dir, 'test'))

results = Dir["#{test_build_dir}/*.result"]
parser = UnityTestSummary.new
parser.targets = results
parser.run
puts parser.report
rescue StandardError => e
raise e unless suppress_error
end

results = Dir["#{test_build_dir}/*.result"]
parser = UnityTestSummary.new
parser.targets = results
parser.run
puts parser.report
exit(parser.failures) unless suppress_error

0 comments on commit fbcffe6

Please sign in to comment.