mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-06-06 05:25:29 +00:00
More complete error handling when suppressing errors in the example
This commit is contained in:
+13
-8
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user