mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-08-04 10:17:49 +00:00
Add examples to the automated testing in travis. Make err-on-fail optional on both examples (disabled during ci)
This commit is contained in:
@@ -27,6 +27,8 @@ end
|
||||
|
||||
all_headers_to_mock = []
|
||||
|
||||
suppress_error = !ARGV.nil? && !ARGV.empty? && (ARGV[0].upcase == "--SILENT")
|
||||
|
||||
File.open(TEST_MAKEFILE, "w") do |mkfile|
|
||||
|
||||
# Define make variables
|
||||
@@ -103,7 +105,7 @@ File.open(TEST_MAKEFILE, "w") do |mkfile|
|
||||
end
|
||||
end
|
||||
raise "Module header '#{name}' not found to mock!" unless header_to_mock
|
||||
headers_to_mock << header_to_mock
|
||||
headers_to_mock << header_to_mock
|
||||
end
|
||||
all_headers_to_mock += headers_to_mock
|
||||
mock_objs = headers_to_mock.map do |hdr|
|
||||
@@ -149,7 +151,7 @@ File.open(TEST_MAKEFILE, "w") do |mkfile|
|
||||
|
||||
# Create test summary task
|
||||
mkfile.puts "test_summary:"
|
||||
mkfile.puts "\t@UNITY_DIR=${UNITY_DIR} ruby ${CMOCK_DIR}/scripts/test_summary.rb"
|
||||
mkfile.puts "\t@UNITY_DIR=${UNITY_DIR} ruby ${CMOCK_DIR}/scripts/test_summary.rb #{suppress_error ? '--silent' : ''}"
|
||||
mkfile.puts ""
|
||||
mkfile.puts ".PHONY: test_summary"
|
||||
mkfile.puts ""
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
suppress_error = !ARGV.nil? && !ARGV.empty? && (ARGV[0].upcase == "--SILENT")
|
||||
|
||||
require "#{ENV['UNITY_DIR']}/auto/unity_test_summary.rb"
|
||||
|
||||
build_dir = ENV.fetch('BUILD_DIR', './build')
|
||||
@@ -5,7 +8,7 @@ test_build_dir = ENV.fetch('TEST_BUILD_DIR', File.join(build_dir, 'test'))
|
||||
|
||||
results = Dir["#{test_build_dir}/*.result"]
|
||||
parser = UnityTestSummary.new
|
||||
parser.set_targets(results)
|
||||
parser.targets = results
|
||||
parser.run
|
||||
puts parser.report
|
||||
exit(parser.failures)
|
||||
exit(parser.failures) unless suppress_error
|
||||
|
||||
Reference in New Issue
Block a user