通过NUnit运行代码时,为什么OpenCover找不到所有模块?

时间:2019-06-11 18:37:01

标签: .net nunit opencover

我有一个通过OpenCover运行NUnit的脚本。可以为脚本提供程序集名称列表,以限制覆盖范围。 不幸的是,OpenCover无法看到所有模块。

我使用3个参数运行脚本:

  1. 单元测试dll路径-.\Test\UnitTests\bin\Debug\UnitTests.dll
  2. 程序集名称列表-DataSvc,DataProcessor,xyz.DataManager
  3. nunit的过滤器-class==DeviceServicesTest.PunchProcessingTest

赞:

C:\xyz\tip> Start-TestsWithCoverage .\Test\UnitTests\bin\Debug\UnitTests.dll -AssemblyNames DataSvc,DataProcessor,xyz.DataManager -Where "class==DeviceServicesTest.PunchProcessingTest"

脚本输出根据给定程序集名称构建的OpenCover过滤器:

Using filter +[DataSvc]* +[DataProcessor]* +[xyz.DataManager]*

然后继续输出OpenCover命令行。为简便起见,我使用~替换了我的用户个人资料路径。

& ~\AppData\Local\PackageManagement\NuGet\Packages\OpenCover.4.7.922\tools\OpenCover.Console.exe -output:~\AppData\Local\Temp\a35044_20190611135327\UnitTests.CoverageResult.xml `
            -log:Info `
            -mergeoutput `
            -register:user `
            -filter:+[DataSvc]* +[DataProcessor]* +[xyz.DataManager]* `
            -target:~\AppData\Local\PackageManagement\NuGet\Packages\NUnit.ConsoleRunner.3.10.0\tools\nunit3-console.exe `
            -hideskipped:MissingPdb `
            -skipautoprops `
            -mergebyhash `
            -targetargs:"--workers=1 --trace=Info --stoponerror --result=~\AppData\Local\Temp\a35044_20190611135327\UnitTests.TestResult.xml --noh --noc --inprocess --domain=Single --where:`"class==DeviceServicesTest.PunchProcessingTest`" .\Test\UnitTests\bin\Debug\UnitTests.dll" `
        | & Write-Host

现在该命令执行并产生以下输出:

Executing: ~\AppData\Local\PackageManagement\NuGet\Packages\NUnit.ConsoleRunner.3.10.0\tools\nunit3-console.exe
Runtime Environment
   OS Version: Microsoft Windows NT 10.0.17763.0
  CLR Version: 4.0.30319.42000

Test Files
    .\Test\UnitTests\bin\Debug\UnitTests.dll

Test Filters
    Where: class==DeviceServicesTest.PunchProcessingTest


Run Settings
    ProcessModel: InProcess
    DomainUsage: Single
    DisposeRunners: True
    InternalTraceLevel: Info
    WorkDirectory: C:\xyz\tip
    StopOnError: True
    NumberOfTestWorkers: 1
    ImageRuntimeVersion: 4.0.30319
    ImageTargetFrameworkName: .NETFramework,Version=v4.7.2
    ImageRequiresX86: False
    ImageRequiresDefaultAppDomainAssemblyResolver: False

Test Run Summary
  Overall result: Passed
  Test Count: 501, Passed: 501, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
  Start time: 2019-06-11 17:53:29Z
    End time: 2019-06-11 17:56:10Z
    Duration: 161.509 seconds

Results (nunit3) saved as ~\AppData\Local\Temp\a35044_20190611135327\UnitTests.TestResult.xml
Committing...
No results, this could be for a number of reasons. The most common reasons are:
    1) missing PDBs for the assemblies that match the filter please review the
    output file and refer to the Usage guide (Usage.rtf) about filters.
    2) the profiler may not be registered correctly, please refer to the Usage
    guide and the -register switch.

Name                           Value
----                           -----
CoverageResult                 ~\AppData\Local\Temp\a35044_20190611135327\UnitTests.CoverageResult.xml
TestResult                     ~\AppData\Local\Temp\a35044_20190611135327\UnitTests.TestResult.xml

检查OpenCoverResult.xml中报告的模块会得出以下结果:

C:\xyz\tip> cat ~\AppData\Local\Temp\a35044_20190611135327\UnitTests.CoverageResult.xml | sls "ModulePath>C:\\xyz"

      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\nunit.framework.dll</ModulePath>
      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\UnitTests.dll</ModulePath>
      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\SchedulePolicyValidation.dll</ModulePath>
      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\xyz.Data.dll</ModulePath>
      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\xyz.WFM.Core.WorkContractPremium.Engine.dll</ModulePath>
      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\MultiApprovalProcessor.dll</ModulePath>
      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\HRMappingRuleEngine.dll</ModulePath>
      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\RuleEngine.dll</ModulePath>
      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\xyz.Common.dll</ModulePath>
      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\AccrualEngine.dll</ModulePath>
      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\RuleEngineHelper.dll</ModulePath>
      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\StaffAssignment.dll</ModulePath>

请注意我没有要求的程序集名称。也许他们没有PDB?但是他们这样做:

C:\xyz\tip> 'DataSvc','DataProcessor', 'xyz.DataManager' |% { dir ".\Test\UnitTests\bin\Debug\$_.*" }


    Directory: C:\xyz\tip\Test\UnitTests\bin\Debug


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        6/11/2019  12:44 PM       15237632 DataSvc.dll
-a----        6/11/2019  12:44 PM       18771456 DataSvc.pdb
-a----        6/11/2019  12:34 PM        1762816 DataProcessor.dll
-a----        6/11/2019  12:34 PM        2334208 DataProcessor.pdb
-a----        6/11/2019  12:34 PM         181760 xyz.DataManager.dll
-a----        6/11/2019  12:34 PM         368128 xyz.DataManager.pdb

或者程序集名称与文件名不同?不,

C:\xyz\tip> 'DataSvc','DataProcessor', 'xyz.DataManager' |% { [Reflection.AssemblyName]::GetAssemblyName("$pwd\Test\UnitTests\bin\Debug\$_.dll") }

Version        Name
-------        ----
1.0.0.0        DataSvc
1.0.0.0        DataProcessor
1.0.0.0        xyz.DataManager

或者也许进行的测试只是不将这些程序集加载到内存中?再没有。除了删除它们并重新运行脚本外,我不知道如何对其进行测试:

C:\xyz\tip> 'DataSvc','DataProcessor', 'xyz.DataManager' |% { del ".\Test\UnitTests\bin\Debug\$_.*" }
C:\xyz\tip> 'DataSvc','DataProcessor', 'xyz.DataManager' |% { dir ".\Test\UnitTests\bin\Debug\$_.*" }
C:\xyz\tip>  Start-TestsWithCoverage .\Test\UnitTests\bin\Debug\UnitTests.dll -AssemblyNames DataSvc,DataProcessor,xyz.DataManager -Where "class==DeviceServicesTest.PunchProcessingTest"
Using filter +[DataSvc]* +[DataProcessor]* +[xyz.DataManager]*
& ~\AppData\Local\PackageManagement\NuGet\Packages\OpenCover.4.7.922\tools\OpenCover.Console.exe -output:~\AppData\Local\Temp\a35044_20190611141815\UnitTests.CoverageResult.xml `
            -log:Info `
            -mergeoutput `
            -register:user `
            -filter:+[DataSvc]* +[DataProcessor]* +[xyz.DataManager]* `
            -target:~\AppData\Local\PackageManagement\NuGet\Packages\NUnit.ConsoleRunner.3.10.0\tools\nunit3-console.exe `
            -hideskipped:MissingPdb `
            -skipautoprops `
            -mergebyhash `
            -targetargs:"--workers=1 --trace=Info --stoponerror --result=~\AppData\Local\Temp\a35044_20190611141815\UnitTests.TestResult.xml --noh --noc --inprocess --domain=Single --where:`"class==DeviceServicesTest.PunchProcessingTest`" .\Test\UnitTests\bin\Debug\UnitTests.dll" `
        | & Write-Host
Executing: ~\AppData\Local\PackageManagement\NuGet\Packages\NUnit.ConsoleRunner.3.10.0\tools\nunit3-console.exe
Runtime Environment
   OS Version: Microsoft Windows NT 10.0.17763.0
  CLR Version: 4.0.30319.42000

Test Files
    .\Test\UnitTests\bin\Debug\UnitTests.dll

Test Filters
    Where: class==DeviceServicesTest.PunchProcessingTest


Errors, Failures and Warnings

1) Invalid : UnitTests.dll
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
  ----> Could not load file or assembly 'DataSvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'DataSvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'DataSvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'DataSvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'DataSvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'DataSvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'DataSvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'DataSvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'DataSvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'xyz.DataManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'xyz.DataManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'xyz.DataManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'xyz.DataManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.

Execution terminated after first error

Run Settings
    ProcessModel: InProcess
    DomainUsage: Single
    DisposeRunners: True
    InternalTraceLevel: Info
    WorkDirectory: C:\xyz\tip
    StopOnError: True
    NumberOfTestWorkers: 1
    ImageRuntimeVersion: 4.0.30319
    ImageTargetFrameworkName: .NETFramework,Version=v4.7.2
    ImageRequiresX86: False
    ImageRequiresDefaultAppDomainAssemblyResolver: False

Test Run Summary
  Overall result: Failed
  Test Count: 0, Passed: 0, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
  Start time: 2019-06-11 18:18:17Z
    End time: 2019-06-11 18:18:17Z
    Duration: 0.810 seconds

Results (nunit3) saved as ~\AppData\Local\Temp\a35044_20190611141815\UnitTests.TestResult.xml
Committing...
No results, this could be for a number of reasons. The most common reasons are:
    1) missing PDBs for the assemblies that match the filter please review the
    output file and refer to the Usage guide (Usage.rtf) about filters.
    2) the profiler may not be registered correctly, please refer to the Usage
    guide and the -register switch.

Name                           Value
----                           -----
CoverageResult                 ~\AppData\Local\Temp\a35044_20190611141815\UnitTests.CoverageResult.xml
TestResult                     ~\AppData\Local\Temp\a35044_20190611141815\UnitTests.TestResult.xml


C:\xyz\tip>

因此,答案是否定的-程序集已加载。所以,我有什么:

  1. 有些实际的程序集与给定的程序集名称匹配
  2. 他们有PDB
  3. 它们是通过单元测试加载的
  4. 但是OpenCover不会报告它们

有人可以向我解释我在做什么错吗?

编辑1

我刚运行时没有任何过滤器:

C:\Xyz\tip> Start-TestsWithCoverage .\Test\UnitTests\bin\Debug\UnitTests.dll -Where "class==DeviceServicesTest.PunchProcessingTest"
& ~\AppData\Local\PackageManagement\NuGet\Packages\OpenCover.4.7.922\tools\OpenCover.Console.exe -output:~\AppData\Local\Temp\a24272_20190611200801\UnitTests.CoverageResult.xml `
            -log:Info `
            -mergeoutput `
            -register:user `
             `
            -target:~\AppData\Local\PackageManagement\NuGet\Packages\NUnit.ConsoleRunner.3.10.0\tools\nunit3-console.exe `
            -hideskipped:MissingPdb `
            -skipautoprops `
            -mergebyhash `
            -targetargs:"--workers=1 --trace=Info --stoponerror --result=~\AppData\Local\Temp\a24272_20190611200801\UnitTests.TestResult.xml --noh --noc --inprocess --domain=Single --where:`"class==DeviceServicesTest.PunchProcessingTest`" .\Test\UnitTests\bin\Debug\UnitTests.dll" `
        | & Write-Host
Executing: ~\AppData\Local\PackageManagement\NuGet\Packages\NUnit.ConsoleRunner.3.10.0\tools\nunit3-console.exe
Runtime Environment
   OS Version: Microsoft Windows NT 10.0.17763.0
  CLR Version: 4.0.30319.42000

Test Files
    .\Test\UnitTests\bin\Debug\UnitTests.dll

Test Filters
    Where: class==DeviceServicesTest.PunchProcessingTest


Run Settings
    ProcessModel: InProcess
    DomainUsage: Single
    DisposeRunners: True
    InternalTraceLevel: Info
    WorkDirectory: C:\Xyz\tip
    StopOnError: True
    NumberOfTestWorkers: 1
    ImageRuntimeVersion: 4.0.30319
    ImageTargetFrameworkName: .NETFramework,Version=v4.7.2
    ImageRequiresX86: False
    ImageRequiresDefaultAppDomainAssemblyResolver: False

Test Run Summary
  Overall result: Passed
  Test Count: 501, Passed: 501, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
  Start time: 2019-06-12 00:08:02Z
    End time: 2019-06-12 00:12:59Z
    Duration: 296.238 seconds

Results (nunit3) saved as ~\AppData\Local\Temp\a24272_20190611200801\UnitTests.TestResult.xml
Committing...
Source file is modified: C:\Xyz\tip\Test\UnitTests\DeviceServices\DeviceServicesTest.cs
Visited Classes 20 of 5617 (0.36)
Visited Methods 46 of 34372 (0.13)
Visited Points 133 of 335922 (0.04)
Visited Branches 67 of 169563 (0.04)

==== Alternative Results (includes all methods including those without corresponding source) ====
Alternative Visited Classes 20 of 10833 (0.18)
Alternative Visited Methods 46 of 44579 (0.1)

Name                           Value
----                           -----
CoverageResult                 ~\AppData\Local\Temp\a24272_20190611200801\UnitTests.CoverageResult.xml
TestResult                     ~\AppData\Local\Temp\a24272_20190611200801\UnitTests.TestResult.xml

产生的文件很大:

C:\Xyz\tip> dir ~\AppData\Local\Temp\a24272_20190611192946\UnitTests.CoverageResult.xml


    Directory: ~\AppData\Local\Temp\a24272_20190611192946


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        6/11/2019   7:33 PM      170794313 UnitTests.CoverageResult.xml


C:\Xyz\tip>

但是它仍然不包含我绝对确定已加载的程序集:

C:\Xyz\tip> cat ~\AppData\Local\Temp\a24272_20190611192946\UnitTests.CoverageResult.xml | sls "ModulePath>C:\\Xyz"

      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\nunit.framework.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\UnitTests.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\SchedulePolicyValidation.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\Xyz.Data.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\Xyz.WFM.Core.WorkContractPremium.Engine.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\MultiApprovalProcessor.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\HRMappingRuleEngine.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\RuleEngine.dll</ModulePath>


C:\Xyz\tip>

既没有DataSvc,也没有DataProcessor或Xyz.DataManager。

编辑2

我被要求直接运行OpenCover可执行文件,所以我们开始:

C:\Xyz\tip [master ↓290 +9 ~1 -0 !]> $d = Get-DumpDir
C:\Xyz\tip [master ↓290 +9 ~1 -0 !]> $d
~\AppData\Local\Temp\a24272_20190612091253
C:\Xyz\tip [master ↓290 +9 ~1 -0 !]> dir $d
C:\Xyz\tip [master ↓290 +9 ~1 -0 !]> $OpenCover = (Resolve-Path '~\AppData\Local\PackageManagement\NuGet\Packages\OpenCover.4.7.922\tools\OpenCover.Console.exe').Path
C:\Xyz\tip [master ↓290 +9 ~1 -0 !]> $NUnit = (Resolve-Path '~\AppData\Local\PackageManagement\NuGet\Packages\NUnit.ConsoleRunner.3.10.0\tools\nunit3-console.exe').Path
C:\Xyz\tip [master ↓290 +9 ~1 -0 !]> $CovResult = "$d\UnitTests.CoverageResult.xml"
C:\Xyz\tip [master ↓290 +9 ~1 -0 !]> $NUnitResult = "$d\UnitTests.TestResult.xml"
C:\Xyz\tip [master ↓290 +9 ~1 -0 !]> & $OpenCover -output:$CovResult -log:Info -mergeoutput -register:user -target:$NUnit -hideskipped:MissingPdb -skipautoprops -mergebyhash `
>> -targetargs:"--workers=1 --trace=Info --stoponerror --result=$NUnitResult --noh --inprocess --domain=Single --where:`"class==DeviceServicesTest.PunchProcessingTest`" .\Test\UnitTests\bin\Debug\UnitTests.dll"
Executing: ~\AppData\Local\PackageManagement\NuGet\Packages\NUnit.ConsoleRunner.3.10.0\tools\nunit3-console.exe
Runtime Environment
   OS Version: Microsoft Windows NT 10.0.17763.0
  CLR Version: 4.0.30319.42000

Test Files
    .\Test\UnitTests\bin\Debug\UnitTests.dll

Test Filters
    Where: class==DeviceServicesTest.PunchProcessingTest


Run Settings
    ProcessModel: InProcess
    DomainUsage: Single
    DisposeRunners: True
    InternalTraceLevel: Info
    WorkDirectory: C:\Xyz\tip
    StopOnError: True
    NumberOfTestWorkers: 1
    ImageRuntimeVersion: 4.0.30319
    ImageTargetFrameworkName: .NETFramework,Version=v4.7.2
    ImageRequiresX86: False
    ImageRequiresDefaultAppDomainAssemblyResolver: False

Test Run Summary
  Overall result: Passed
  Test Count: 501, Passed: 501, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
  Start time: 2019-06-12 13:15:34Z
    End time: 2019-06-12 13:20:17Z
    Duration: 283.230 seconds

Results (nunit3) saved as ~\AppData\Local\Temp\a24272_20190612091253\UnitTests.TestResult.xml
Committing...
Source file is modified: C:\Xyz\tip\Test\UnitTests\DeviceServices\DeviceServicesTest.cs
Visited Classes 20 of 5617 (0.36)
Visited Methods 46 of 34372 (0.13)
Visited Points 133 of 335922 (0.04)
Visited Branches 67 of 169563 (0.04)

==== Alternative Results (includes all methods including those without corresponding source) ====
Alternative Visited Classes 20 of 10833 (0.18)
Alternative Visited Methods 46 of 44579 (0.1)
C:\Xyz\tip>

报告的模块是:

C:\Xyz\tip> cat $CovResult | sls "ModulePath>C:\\Xyz"

      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\nunit.framework.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\UnitTests.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\SchedulePolicyValidation.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\Xyz.Data.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\Xyz.WFM.Core.WorkContractPremium.Engine.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\MultiApprovalProcessor.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\HRMappingRuleEngine.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\RuleEngine.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\Xyz.Common.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\AccrualEngine.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\RuleEngineHelper.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\StaffAssignment.dll</ModulePath>

不用说,这个列表很短。太短。缺少的程序集都不是.NET Core。 我非常愿意提供更多信息,只是让我确切知道什么。

编辑3

仅包含-merge...-hideskipped...标志的同一命令行:

C:\Xyz\tip> $d = Get-DumpDir
C:\Xyz\tip> dir $d
C:\Xyz\tip> $d
~\AppData\Local\Temp\a24272_20190614085640
C:\Xyz\tip> & $OpenCover -output:$CovResult -log:Info -register:user -target:$NUnit -targetargs:"--workers=1 --trace=Info --stoponerror --result=$NUnitResult --noh --inprocess --domain=Single --where:`"class==DeviceServicesTest.PunchProcessingTest`" .\Test\UnitTests\bin\Debug\UnitTests.dll"
Executing: ~\AppData\Local\PackageManagement\NuGet\Packages\NUnit.ConsoleRunner.3.10.0\tools\nunit3-console.exe
Runtime Environment
   OS Version: Microsoft Windows NT 10.0.17763.0
  CLR Version: 4.0.30319.42000

Test Files
    .\Test\UnitTests\bin\Debug\UnitTests.dll

Test Filters
    Where: class==DeviceServicesTest.PunchProcessingTest


Run Settings
    ProcessModel: InProcess
    DomainUsage: Single
    DisposeRunners: True
    InternalTraceLevel: Info
    WorkDirectory: C:\Xyz\tip
    StopOnError: True
    NumberOfTestWorkers: 1
    ImageRuntimeVersion: 4.0.30319
    ImageTargetFrameworkName: .NETFramework,Version=v4.7.2
    ImageRequiresX86: False
    ImageRequiresDefaultAppDomainAssemblyResolver: False

Test Run Summary
  Overall result: Passed
  Test Count: 500, Passed: 500, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
  Start time: 2019-06-14 12:57:10Z
    End time: 2019-06-14 13:01:54Z
    Duration: 283.427 seconds

Results (nunit3) saved as ~\AppData\Local\Temp\a24272_20190614084338\UnitTests.TestResult.xml
Committing...
Visited Classes 20 of 10321 (0.19)
Visited Methods 56 of 154629 (0.04)
Visited Points 143 of 456738 (0.03)
Visited Branches 77 of 289454 (0.03)

==== Alternative Results (includes all methods including those without corresponding source) ====
Alternative Visited Classes 20 of 10857 (0.18)
Alternative Visited Methods 56 of 164855 (0.03)
C:\Xyz\tip> dir $CovResult


    Directory: ~\AppData\Local\Temp\a24272_20190614084338


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        6/14/2019   9:02 AM      262507890 UnitTests.CoverageResult.xml


C:\Xyz\tip> cat $CovResult | sls "ModulePath>C:\\Xyz"

      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\nunit.framework.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\UnitTests.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\SchedulePolicyValidation.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\Xyz.Data.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\Xyz.WFM.Core.WorkContractPremium.Engine.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\MultiApprovalProcessor.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\HRMappingRuleEngine.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\RuleEngine.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\Xyz.Common.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\AccrualEngine.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\RuleEngineHelper.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\StaffAssignment.dll</ModulePath>


C:\Xyz\tip>

结果相同。

0 个答案:

没有答案