我在FAKE中使用DotCoverNUnit
代码覆盖率。
它给出了一些错误
`Starting Target: TestCoverage (==> BuildUnitTest)
./Buildtools/dotCover/dotCover.exe "cover" "/TargetExecutable=./Libs/NUnit.Runners.2.6.3/tools/nunit-console.exe" "/TargetArguments="-nologo" "-labels" "D:\Project\build\project.UnitTest.dll" "-xml:D:\Project\TestResult.xml"" "/Output=./test/NUnitDotCover.xml"
./Buildtools/dotCover/dotCover.exe "cover" "/TargetExecutable=./Libs/NUnit.Runners.2.6.3/tools/nunit-console.exe" "/TargetArguments="-nologo" "-labels" "D:\Project\build\Project.UnitTest.dll" "-xml:D:\Project\TestResult.xml"" "/Output=./test/NUnitDotCover.xml"
JetBrains dotCover Console Runner v2.6.608.684. Copyright (c) 2009–2017 JetBrains s.r.o. All rights reserved.
**Command 'cover' doesn't support 4 unnamed arguments**
Type 'dotCover help' for usage.
Running build failed.
Error:
System.Exception: Error running ./Buildtools/dotCover/dotCover.exe with exitcode -1
at Fake.DotCover.buildParamsAndExecute@124-6.Invoke(String message)
at Fake.DotCover.buildParamsAndExecute[a](a parameters, FSharpFunc2 buildArguments,String toolPath, String workingDir, Boolean failBuild)
at Fake.DotCover.DotCoverNUnit(FSharpFunc 2 setDotCoverParams, FSharpFunc2 setNUnitParams, IEnumerable 1 assemblies)
at FSI_0005.Build.clo@98-8.Invoke(Unit _arg6) in D:\ICIS API develop\icis-api\build.fsx:line 99`
我无法在此代码中找出问题所在,我之前能够运行此代码,但现在它并没有下降。
以下是我用于DotCover的代码:
Target "TestCoverage" (fun _ ->
!! (buildDir @@ "/Project.UnitTest.dll")
|> DotCoverNUnit
(fun p -> { p with TargetExecutable ="nunit-console.exe"
Output ="NUnitDotCover.xml"
ToolPath = "dotCover.exe"
ErrorLevel = DontFailBuild
Filters = filters })
(fun nunitOptions ->
{ nunitOptions with DisableShadowCopy = true })
tracefn "##teamcity[importData type='dotNetCoverage' tool='dotcover' path='%s']" (testDir @@ "NUnitDotCover.xml")
)