Visual Studio单元测试命令行方式之----NUnit-Console.exe命令


本文为 Dennis Gao 原创或翻译技术文章,发表于博客园博客,未经作者本人允许禁止任何形式的转载。

NUnit-Console 命令行选项

  • NUnit-Console 命令行选项列表
  • 指定运行哪些测试用例
    • 运行指定程序集中的所有测试用例
    • 运行指定程序集中指定的测试用例
    • 通过单独的文件来指定运行测试列表
    • 指定多个程序集
    • 指定运行的 Configuration
    • 通过测试类别 Category 来 Include 或 Exclude 测试
  • 控制测试运行
    • 指定 .NET Framework 版本
    • 控制进程的使用
    • 控制 AppDomain 的使用
    • 控制 Apartment 的使用
    • 指定超时时长
  • 控制测试的输出
    • 重定向输出
    • 对测试输出进行标记
    • 指定 XML 结果文件名
    • 指定输出的目录
/run=STR

Name of the test case(s), fixture(s) or namespace(s) to run

/runlist=STR

Name of a file containing a list of the tests to run, one per line

/config=STR

Project configuration (e.g.: Debug) to load

/result=STR

Name of XML result file (Default: TestResult.xml) (Short format: /xml=STR)

/xmlConsole

Display XML to the console (Deprecated)

/noresult

Suppress XML result output (Short format: /noxml)

/output=STR

File to receive test output (Short format: /out=STR)

/err=STR

File to receive test error output

/work=STR

Work directory for output files

/labels

Label each test in stdOut

/trace=X

Set internal trace level: Off, Error, Warning, Info, Verbose

/include=STR

List of categories to include

/exclude=STR

List of categories to exclude

/framework=STR

Framework version to be used for tests

/process=X

Process model for tests: Single, Separate, Multiple

/domain=X

AppDomain Usage for tests: None, Single, Multiple

/apartment=X

Apartment for running tests: MTA (Default), STA

/noshadow

Disable shadow copy when running in separate domain

/nothread

Disable use of a separate thread for tests

/basepath=STR

Base path to be used when loading the assemblies

/privatebinpath=STR

Additional directories to be probed when loading assemblies, separated by semicolons

/timeout=X

Set timeout for each test case in milliseconds

/wait

Wait for input before closing console window

/nologo

Do not display the logo

/nodots

Do not display progress

/stoponerror

Stop after the first test failure or error

/cleanup

Erase any leftover cache files and exit

/help

Display help (Short format: /?)

NUnit-Console Command Line Options

本文为 Dennis Gao 原创或翻译技术文章,发表于博客园博客,未经作者本人允许禁止任何形式的转载。

出处:https://www.cnblogs.com/gaochundong/p/nunit_console_command_line_options.html