gpt4 book ai didi

xunit - 如何使用XUnit控制台输出NUnit格式的xml?

转载 作者:行者123 更新时间:2023-12-04 09:37:49 25 4
gpt4 key购买 nike

我需要XUnit测试的NUnit输出来生成报告。使用NUnit,我可以执行以下操作:

nunit-console.exe /xml=c:\TestResultN.xml MyDll.dll

我试过了:
xunit.console MyDll.dll /nunit TestResults.xml

但我得到:
unknown output transform: nunit

在xunit控制台上有任何好的文档吗?我找不到任何信息。

最佳答案

在控制台中键入xunit.console.exe /?,然后查看选项列表的末尾。

> xunit.console.exe /?
xUnit.net console test runner (64-bit .NET 2.0.50727.4952)
Copyright (C) 2007-10 Microsoft Corporation.

usage: xunit.console <xunitProjectFile> [options]
usage: xunit.console <assemblyFile> [configFile] [options]

Valid options:
/silent : do not output running test count
/teamcity : forces TeamCity mode (normally auto-detected)
/wait : wait for input after completion

Valid options for assemblies only:
/noshadow : do not shadow copy assemblies
/xml <filename> : output results to Xunit-style XML file
/html <filename> : output results to HTML file
/nunit <filename> : output results to NUnit-style XML file

最后两个选项是从配置文件中提取的,并且包含一个应用于xunit输出的xslt文件。如果不存在 /nunit,请确保在xunit目录中具有 NUnitXml.xslt文件,并且在 nunit文件中声明了 xunit.console.exe.config条目。

我的 xunit.console.exe.config文件:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>

<configSections>
<section name="xunit" type="Xunit.ConsoleClient.XunitConsoleConfigurationSection, xunit.console"/>
</configSections>

<xunit>
<transforms>
<add
commandline="html"
xslfile="HTML.xslt"
description="output results to HTML file"/>
<add
commandline="nunit"
xslfile="NUnitXml.xslt"
description="output results to NUnit-style XML file"/>
</transforms>
</xunit>

</configuration>

如果找不到这些文件,则可能需要重新安装xunit。

关于xunit - 如何使用XUnit控制台输出NUnit格式的xml?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4431536/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com