8

レポート用に XUnit テストからの NUnit 出力が必要です。NUnit を使用すると、次のことができます。

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

私はもう試した:

xunit.console MyDll.dll /nunit TestResults.xml

しかし、私は得る:

unknown output transform: nunit

xunit コンソールに関する適切なドキュメントはありますか? 情報が見つかりません。

4

2 に答える 2

21

コンソール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

最後の 2 つのオプションは構成ファイルから抽出され、xunit の出力に適用される xslt ファイルで構成されます。が存在しない場合/nunitは、NUnitXml.xsltファイルが xunit ディレクトリにあり、エントリ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 の再インストールが必要になる場合があります。

于 2011-01-17T14:32:00.057 に答える