-
Notifications
You must be signed in to change notification settings - Fork 64
XUnit
Henrik edited this page Aug 21, 2014
·
1 revision
Run tests written with the XUnit test framework.
desc "Run xunit tests"
xunit :test => [:build] do |cmd|
cmd.command = "path/to/xunitconsole"
cmd.assembly = "path/to/test/assembly"
cmd.results_path = {:xml => "path/to/results"}
end
The location of the xunit console executable.
command = "path/to/xunitconsole"
One assembly, containing [Fact]
s, for xunit to run. XUnit's console runner supports one assembly per run.
assembly = "path/to/test/assembly"
The type of output and the location of the file to write: :html
, xml
, & :nunit
. If one assembly is specified, this will be unchanged. If multiple assemblies are specified, the output filename will have the current assembly count appended (1-based), like "out/output_1.html
.
results_path = {:xml => "path/to/results"}
Unfortunately, you must write a task per test assembly and I don't think you can depend on Rake's FileList
because your build might be creating these assemblies and they wouldn't exist at the time you tried to define your tasks...
xunit_assemblies = FileList["path/to/assemblies/with/wildcards"]
xunit_assemblies.each do |name|
xunit name do |cmd|
cmd.command = "xunit"
cmd.assembly = name
cmd.output_path = {:html => "#{File.basename(name)}.html"}
end
end