Sha256: bd6a5be70aeecd6572f0289173b97a185655f6047c7c87db4ade8cfa3e0cb996

Contents?: true

Size: 1.47 KB

Versions: 20

Compression:

Stored size: 1.47 KB

Contents

require 'constants'


class GeneratorHelper

  constructor :streaminator


  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
      notice  = "\n" +
                "ERROR: Test executable \"#{File.basename(executable)}\" failed.\n" +
                "> Produced no output to $stdout.\n"
    elsif ((shell_result[:output] =~ TEST_STDOUT_STATISTICS_PATTERN).nil?)
      error = true
      # mirror style of generic tool_executor failure output
      notice  = "\n" +
                "ERROR: Test executable \"#{File.basename(executable)}\" failed.\n" +
                "> 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)
      notice += "> And then likely crashed.\n"                                                       if (shell_result[:exit_code] == nil)

      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      
    end
  end
  
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ceedling-0.13.0 lib/generator_helper.rb
ceedling-0.13.0.rc1 lib/generator_helper.rb
ceedling-0.12.2 new_project_template/vendor/ceedling/lib/generator_helper.rb
ceedling-0.12.1 new_project_template/vendor/ceedling/lib/generator_helper.rb
ceedling-0.12.0 new_project_template/vendor/ceedling/lib/generator_helper.rb
ceedling-0.11.2 new_project_template/vendor/ceedling/lib/generator_helper.rb
ceedling-0.11.1 new_project_template/vendor/ceedling/lib/generator_helper.rb
ceedling-0.11.0 new_project_template/vendor/ceedling/lib/generator_helper.rb
ceedling-0.10.0 new_project_template/vendor/ceedling/lib/generator_helper.rb
ceedling-0.9.4 new_project_template/vendor/ceedling/lib/generator_helper.rb
ceedling-0.9.2 new_project_template/vendor/ceedling/lib/generator_helper.rb
ceedling-0.9.0 new_project_template/vendor/ceedling/lib/generator_helper.rb
ceedling-0.0.18 new_project_template/vendor/ceedling/lib/generator_helper.rb
ceedling-0.0.17 new_project_template/vendor/ceedling/lib/generator_helper.rb
ceedling-0.0.16 new_project_template/vendor/ceedling/lib/generator_helper.rb
ceedling-0.0.15 new_project_template/vendor/ceedling/lib/generator_helper.rb
ceedling-0.0.14 new_project_template/vendor/ceedling/lib/generator_helper.rb
ceedling-0.0.13 new_project_template/vendor/ceedling/lib/generator_helper.rb
ceedling-0.0.12 new_project_template/vendor/ceedling/lib/generator_helper.rb
ceedling-0.0.8 new_project_template/vendor/ceedling/lib/generator_helper.rb