-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More complete error handling when suppressing errors in the example
- Loading branch information
1 parent
f1789ba
commit fbcffe6
Showing
1 changed file
with
13 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |