Class: RakeDotNet::XUnitConsoleCmd
- Inherits:
-
Object
- Object
- RakeDotNet::XUnitConsoleCmd
- Defined in:
- lib/rake_dotnet.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#reports_dir ⇒ Object
Returns the value of attribute reports_dir.
-
#test_dll ⇒ Object
Returns the value of attribute test_dll.
-
#xunit ⇒ Object
Returns the value of attribute xunit.
Instance Method Summary collapse
- #cmd ⇒ Object
- #exe ⇒ Object
- #html ⇒ Object
-
#initialize(test_dll, reports_dir, xunit = nil, options = {}) ⇒ XUnitConsoleCmd
constructor
A new instance of XUnitConsoleCmd.
- #noshadow ⇒ Object
- #nunit ⇒ Object
- #run ⇒ Object
- #suite ⇒ Object
- #teamcity ⇒ Object
- #wait ⇒ Object
- #xml ⇒ Object
Constructor Details
#initialize(test_dll, reports_dir, xunit = nil, options = {}) ⇒ XUnitConsoleCmd
Returns a new instance of XUnitConsoleCmd.
1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 |
# File 'lib/rake_dotnet.rb', line 1280 def initialize(test_dll, reports_dir, xunit=nil, ={}) x86exe = File.join(TOOLS_DIR, 'xunit', 'xunit.console.x86.exe') x64exe = File.join(TOOLS_DIR, 'xunit', 'xunit.console.exe') path_to_xunit = x64exe if File.exist? x86exe path_to_xunit = x86exe end @xunit = xunit || path_to_xunit @xunit = File.(@xunit) @test_dll = File.(test_dll) @reports_dir = File.(reports_dir) @options = end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
1278 1279 1280 |
# File 'lib/rake_dotnet.rb', line 1278 def @options end |
#reports_dir ⇒ Object
Returns the value of attribute reports_dir.
1278 1279 1280 |
# File 'lib/rake_dotnet.rb', line 1278 def reports_dir @reports_dir end |
#test_dll ⇒ Object
Returns the value of attribute test_dll.
1278 1279 1280 |
# File 'lib/rake_dotnet.rb', line 1278 def test_dll @test_dll end |
#xunit ⇒ Object
Returns the value of attribute xunit.
1278 1279 1280 |
# File 'lib/rake_dotnet.rb', line 1278 def xunit @xunit end |
Instance Method Details
#cmd ⇒ Object
1302 1303 1304 |
# File 'lib/rake_dotnet.rb', line 1302 def cmd cmd = "#{exe} #{test_dll} #{html} #{xml} #{nunit} #{wait} #{noshadow} #{teamcity}" end |
#exe ⇒ Object
1306 1307 1308 |
# File 'lib/rake_dotnet.rb', line 1306 def exe "\"#{@xunit}\"" end |
#html ⇒ Object
1318 1319 1320 1321 |
# File 'lib/rake_dotnet.rb', line 1318 def html path = "#{@reports_dir}/#{suite}.test-results.html".gsub('/', '\\') "/html \"#{path}\"" if @options.has_key?(:html) end |
#noshadow ⇒ Object
1337 1338 1339 |
# File 'lib/rake_dotnet.rb', line 1337 def noshadow '/noshadow' if @options.has_key?(:noshadow) end |
#nunit ⇒ Object
1328 1329 1330 1331 |
# File 'lib/rake_dotnet.rb', line 1328 def nunit path = "#{@reports_dir}/#{suite}.test-results.nunit.xml".gsub('/', '\\') "/nunit \"#{path}\"" if @options.has_key?(:nunit) end |
#run ⇒ Object
1294 1295 1296 1297 1298 1299 1300 |
# File 'lib/rake_dotnet.rb', line 1294 def run test_dir = Pathname.new(test_dll).dirname chdir test_dir do puts cmd if VERBOSE sh cmd end end |
#suite ⇒ Object
1310 1311 1312 |
# File 'lib/rake_dotnet.rb', line 1310 def suite @test_dll.match(/.*\/([\w\.]+)\.dll/)[1] end |
#teamcity ⇒ Object
1341 1342 1343 |
# File 'lib/rake_dotnet.rb', line 1341 def teamcity '/teamcity' if @options.has_key?(:teamcity) end |
#wait ⇒ Object
1333 1334 1335 |
# File 'lib/rake_dotnet.rb', line 1333 def wait '/wait' if @options.has_key?(:wait) end |
#xml ⇒ Object
1323 1324 1325 1326 |
# File 'lib/rake_dotnet.rb', line 1323 def xml path = "#{@reports_dir}/#{suite}.test-results.xml".gsub('/', '\\') "/xml \"#{path}\"" if @options.has_key?(:xml) end |