@@ -42,24 +42,23 @@ task :build do
42
42
end
43
43
44
44
task :test_environment do
45
- NUNIT_TOOLS = 'src/packages/NUnit.Runners.*/tools'
46
- NUNIT_CONSOLE = Dir [ File . join ( NUNIT_TOOLS , 'nunit-console.exe' ) ] . first
47
- NUNIT_EXE = Dir [ File . join ( NUNIT_TOOLS , 'nunit.exe' ) ] . first
45
+ NUNIT_TOOLS = 'src/packages/NUnit.ConsoleRunner.*/tools'
46
+ NUNIT_CONSOLE = Dir [ File . join ( NUNIT_TOOLS , 'nunit3-console.exe' ) ] . first
48
47
49
48
OPENCOVER_CONSOLE = Dir [ 'src/packages/OpenCover.*/tools/OpenCover.Console.exe' ] . first
50
49
REPORT_GENERATOR = Dir [ 'src/packages/ReportGenerator.*/tools/ReportGenerator.exe' ] . first
51
50
52
51
UNIT_TESTS_DLL = "bin/#{ CONFIG } /StateMechanicUnitTests.dll"
53
52
54
- raise "NUnit.Runners not found. Restore NuGet packages" unless NUNIT_CONSOLE && NUNIT_EXE
53
+ raise "NUnit.ConsoleRunner not found. Restore NuGet packages" unless NUNIT_CONSOLE
55
54
raise "OpenCover not found. Restore NuGet packages" unless OPENCOVER_CONSOLE
56
55
raise "ReportGenerator not found. Restore NuGet packages" unless REPORT_GENERATOR
57
56
end
58
57
59
58
desc "Generate unit test code coverage reports for CONFIG (or Debug)"
60
59
task :cover => [ :test_environment , COVERAGE_DIR ] do
61
60
coverage_file = File . join ( COVERAGE_DIR , File . basename ( UNIT_TESTS_DLL ) . ext ( 'xml' ) )
62
- sh %Q{#{ OPENCOVER_CONSOLE } -register:user -target:"#{ NUNIT_CONSOLE } " -targetargs:"#{ UNIT_TESTS_DLL } /noshadow " -filter:"+[StateMechanic]*" -excludebyattribute:*.ExcludeFromCoverageAttribute -output:"#{ coverage_file } "}
61
+ sh %Q{#{ OPENCOVER_CONSOLE } -register:user -target:"#{ NUNIT_CONSOLE } " -targetargs:"#{ UNIT_TESTS_DLL } " -filter:"+[StateMechanic]*" -excludebyattribute:*.ExcludeFromCoverageAttribute -output:"#{ coverage_file } "}
63
62
64
63
rm ( 'TestResult.xml' , :force => true )
65
64
0 commit comments