Albacore / albacore

Albacore is a professional quality suite of Rake tasks for building .NET or Mono based systems.
www.albacorebuild.net
221 stars 64 forks source link

test_runner: run xunit with parameters containing spaces fails #172

Closed joelwilson closed 9 years ago

joelwilson commented 9 years ago

Task:

namespace :tests do
  test_runner :unit do |tests|
    tests.files = FileList['MyProject.Tests/bin/**/*MyProject.Tests.dll']
    tests.exe = 'packages/xunit.runner.console.2.0.0/tools/xunit.console.exe'
    tests.add_parameter '-parallel all'
  end
end

Error:

$ rake test
(in c:/Users/jwilson/Code/MyProject)
I 2015-07-29T11:39:13.174699-07:00: executing in directory './MyProject.Tests/bin/Debug'
..\..\..\packages\xunit.runner.console.2.0.0\tools\xunit.console.exe MyProject.Tests.dll -parallel all
error: missing filename for -parallel all
rake aborted!
Albacore::CommandFailedError: Command failed with status (1):
  ..\..\..\packages\xunit.runner.console.2.0.0\tools\xunit.console.exe MyProject.Tests.dll -parallel all
error: missing filename for -parallel all

Tasks: TOP => test => tests:unit
(See full trace by running task with --trace)

Tests run without errors if I specify a parameter containing no spaces such as -nologo.

haf commented 9 years ago

-parallel all are two parameters, not one, as seem from the operating system.

joelwilson commented 9 years ago

Thanks for the quick reply! What you say makes sense and by splitting the parameter into two, it works. It would be nice though if albacore could somehow handle arguments like these so we can avoid creating two add_parameter calls for one logical key/value parameter.

haf commented 9 years ago

We'd have to implement parsers for every exe you'd ever put inside the exe property to do that. Or somehow write a C#/IL-interpreter so we can know what are stand-alone parameters and which ones are together.