2025-01-01 12:05:55 -05:00
|
|
|
# =========================================================================
|
|
|
|
# CMock - Automatic Mock Generation for C
|
|
|
|
# ThrowTheSwitch.org
|
|
|
|
# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
# =========================================================================
|
|
|
|
|
2020-03-19 11:29:17 -04:00
|
|
|
suppress_error = !ARGV.nil? && !ARGV.empty? && (ARGV[0].casecmp('--SILENT') == 0)
|
2017-04-07 22:22:38 -04:00
|
|
|
|
2017-04-07 23:06:38 -04:00
|
|
|
begin
|
|
|
|
require "#{ENV['UNITY_DIR']}/auto/unity_test_summary.rb"
|
2015-04-07 13:36:46 -04:00
|
|
|
|
2017-04-07 23:06:38 -04:00
|
|
|
build_dir = ENV.fetch('BUILD_DIR', './build')
|
|
|
|
test_build_dir = ENV.fetch('TEST_BUILD_DIR', File.join(build_dir, 'test'))
|
|
|
|
|
2017-05-04 10:07:06 -04:00
|
|
|
results = Dir["#{test_build_dir}/*.testresult"]
|
2017-04-07 23:06:38 -04:00
|
|
|
parser = UnityTestSummary.new
|
|
|
|
parser.targets = results
|
|
|
|
parser.run
|
|
|
|
puts parser.report
|
|
|
|
rescue StandardError => e
|
|
|
|
raise e unless suppress_error
|
|
|
|
end
|
2015-04-07 13:36:46 -04:00
|
|
|
|
2017-04-07 22:22:38 -04:00
|
|
|
exit(parser.failures) unless suppress_error
|