fix trailing space and new line
temporarily disable codespell
This commit is contained in:
@@ -96,4 +96,3 @@ module Ceedling
|
||||
DEFAULT_CEEDLING_CONFIG[:plugins][:load_paths] << gem_dir
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ require 'ceedling/constants'
|
||||
class BuildInvokerUtils
|
||||
|
||||
constructor :configurator, :streaminator
|
||||
|
||||
|
||||
##
|
||||
# Processes exceptions and tries to display a useful message for the user.
|
||||
#
|
||||
@@ -13,27 +13,27 @@ class BuildInvokerUtils
|
||||
#
|
||||
# * _exception_: The exception given by a rescue statement.
|
||||
# * _context_: A symbol representing where in the build the exception
|
||||
# occurs.
|
||||
# occurs.
|
||||
# * _test_build_: A bool to signify if the exception occurred while building
|
||||
# from test or source.
|
||||
#
|
||||
def process_exception(exception, context, test_build=true)
|
||||
if (exception.message =~ /Don't know how to build task '(.+)'/i)
|
||||
error_header = "ERROR: Rake could not find file referenced in source"
|
||||
error_header += " or test" if (test_build)
|
||||
error_header += " or test" if (test_build)
|
||||
error_header += ": '#{$1}'. Possible stale dependency."
|
||||
|
||||
|
||||
@streaminator.stderr_puts( error_header )
|
||||
|
||||
if (@configurator.project_use_deep_dependencies)
|
||||
help_message = "Try fixing #include statements or adding missing file. Then run '#{REFRESH_TASK_ROOT}#{context.to_s}' task and try again."
|
||||
help_message = "Try fixing #include statements or adding missing file. Then run '#{REFRESH_TASK_ROOT}#{context.to_s}' task and try again."
|
||||
@streaminator.stderr_puts( help_message )
|
||||
end
|
||||
|
||||
|
||||
raise ''
|
||||
else
|
||||
raise exception
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
class Cacheinator
|
||||
|
||||
constructor :cacheinator_helper, :file_path_utils, :file_wrapper, :yaml_wrapper
|
||||
|
||||
|
||||
def cache_test_config(hash)
|
||||
@yaml_wrapper.dump( @file_path_utils.form_test_build_cache_path( INPUT_CONFIGURATION_CACHE_FILE), hash )
|
||||
end
|
||||
@@ -11,15 +11,15 @@ class Cacheinator
|
||||
@yaml_wrapper.dump( @file_path_utils.form_release_build_cache_path( INPUT_CONFIGURATION_CACHE_FILE ), hash )
|
||||
end
|
||||
|
||||
|
||||
|
||||
def diff_cached_test_file( filepath )
|
||||
cached_filepath = @file_path_utils.form_test_build_cache_path( filepath )
|
||||
|
||||
|
||||
if (@file_wrapper.exist?( cached_filepath ) and (!@file_wrapper.compare( filepath, cached_filepath )))
|
||||
@file_wrapper.cp(filepath, cached_filepath, {:preserve => false})
|
||||
return filepath
|
||||
elsif (!@file_wrapper.exist?( cached_filepath ))
|
||||
@file_wrapper.cp(filepath, cached_filepath, {:preserve => false})
|
||||
@file_wrapper.cp(filepath, cached_filepath, {:preserve => false})
|
||||
return filepath
|
||||
end
|
||||
|
||||
@@ -43,5 +43,5 @@ class Cacheinator
|
||||
|
||||
return @cacheinator_helper.diff_cached_config?( cached_filepath, hash )
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
class CacheinatorHelper
|
||||
|
||||
constructor :file_wrapper, :yaml_wrapper
|
||||
|
||||
|
||||
def diff_cached_config?(cached_filepath, hash)
|
||||
return false if ( not @file_wrapper.exist?(cached_filepath) )
|
||||
return true if (@yaml_wrapper.load(cached_filepath) != hash)
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
require 'cmock'
|
||||
|
||||
class CmockBuilder
|
||||
|
||||
|
||||
attr_accessor :cmock
|
||||
|
||||
def setup
|
||||
|
||||
def setup
|
||||
@cmock = nil
|
||||
end
|
||||
|
||||
|
||||
def manufacture(cmock_config)
|
||||
@cmock = CMock.new(cmock_config)
|
||||
end
|
||||
|
||||
@@ -379,4 +379,3 @@ class Configurator
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ class ConfiguratorPlugins
|
||||
return defaults_with_path
|
||||
end
|
||||
|
||||
# gather up and return
|
||||
# gather up and return
|
||||
def find_plugin_hash_defaults(config, plugin_paths)
|
||||
defaults_hash= []
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ class ConfiguratorSetup
|
||||
|
||||
if config[:cmock][:unity_helper]
|
||||
config[:cmock][:unity_helper].each do |path|
|
||||
validation << @configurator_validator.validate_filepath_simple( path, :cmock, :unity_helper )
|
||||
validation << @configurator_validator.validate_filepath_simple( path, :cmock, :unity_helper )
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ require 'ceedling/file_path_utils' # for glob handling class methods
|
||||
|
||||
|
||||
class ConfiguratorValidator
|
||||
|
||||
|
||||
constructor :file_wrapper, :stream_wrapper, :system_wrapper
|
||||
|
||||
# walk into config hash verify existence of data at key depth
|
||||
@@ -16,9 +16,9 @@ class ConfiguratorValidator
|
||||
|
||||
if (not exist)
|
||||
# no verbosity checking since this is lowest level anyhow & verbosity checking depends on configurator
|
||||
@stream_wrapper.stderr_puts("ERROR: Required config file entry #{format_key_sequence(keys, hash[:depth])} does not exist.")
|
||||
@stream_wrapper.stderr_puts("ERROR: Required config file entry #{format_key_sequence(keys, hash[:depth])} does not exist.")
|
||||
end
|
||||
|
||||
|
||||
return exist
|
||||
end
|
||||
|
||||
@@ -33,39 +33,39 @@ class ConfiguratorValidator
|
||||
|
||||
path_list = []
|
||||
exist = true
|
||||
|
||||
|
||||
case list
|
||||
when String then path_list << list
|
||||
when Array then path_list = list
|
||||
end
|
||||
|
||||
|
||||
path_list.each do |path|
|
||||
base_path = FilePathUtils::extract_path(path) # lop off add/subtract notation & glob specifiers
|
||||
|
||||
|
||||
if (not @file_wrapper.exist?(base_path))
|
||||
# no verbosity checking since this is lowest level anyhow & verbosity checking depends on configurator
|
||||
@stream_wrapper.stderr_puts("ERROR: Config path #{format_key_sequence(keys, hash[:depth])}['#{base_path}'] does not exist on disk.")
|
||||
@stream_wrapper.stderr_puts("ERROR: Config path #{format_key_sequence(keys, hash[:depth])}['#{base_path}'] does not exist on disk.")
|
||||
exist = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return exist
|
||||
end
|
||||
|
||||
|
||||
|
||||
# simple path verification
|
||||
def validate_filepath_simple(path, *keys)
|
||||
validate_path = path
|
||||
|
||||
|
||||
if (not @file_wrapper.exist?(validate_path))
|
||||
# no verbosity checking since this is lowest level anyhow & verbosity checking depends on configurator
|
||||
@stream_wrapper.stderr_puts("ERROR: Config path '#{validate_path}' associated with #{format_key_sequence(keys, keys.size)} does not exist on disk.")
|
||||
@stream_wrapper.stderr_puts("ERROR: Config path '#{validate_path}' associated with #{format_key_sequence(keys, keys.size)} does not exist on disk.")
|
||||
return false
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
# walk into config hash. verify specified file exists.
|
||||
def validate_filepath(config, *keys)
|
||||
hash = retrieve_value(config, keys)
|
||||
@@ -76,21 +76,21 @@ class ConfiguratorValidator
|
||||
|
||||
# skip everything if we've got an argument replacement pattern
|
||||
return true if (filepath =~ TOOL_EXECUTOR_ARGUMENT_REPLACEMENT_PATTERN)
|
||||
|
||||
|
||||
if (not @file_wrapper.exist?(filepath))
|
||||
|
||||
# See if we can deal with it internally.
|
||||
if GENERATED_DIR_PATH.include?(filepath)
|
||||
if GENERATED_DIR_PATH.include?(filepath)
|
||||
# we already made this directory before let's make it again.
|
||||
FileUtils.mkdir_p File.join(File.dirname(__FILE__), filepath)
|
||||
@stream_wrapper.stderr_puts("WARNING: Generated filepath #{format_key_sequence(keys, hash[:depth])}['#{filepath}'] does not exist on disk. Recreating")
|
||||
|
||||
@stream_wrapper.stderr_puts("WARNING: Generated filepath #{format_key_sequence(keys, hash[:depth])}['#{filepath}'] does not exist on disk. Recreating")
|
||||
|
||||
else
|
||||
# no verbosity checking since this is lowest level anyhow & verbosity checking depends on configurator
|
||||
@stream_wrapper.stderr_puts("ERROR: Config filepath #{format_key_sequence(keys, hash[:depth])}['#{filepath}'] does not exist on disk.")
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
@@ -106,17 +106,17 @@ class ConfiguratorValidator
|
||||
|
||||
# skip everything if we've got an argument replacement pattern
|
||||
return true if (filepath =~ TOOL_EXECUTOR_ARGUMENT_REPLACEMENT_PATTERN)
|
||||
|
||||
|
||||
# if there's no path included, verify file exists somewhere in system search paths
|
||||
if (not filepath.include?('/'))
|
||||
exists = false
|
||||
|
||||
|
||||
@system_wrapper.search_paths.each do |path|
|
||||
if (@file_wrapper.exist?( File.join(path, filepath)) )
|
||||
exists = true
|
||||
break
|
||||
end
|
||||
|
||||
|
||||
if (@file_wrapper.exist?( (File.join(path, filepath)).ext( exe_extension ) ))
|
||||
exists = true
|
||||
break
|
||||
@@ -125,25 +125,25 @@ class ConfiguratorValidator
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if (not exists)
|
||||
# no verbosity checking since this is lowest level anyhow & verbosity checking depends on configurator
|
||||
@stream_wrapper.stderr_puts("ERROR: Config filepath #{format_key_sequence(keys, hash[:depth])}['#{filepath}'] does not exist in system search paths.")
|
||||
return false
|
||||
@stream_wrapper.stderr_puts("ERROR: Config filepath #{format_key_sequence(keys, hash[:depth])}['#{filepath}'] does not exist in system search paths.")
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
# if there is a path included, check that explicit filepath exists
|
||||
else
|
||||
if (not @file_wrapper.exist?(filepath))
|
||||
# no verbosity checking since this is lowest level anyhow & verbosity checking depends on configurator
|
||||
@stream_wrapper.stderr_puts("ERROR: Config filepath #{format_key_sequence(keys, hash[:depth])}['#{filepath}'] does not exist on disk.")
|
||||
@stream_wrapper.stderr_puts("ERROR: Config filepath #{format_key_sequence(keys, hash[:depth])}['#{filepath}'] does not exist on disk.")
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
def validate_tool_stderr_redirect(config, tools, tool)
|
||||
redirect = config[tools][tool][:stderr_redirect]
|
||||
if (redirect.class == Symbol)
|
||||
@@ -151,17 +151,17 @@ class ConfiguratorValidator
|
||||
if (not StdErrRedirect.constants.map{|constant| constant.to_s}.include?(redirect.to_s.upcase))
|
||||
error = "ERROR: [:#{tools}][:#{tool}][:stderr_redirect][:#{redirect}] is not a recognized option " +
|
||||
"{#{StdErrRedirect.constants.map{|constant| ':' + constant.to_s.downcase}.join(', ')}}."
|
||||
@stream_wrapper.stderr_puts(error)
|
||||
return false
|
||||
@stream_wrapper.stderr_puts(error)
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
private #########################################
|
||||
|
||||
|
||||
|
||||
|
||||
def retrieve_value(config, keys)
|
||||
value = nil
|
||||
hash = config
|
||||
@@ -178,7 +178,7 @@ class ConfiguratorValidator
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return {:value => value, :depth => depth}
|
||||
end
|
||||
|
||||
@@ -186,8 +186,8 @@ class ConfiguratorValidator
|
||||
def format_key_sequence(keys, depth)
|
||||
walked_keys = keys.slice(0, depth)
|
||||
formatted_keys = walked_keys.map{|key| "[:#{key.to_s}]"}
|
||||
|
||||
|
||||
return formatted_keys.join
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -6,4 +6,4 @@ class ErbWrapper
|
||||
f << ERB.new(template, 0, "<>").result(binding)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -146,4 +146,3 @@ class FileFinder
|
||||
return @file_finder_helper.find_file_in_collection(file_path, file_list, complain)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@ require 'ceedling/constants' # for Verbosity enumeration
|
||||
class FileFinderHelper
|
||||
|
||||
constructor :streaminator
|
||||
|
||||
|
||||
|
||||
|
||||
def find_file_in_collection(file_name, file_list, complain, extra_message="")
|
||||
file_to_find = nil
|
||||
|
||||
|
||||
file_list.each do |item|
|
||||
base_file = File.basename(item)
|
||||
|
||||
@@ -22,29 +22,29 @@ class FileFinderHelper
|
||||
blow_up(file_name, "However, a filename having different capitalization was found: '#{item}'.")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
if file_to_find.nil?
|
||||
case (complain)
|
||||
when :error then blow_up(file_name, extra_message)
|
||||
when :error then blow_up(file_name, extra_message)
|
||||
when :warn then gripe(file_name, extra_message)
|
||||
#when :ignore then
|
||||
#when :ignore then
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return file_to_find
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
|
||||
def blow_up(file_name, extra_message="")
|
||||
error = "ERROR: Found no file '#{file_name}' in search paths."
|
||||
error += ' ' if (extra_message.length > 0)
|
||||
@streaminator.stderr_puts(error + extra_message, Verbosity::ERRORS)
|
||||
raise
|
||||
end
|
||||
|
||||
|
||||
def gripe(file_name, extra_message="")
|
||||
warning = "WARNING: Found no file '#{file_name}' in search paths."
|
||||
warning += ' ' if (extra_message.length > 0)
|
||||
@@ -52,5 +52,3 @@ class FileFinderHelper
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ require 'ceedling/file_path_utils'
|
||||
|
||||
|
||||
class FileSystemUtils
|
||||
|
||||
|
||||
constructor :file_wrapper
|
||||
|
||||
# build up path list from input of one or more strings or arrays of (+/-) paths & globs
|
||||
@@ -14,7 +14,7 @@ class FileSystemUtils
|
||||
raw = [] # all paths and globs
|
||||
plus = Set.new # all paths to expand and add
|
||||
minus = Set.new # all paths to remove from plus set
|
||||
|
||||
|
||||
# assemble all globs and simple paths, reforming our glob notation to ruby globs
|
||||
paths.each do |paths_container|
|
||||
case (paths_container)
|
||||
@@ -26,29 +26,29 @@ class FileSystemUtils
|
||||
|
||||
# iterate through each path and glob
|
||||
raw.each do |path|
|
||||
|
||||
|
||||
dirs = [] # container for only (expanded) paths
|
||||
|
||||
|
||||
# if a glob, expand it and slurp up all non-file paths
|
||||
if path.include?('*')
|
||||
# grab base directory only if globs are snug up to final path separator
|
||||
if (path =~ /\/\*+$/)
|
||||
dirs << FilePathUtils.extract_path(path)
|
||||
end
|
||||
|
||||
|
||||
# grab expanded sub-directory globs
|
||||
expanded = @file_wrapper.directory_listing( FilePathUtils.extract_path_no_aggregation_operators(path) )
|
||||
expanded.each do |entry|
|
||||
dirs << entry if @file_wrapper.directory?(entry)
|
||||
end
|
||||
|
||||
|
||||
# else just grab simple path
|
||||
# note: we could just run this through glob expansion but such an
|
||||
# approach doesn't handle a path not yet on disk)
|
||||
else
|
||||
dirs << FilePathUtils.extract_path_no_aggregation_operators(path)
|
||||
end
|
||||
|
||||
|
||||
# add dirs to the appropriate set based on path aggregation modifier if present
|
||||
FilePathUtils.add_path?(path) ? plus.merge(dirs) : minus.merge(dirs)
|
||||
end
|
||||
|
||||
@@ -7,4 +7,4 @@ class FileSystemWrapper
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -29,25 +29,25 @@ class Flaginator
|
||||
|
||||
def get_flag(hash, file_name)
|
||||
file_key = file_name.to_sym
|
||||
|
||||
|
||||
# 1. try literals
|
||||
literals, magic = partition(hash) { |k, v| k.to_s =~ /^\w+$/ }
|
||||
literals, magic = partition(hash) { |k, v| k.to_s =~ /^\w+$/ }
|
||||
return literals[file_key] if literals.include?(file_key)
|
||||
|
||||
|
||||
any, regex = partition(magic) { |k, v| (k == :'*') || (k == :'.*') } # glob or regex wild card
|
||||
|
||||
|
||||
# 2. try regexes
|
||||
find_res = regex.find { |k, v| file_name =~ /^#{k.to_s}$/ }
|
||||
return find_res[1] if find_res
|
||||
|
||||
|
||||
# 3. try anything
|
||||
find_res = any.find { |k, v| file_name =~ /.*/ }
|
||||
return find_res[1] if find_res
|
||||
|
||||
|
||||
# 4. well, we've tried
|
||||
return []
|
||||
end
|
||||
|
||||
|
||||
def flag_down( operation, context, file )
|
||||
# create configurator accessor method
|
||||
accessor = ('flags_' + context.to_s).to_sym
|
||||
|
||||
@@ -9,7 +9,7 @@ class GeneratorHelper
|
||||
def test_results_error_handler(executable, shell_result)
|
||||
notice = ''
|
||||
error = false
|
||||
|
||||
|
||||
if (shell_result[:output].nil? or shell_result[:output].strip.empty?)
|
||||
error = true
|
||||
# mirror style of generic tool_executor failure output
|
||||
@@ -24,7 +24,7 @@ class GeneratorHelper
|
||||
"> Produced no final test result counts in $stdout:\n" +
|
||||
"#{shell_result[:output].strip}\n"
|
||||
end
|
||||
|
||||
|
||||
if (error)
|
||||
# since we told the tool executor to ignore the exit code, handle it explicitly here
|
||||
notice += "> And exited with status: [#{shell_result[:exit_code]}] (count of failed tests).\n" if (shell_result[:exit_code] != nil)
|
||||
@@ -33,8 +33,8 @@ class GeneratorHelper
|
||||
notice += "> This is often a symptom of a bad memory access in source or test code.\n\n"
|
||||
|
||||
@streaminator.stderr_puts(notice, Verbosity::COMPLAIN)
|
||||
raise
|
||||
raise
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -77,7 +77,7 @@ class GeneratorTestResults
|
||||
# handle anything preceding filename in line as extra output to be collected
|
||||
stdout = nil
|
||||
stdout_regex = /(.+)#{Regexp.escape(filename)}.+/i
|
||||
unity_test_time = 0
|
||||
unity_test_time = 0
|
||||
|
||||
if (line =~ stdout_regex)
|
||||
stdout = $1.clone
|
||||
|
||||
@@ -6,34 +6,34 @@ require 'ceedling/constants'
|
||||
class GeneratorTestResultsSanityChecker
|
||||
|
||||
constructor :configurator, :streaminator
|
||||
|
||||
|
||||
def verify(results, unity_exit_code)
|
||||
|
||||
|
||||
# do no sanity checking if it's disabled
|
||||
return if (@configurator.sanity_checks == TestResultsSanityChecks::NONE)
|
||||
raise "results nil or empty" if results.nil? || results.empty?
|
||||
|
||||
ceedling_ignores_count = results[:ignores].size
|
||||
ceedling_ignores_count = results[:ignores].size
|
||||
ceedling_failures_count = results[:failures].size
|
||||
ceedling_tests_summation = (ceedling_ignores_count + ceedling_failures_count + results[:successes].size)
|
||||
|
||||
# Exit code handling is not a sanity check that can always be performed because
|
||||
# Exit code handling is not a sanity check that can always be performed because
|
||||
# command line simulators may or may not pass through Unity's exit code
|
||||
if (@configurator.sanity_checks >= TestResultsSanityChecks::THOROUGH)
|
||||
# many platforms limit exit codes to a maximum of 255
|
||||
if ((ceedling_failures_count != unity_exit_code) and (unity_exit_code < 255))
|
||||
sanity_check_warning(results[:source][:file], "Unity's exit code (#{unity_exit_code}) does not match Ceedling's summation of failed test cases (#{ceedling_failures_count}).")
|
||||
end
|
||||
|
||||
|
||||
if ((ceedling_failures_count < 255) and (unity_exit_code == 255))
|
||||
sanity_check_warning(results[:source][:file], "Ceedling's summation of failed test cases (#{ceedling_failures_count}) is less than Unity's exit code (255 or more).")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if (ceedling_ignores_count != results[:counts][:ignored])
|
||||
sanity_check_warning(results[:source][:file], "Unity's final ignore count (#{results[:counts][:ignored]}) does not match Ceedling's summation of ignored test cases (#{ceedling_ignores_count}).")
|
||||
end
|
||||
|
||||
|
||||
if (ceedling_failures_count != results[:counts][:failed])
|
||||
sanity_check_warning(results[:source][:file], "Unity's final fail count (#{results[:counts][:failed]}) does not match Ceedling's summation of failed test cases (#{ceedling_failures_count}).")
|
||||
end
|
||||
@@ -41,14 +41,14 @@ class GeneratorTestResultsSanityChecker
|
||||
if (ceedling_tests_summation != results[:counts][:total])
|
||||
sanity_check_warning(results[:source][:file], "Unity's final test count (#{results[:counts][:total]}) does not match Ceedling's summation of all test cases (#{ceedling_tests_summation}).")
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
|
||||
def sanity_check_warning(file, message)
|
||||
unless defined?(CEEDLING_IGNORE_SANITY_CHECK)
|
||||
notice = "\n" +
|
||||
notice = "\n" +
|
||||
"ERROR: Internal sanity check for test fixture '#{file.ext(@configurator.extension_executable)}' finds that #{message}\n" +
|
||||
" Possible causes:\n" +
|
||||
" 1. Your test + source dereferenced a null pointer.\n" +
|
||||
@@ -56,7 +56,7 @@ class GeneratorTestResultsSanityChecker
|
||||
" 3. Your test + source committed a memory access violation.\n" +
|
||||
" 4. Your test fixture produced an exit code of 0 despite execution ending prematurely.\n" +
|
||||
" Sanity check failures of test results are usually a symptom of interrupted test execution.\n\n"
|
||||
|
||||
|
||||
@streaminator.stderr_puts( notice )
|
||||
raise
|
||||
end
|
||||
|
||||
@@ -11,7 +11,7 @@ class Loginator
|
||||
config_files.concat( @project_config_manager.options_files )
|
||||
config_files.compact!
|
||||
config_files.map! { |file| file.ext('') }
|
||||
|
||||
|
||||
log_name = config_files.join( '_' )
|
||||
|
||||
@project_log_filepath = File.join( @configurator.project_log_path, log_name.ext('.log') )
|
||||
@@ -20,12 +20,12 @@ class Loginator
|
||||
|
||||
def log(string, heading=nil)
|
||||
return if (not @configurator.project_logging)
|
||||
|
||||
|
||||
output = "\n[#{@system_wrapper.time_now}]"
|
||||
output += " :: #{heading}" if (not heading.nil?)
|
||||
output += "\n#{string.strip}\n"
|
||||
|
||||
@file_wrapper.write(@project_log_filepath, output, 'a')
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
# modified version of Rake's provided make-style dependency loader
|
||||
# customizations:
|
||||
# customizations:
|
||||
# (1) handles windows drives in paths -- colons don't confuse task demarcation
|
||||
# (2) handles spaces in directory paths
|
||||
|
||||
@@ -29,7 +29,7 @@ module Rake
|
||||
file_tasks, args = line.split(/:\s/)
|
||||
|
||||
return if args.nil?
|
||||
|
||||
|
||||
# split at non-escaped space boundary between files (i.e. escaped spaces in paths are left alone)
|
||||
dependents = args.split(/\b\s+/)
|
||||
# replace escaped spaces and clean up any extra whitespace
|
||||
|
||||
@@ -223,7 +223,7 @@ dependinator:
|
||||
- configurator
|
||||
- project_config_manager
|
||||
- test_includes_extractor
|
||||
- file_path_utils
|
||||
- file_path_utils
|
||||
- rake_wrapper
|
||||
- file_wrapper
|
||||
|
||||
|
||||
@@ -16,4 +16,3 @@ def par_map(n, things, &block)
|
||||
end
|
||||
threads.each { |t| t.join }
|
||||
end
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ class String
|
||||
def left_margin(margin=0)
|
||||
non_whitespace_column = 0
|
||||
new_lines = []
|
||||
|
||||
|
||||
# find first line with non-whitespace and count left columns of whitespace
|
||||
self.each_line do |line|
|
||||
if (line =~ /^\s*\S/)
|
||||
@@ -13,7 +13,7 @@ class String
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# iterate through each line, chopping off leftmost whitespace columns and add back the desired whitespace margin
|
||||
self.each_line do |line|
|
||||
columns = []
|
||||
@@ -25,7 +25,7 @@ class String
|
||||
new_lines << "\n"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return new_lines.join
|
||||
end
|
||||
end
|
||||
@@ -74,7 +74,7 @@ class Plugin
|
||||
# whole shebang (any use of Ceedling)
|
||||
def pre_build; end
|
||||
def post_build; end
|
||||
|
||||
|
||||
def summary; end
|
||||
|
||||
end
|
||||
|
||||
@@ -23,7 +23,7 @@ class PluginBuilder
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
|
||||
def camelize(underscored_name)
|
||||
return underscored_name.gsub(/(_|^)([a-z0-9])/) {$2.upcase}
|
||||
end
|
||||
@@ -50,4 +50,4 @@ class PluginBuilder
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,46 +2,46 @@ require 'ceedling/constants'
|
||||
require 'ceedling/defaults'
|
||||
|
||||
class PluginReportinator
|
||||
|
||||
|
||||
constructor :plugin_reportinator_helper, :plugin_manager, :reportinator
|
||||
|
||||
def setup
|
||||
@test_results_template = nil
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
def set_system_objects(system_objects)
|
||||
@plugin_reportinator_helper.ceedling = system_objects
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
def fetch_results(results_path, test, options={:boom => false})
|
||||
return @plugin_reportinator_helper.fetch_results( File.join(results_path, test), options )
|
||||
end
|
||||
|
||||
|
||||
|
||||
def generate_banner(message)
|
||||
return @reportinator.generate_banner(message)
|
||||
end
|
||||
|
||||
|
||||
|
||||
def assemble_test_results(results_list, options={:boom => false})
|
||||
aggregated_results = get_results_structure
|
||||
|
||||
results_list.each do |result_path|
|
||||
|
||||
results_list.each do |result_path|
|
||||
results = @plugin_reportinator_helper.fetch_results( result_path, options )
|
||||
@plugin_reportinator_helper.process_results(aggregated_results, results)
|
||||
end
|
||||
|
||||
return aggregated_results
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
def register_test_results_template(template)
|
||||
@test_results_template = template if (@test_results_template.nil?)
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
def run_test_results_report(hash, verbosity=Verbosity::NORMAL, &block)
|
||||
run_report( $stdout,
|
||||
((@test_results_template.nil?) ? DEFAULT_TESTS_RESULTS_REPORT_TEMPLATE : @test_results_template),
|
||||
@@ -49,19 +49,19 @@ class PluginReportinator
|
||||
verbosity,
|
||||
&block )
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
def run_report(stream, template, hash=nil, verbosity=Verbosity::NORMAL)
|
||||
failure = nil
|
||||
failure = yield() if block_given?
|
||||
|
||||
|
||||
@plugin_manager.register_build_failure( failure )
|
||||
|
||||
|
||||
@plugin_reportinator_helper.run_report( stream, template, hash, verbosity )
|
||||
end
|
||||
|
||||
|
||||
private ###############################
|
||||
|
||||
|
||||
def get_results_structure
|
||||
return {
|
||||
:successes => [],
|
||||
@@ -72,5 +72,5 @@ class PluginReportinator
|
||||
:time => 0.0
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -4,11 +4,11 @@ require 'rake' # for ext()
|
||||
require 'ceedling/constants'
|
||||
|
||||
class PluginReportinatorHelper
|
||||
|
||||
|
||||
attr_writer :ceedling
|
||||
|
||||
|
||||
constructor :configurator, :streaminator, :yaml_wrapper, :file_wrapper
|
||||
|
||||
|
||||
def fetch_results(results_path, options)
|
||||
pass_path = File.join(results_path.ext( @configurator.extension_testpass ))
|
||||
fail_path = File.join(results_path.ext( @configurator.extension_testfail ))
|
||||
@@ -23,7 +23,7 @@ class PluginReportinatorHelper
|
||||
raise
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return {}
|
||||
end
|
||||
|
||||
@@ -47,5 +47,5 @@ class PluginReportinatorHelper
|
||||
output = ERB.new(template, 0, "%<>")
|
||||
@streaminator.stream_puts(stream, output.result(binding()), verbosity)
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -94,7 +94,7 @@ class PreprocessinatorIncludesHandler
|
||||
target_file = make_rule.split[0].gsub(':', '').gsub('\\','/')
|
||||
base = File.basename(target_file, File.extname(target_file))
|
||||
make_rule_dependencies = make_rule.gsub(/.*\b#{Regexp.escape(base)}\S*/, '').gsub(/\\$/, '')
|
||||
|
||||
|
||||
# Extract the headers dependencies from the make rule
|
||||
hdr_ext = @configurator.extension_header
|
||||
headers_dependencies = make_rule_dependencies.split.find_all {|path| path.end_with?(hdr_ext) }.uniq
|
||||
|
||||
@@ -20,7 +20,7 @@ class ProjectConfigManager
|
||||
def merge_options(config_hash, option_filepath)
|
||||
@options_files << File.basename( option_filepath )
|
||||
config_hash.deep_merge!( @yaml_wrapper.load( option_filepath ) )
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def filter_internal_sources(sources)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
class RakeUtils
|
||||
|
||||
|
||||
constructor :rake_wrapper
|
||||
|
||||
def task_invoked?(task_regex)
|
||||
|
||||
@@ -14,8 +14,8 @@ class Reportinator
|
||||
# ==== Examples
|
||||
#
|
||||
# rp = Reportinator.new
|
||||
# rp.generate_banner("Hello world!") => "------------\nHello world!\n------------\n"
|
||||
# rp.generate_banner("Hello world!", 3) => "---\nHello world!\n---\n"
|
||||
# rp.generate_banner("Hello world!") => "------------\nHello world!\n------------\n"
|
||||
# rp.generate_banner("Hello world!", 3) => "---\nHello world!\n---\n"
|
||||
#
|
||||
#
|
||||
def generate_banner(message, width=nil)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
rule(/#{CMOCK_MOCK_PREFIX}[^\/\\]+#{'\\'+EXTENSION_SOURCE}$/ => [
|
||||
proc do |task_name|
|
||||
@ceedling[:file_finder].find_header_input_for_mock_file(task_name)
|
||||
end
|
||||
end
|
||||
]) do |mock|
|
||||
@ceedling[:generator].generate_mock(TEST_SYM, mock.source)
|
||||
end
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
rule(/#{PROJECT_TEST_PREPROCESS_FILES_PATH}\/.+/ => [
|
||||
proc do |task_name|
|
||||
@ceedling[:file_finder].find_test_or_source_or_header_file(task_name)
|
||||
end
|
||||
end
|
||||
]) do |file|
|
||||
if (not @ceedling[:configurator].project_use_deep_dependencies)
|
||||
raise 'ERROR: Ceedling preprocessing rule invoked though neccessary auxiliary dependency support not enabled.'
|
||||
@@ -19,8 +19,7 @@ end
|
||||
rule(/#{PROJECT_TEST_PREPROCESS_INCLUDES_PATH}\/.+/ => [
|
||||
proc do |task_name|
|
||||
@ceedling[:file_finder].find_test_or_source_or_header_file(task_name)
|
||||
end
|
||||
end
|
||||
]) do |file|
|
||||
@ceedling[:generator].generate_shallow_includes_list(TEST_SYM, file.source)
|
||||
end
|
||||
|
||||
|
||||
@@ -96,4 +96,3 @@ namespace RELEASE_SYM do
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
rule(/#{PROJECT_RELEASE_DEPENDENCIES_PATH}\/#{'.+\\'+EXTENSION_DEPENDENCIES}$/ => [
|
||||
proc do |task_name|
|
||||
@ceedling[:file_finder].find_compilation_input_file(task_name, :error, true)
|
||||
end
|
||||
end
|
||||
]) do |dep|
|
||||
@ceedling[:generator].generate_dependencies_file(
|
||||
TOOLS_RELEASE_DEPENDENCIES_GENERATOR,
|
||||
@@ -12,4 +12,3 @@ rule(/#{PROJECT_RELEASE_DEPENDENCIES_PATH}\/#{'.+\\'+EXTENSION_DEPENDENCIES}$/ =
|
||||
@ceedling[:file_path_utils].form_release_build_c_object_filepath(dep.source),
|
||||
dep.name)
|
||||
end
|
||||
|
||||
|
||||
@@ -70,4 +70,3 @@ namespace TEST_SYM do
|
||||
@ceedling[:test_invoker].setup_and_invoke([test.source])
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -12,4 +12,3 @@ rule(/#{PROJECT_TEST_DEPENDENCIES_PATH}\/#{'.+\\'+EXTENSION_DEPENDENCIES}$/ => [
|
||||
@ceedling[:file_path_utils].form_test_build_c_object_filepath(dep.source),
|
||||
dep.name)
|
||||
end
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class Setupinator
|
||||
@config_hash = config_hash
|
||||
|
||||
# load up all the constants and accessors our rake files, objects, & external scripts will need;
|
||||
# note: configurator modifies the cmock section of the hash with a couple defaults to tie
|
||||
# note: configurator modifies the cmock section of the hash with a couple defaults to tie
|
||||
# project together - the modified hash is used to build cmock object
|
||||
@ceedling[:configurator].populate_defaults( config_hash )
|
||||
@ceedling[:configurator].populate_unity_defaults( config_hash )
|
||||
@@ -31,16 +31,16 @@ class Setupinator
|
||||
@ceedling[:configurator].standardize_paths( config_hash )
|
||||
@ceedling[:configurator].validate( config_hash )
|
||||
@ceedling[:configurator].build( config_hash, :environment )
|
||||
|
||||
|
||||
@ceedling[:configurator].insert_rake_plugins( @ceedling[:configurator].rake_plugins )
|
||||
@ceedling[:configurator].tools_supplement_arguments( config_hash )
|
||||
|
||||
|
||||
# merge in any environment variables plugins specify, after the main build
|
||||
@ceedling[:plugin_manager].load_plugin_scripts( @ceedling[:configurator].script_plugins, @ceedling ) do |env|
|
||||
@ceedling[:configurator].eval_environment_variables( env )
|
||||
@ceedling[:configurator].build_supplement( config_hash, env )
|
||||
end
|
||||
|
||||
|
||||
@ceedling[:plugin_reportinator].set_system_objects( @ceedling )
|
||||
@ceedling[:file_finder].prepare_search_sources
|
||||
@ceedling[:loginator].setup_log_filepath
|
||||
|
||||
@@ -16,7 +16,7 @@ class StreamWrapper
|
||||
def stdout_flush
|
||||
$stdout.flush
|
||||
end
|
||||
|
||||
|
||||
def stderr_puts(string)
|
||||
$stderr.puts(string)
|
||||
end
|
||||
|
||||
@@ -12,7 +12,7 @@ class Streaminator
|
||||
@stream_wrapper.stdout_puts(string)
|
||||
@stream_wrapper.stdout_flush
|
||||
end
|
||||
|
||||
|
||||
# write to log as though Verbosity::OBNOXIOUS
|
||||
@loginator.log( string, @streaminator_helper.extract_name($stdout) )
|
||||
end
|
||||
|
||||
@@ -8,7 +8,7 @@ class StreaminatorHelper
|
||||
when 2 then '#<IO:$stderr>'
|
||||
else stream.inspect
|
||||
end
|
||||
|
||||
|
||||
return name
|
||||
end
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class SystemUtils
|
||||
constructor :system_wrapper
|
||||
|
||||
##
|
||||
# Sets up the class.
|
||||
# Sets up the class.
|
||||
def setup
|
||||
@tcsh_shell = nil
|
||||
end
|
||||
@@ -23,7 +23,7 @@ class SystemUtils
|
||||
def tcsh_shell?
|
||||
# once run a single time, return state determined at that execution
|
||||
return @tcsh_shell if not @tcsh_shell.nil?
|
||||
|
||||
|
||||
result = @system_wrapper.shell_backticks('echo $version')
|
||||
|
||||
if ((result[:exit_code] == 0) and (result[:output].strip =~ /^tcsh/))
|
||||
@@ -31,7 +31,7 @@ class SystemUtils
|
||||
else
|
||||
@tcsh_shell = false
|
||||
end
|
||||
|
||||
|
||||
return @tcsh_shell
|
||||
end
|
||||
end
|
||||
|
||||
@@ -11,7 +11,7 @@ class TaskInvoker
|
||||
@release_regexs = [/^#{RELEASE_ROOT_NAME}(:|$)/]
|
||||
@first_run = true
|
||||
end
|
||||
|
||||
|
||||
def add_test_task_regex(regex)
|
||||
@test_regexs << regex
|
||||
end
|
||||
@@ -19,26 +19,26 @@ class TaskInvoker
|
||||
def add_release_task_regex(regex)
|
||||
@release_regexs << regex
|
||||
end
|
||||
|
||||
|
||||
def test_invoked?
|
||||
invoked = false
|
||||
|
||||
|
||||
@test_regexs.each do |regex|
|
||||
invoked = true if (@rake_utils.task_invoked?(regex))
|
||||
break if invoked
|
||||
end
|
||||
|
||||
|
||||
return invoked
|
||||
end
|
||||
|
||||
|
||||
def release_invoked?
|
||||
invoked = false
|
||||
|
||||
|
||||
@release_regexs.each do |regex|
|
||||
invoked = true if (@rake_utils.task_invoked?(regex))
|
||||
break if invoked
|
||||
end
|
||||
|
||||
|
||||
return invoked
|
||||
end
|
||||
|
||||
@@ -60,7 +60,7 @@ class TaskInvoker
|
||||
@rake_wrapper[mock].invoke
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
def invoke_test_runner(runner)
|
||||
@dependinator.enhance_runner_dependencies( runner )
|
||||
reset_rake_task_for_changed_defines( runner )
|
||||
@@ -112,11 +112,11 @@ class TaskInvoker
|
||||
@rake_wrapper[file].invoke
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def invoke_release_objects(objects)
|
||||
par_map(PROJECT_COMPILE_THREADS, objects) do |object|
|
||||
@rake_wrapper[object].invoke
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -113,4 +113,3 @@ task :summary do
|
||||
puts "\nNOTE: Summaries may be out of date with project sources.\n\n"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -109,5 +109,3 @@ namespace :files do
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ require 'ceedling/file_path_utils'
|
||||
desc "Build release target."
|
||||
task RELEASE_SYM => [:directories] do
|
||||
header = "Release build '#{File.basename(PROJECT_RELEASE_BUILD_TARGET)}'"
|
||||
@ceedling[:streaminator].stdout_puts("\n\n#{header}\n#{'-' * header.length}")
|
||||
|
||||
@ceedling[:streaminator].stdout_puts("\n\n#{header}\n#{'-' * header.length}")
|
||||
|
||||
begin
|
||||
@ceedling[:plugin_manager].pre_release
|
||||
|
||||
@@ -15,16 +15,15 @@ task RELEASE_SYM => [:directories] do
|
||||
|
||||
@ceedling[:project_config_manager].process_release_config_change
|
||||
core_objects.concat( @ceedling[:release_invoker].setup_and_invoke_c_objects( COLLECTION_ALL_SOURCE ) )
|
||||
|
||||
|
||||
# if assembler use isn't enabled, COLLECTION_ALL_ASSEMBLY is empty array & nothing happens
|
||||
core_objects.concat( @ceedling[:release_invoker].setup_and_invoke_asm_objects( COLLECTION_ALL_ASSEMBLY ) )
|
||||
|
||||
|
||||
# if we're using libraries, we need to add those to our collection as well
|
||||
library_objects = (defined? LIBRARIES_RELEASE && !LIBRARIES_RELEASE.empty?) ? LIBRARIES_RELEASE.flatten.compact : []
|
||||
file( PROJECT_RELEASE_BUILD_TARGET => (core_objects + extra_objects + library_objects) )
|
||||
Rake::Task[PROJECT_RELEASE_BUILD_TARGET].invoke
|
||||
ensure
|
||||
@ceedling[:plugin_manager].post_release
|
||||
@ceedling[:plugin_manager].post_release
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -59,4 +59,3 @@ namespace TEST_SYM do
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -19,14 +19,14 @@ class TestInvokerHelper
|
||||
|
||||
yield( dependencies_list ) if block_given?
|
||||
end
|
||||
|
||||
|
||||
def extract_sources(test)
|
||||
sources = []
|
||||
includes = @test_includes_extractor.lookup_includes_list(test)
|
||||
|
||||
|
||||
includes.each { |include| sources << @file_finder.find_compilation_input_file(include, :ignore) }
|
||||
|
||||
|
||||
return sources.compact
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user