Skip to content

Commit

Permalink
add HTML test results
Browse files Browse the repository at this point in the history
  • Loading branch information
adamralph committed Oct 3, 2016
1 parent c01de7a commit 8f90213
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 6 additions & 4 deletions rakefile.netstd.rb
Expand Up @@ -350,23 +350,25 @@ def run_msbuild(solution, target, command, packages_dir = nil)

def run_tests(test_assemblies, command, result_dir)
test_assemblies.each do |test_assembly|
result_file = File.expand_path(File.join(result_dir, File.basename(test_assembly, '.dll') + '.TestResults.xml'))
xml = File.expand_path(File.join(result_dir, File.basename(test_assembly, '.dll') + '.TestResults.xml'))
html = File.expand_path(File.join(result_dir, File.basename(test_assembly, '.dll') + '.TestResults.html'))

xunit = XUnitTestRunner.new
xunit.command = command
xunit.assembly = test_assembly
xunit.options '-noshadow', '-nologo', '-notrait', '"explicit=yes"', '-xml', result_file
xunit.options '-noshadow', '-nologo', '-notrait', '"explicit=yes"', '-xml', xml, '-html', html
xunit.execute
end
end

def run_netstd_tests(test_directories, result_dir)
test_directories.each do |test_directory|
result_file = File.expand_path(File.join(result_dir, File.basename(test_directory) + '.TestResults.xml'))
xml = File.expand_path(File.join(result_dir, File.basename(test_directory) + '.TestResults.xml'))
# the xunit .NET Core runner can't produce HTML yet since XSLT isn't scheduled until .NET Core 1.2

test_cmd = Exec.new
test_cmd.command = "dotnet"
test_cmd.parameters "test -c Release #{test_directory} -nologo -notrait \"explicit=yes\" -xml #{result_file}"
test_cmd.parameters "test -c Release #{test_directory} -nologo -notrait \"explicit=yes\" -xml #{xml}"
test_cmd.execute
end
end
Expand Down
5 changes: 3 additions & 2 deletions rakefile.rb
Expand Up @@ -334,12 +334,13 @@ def run_msbuild(solution, target, command, packages_dir = nil)

def run_tests(test_assemblies, command, result_dir)
test_assemblies.each do |test_assembly|
result_file = File.expand_path(File.join(result_dir, File.basename(test_assembly, '.dll') + '.TestResults.xml'))
xml = File.expand_path(File.join(result_dir, File.basename(test_assembly, '.dll') + '.TestResults.xml'))
html = File.expand_path(File.join(result_dir, File.basename(test_assembly, '.dll') + '.TestResults.html'))

xunit = XUnitTestRunner.new
xunit.command = command
xunit.assembly = test_assembly
xunit.options '-noshadow', '-nologo', '-notrait', '"explicit=yes"', '-xml', result_file
xunit.options '-noshadow', '-nologo', '-notrait', '"explicit=yes"', '-xml', xml, '-html', html
xunit.execute
end
end
Expand Down

0 comments on commit 8f90213

Please sign in to comment.