Class: XUnitTestRunner
- Inherits:
-
Object
- Object
- XUnitTestRunner
- Includes:
- Albacore::RunCommand, Albacore::Task
- Defined in:
- lib/albacore/xunittestrunner.rb
Constant Summary collapse
- TaskName =
:xunit
Instance Attribute Summary collapse
-
#html_output ⇒ Object
Returns the value of attribute html_output.
-
#skip_test_fail ⇒ Object
Returns the value of attribute skip_test_fail.
Attributes included from Albacore::RunCommand
Attributes included from Logging
Instance Method Summary collapse
- #build_html_output ⇒ Object
- #execute ⇒ Object
- #get_command_line ⇒ Object
- #get_command_parameters ⇒ Object
-
#initialize(command = nil) ⇒ XUnitTestRunner
constructor
A new instance of XUnitTestRunner.
- #skip_test_failures ⇒ Object
Methods included from Albacore::RunCommand
Methods included from AttrMethods
Methods included from Albacore::Task
clean_dirname, create_rake_task, include_config, included
Methods included from UpdateAttributes
Methods included from YAMLConfig
#configure, #load_config_by_task_name
Methods included from Logging
#create_logger, #log_device=, #log_level, #log_level=
Methods included from Failure
Constructor Details
#initialize(command = nil) ⇒ XUnitTestRunner
Returns a new instance of XUnitTestRunner.
11 12 13 14 15 16 |
# File 'lib/albacore/xunittestrunner.rb', line 11 def initialize(command=nil) @options=[] super() update_attributes Albacore.configuration.xunit.to_hash @command = command unless command.nil? end |
Instance Attribute Details
#html_output ⇒ Object
Returns the value of attribute html_output.
8 9 10 |
# File 'lib/albacore/xunittestrunner.rb', line 8 def html_output @html_output end |
#skip_test_fail ⇒ Object
Returns the value of attribute skip_test_fail.
8 9 10 |
# File 'lib/albacore/xunittestrunner.rb', line 8 def skip_test_fail @skip_test_fail end |
Instance Method Details
#build_html_output ⇒ Object
52 53 54 55 |
# File 'lib/albacore/xunittestrunner.rb', line 52 def build_html_output 'Directory is required for html_output' if !File.directory?(File.(@html_output)) "/html \"#{File.join(File.(@html_output),"%s.html")}\"" end |
#execute ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/albacore/xunittestrunner.rb', line 38 def execute() @assemblies = [] if @assemblies.nil? @assemblies << @assembly unless @assembly.nil? 'At least one assembly is required for assemblies attr' if @assemblies.length==0 = 'XUnit Failed. See Build Log For Detail' @assemblies.each do |assm| command_params = get_command_parameters.collect{ |p| p % File.basename(assm) } command_params.insert(0,assm) result = run_command "XUnit", command_params.join(" ") if !result && (!@skip_test_fail || $?.exitstatus > 1) end end |
#get_command_line ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/albacore/xunittestrunner.rb', line 22 def get_command_line command_params = [] command_params << @command command_params << get_command_parameters commandline = command_params.join(" ") @logger.debug "Build XUnit Test Runner Command Line: " + commandline commandline end |
#get_command_parameters ⇒ Object
31 32 33 34 35 36 |
# File 'lib/albacore/xunittestrunner.rb', line 31 def get_command_parameters command_params = [] command_params << @options.join(" ") unless @options.nil? command_params << build_html_output unless @html_output.nil? command_params end |
#skip_test_failures ⇒ Object
18 19 20 |
# File 'lib/albacore/xunittestrunner.rb', line 18 def skip_test_failures @skip_test_fail = true end |