The primary build system for xUnit.net is done via command line, and officially supports Linux and Windows. Users running macOS can generally follow the Linux instructions (while installing the macOS equivalents of the dependencies).
You will need the following software installed (regardless of OS):
Linux users will additionally need:
Windows users will additionally need:
- .NET Framework 4.7.2 or later (part of the Windows OS)
- PowerShell (or PowerShell Core)
Ensure that you have configured PowerShell to be able to run local unsigned scripts (either by running
Set-ExecutionPolicy RemoteSigned
from within PowerShell, or by launching PowerShell with the
-ExecutionPolicy RemoteSigned
command line switch).
-
Linux users: Open a terminal to your favorite shell.
Windows users: Open PowerShell (or PowerShell Core).
-
From the root folder of the source repo, this command will build the code and run all tests:
./build
To build a specific target (or multiple targets):
./build [target [target...]]
The common targets (case-insensitive) include:
Restore
: Perform package restoreBuild
: Build the sourceTest
: Run all unit testsTestCore
: Run all unit tests (.NET Core)TestFx
: Run all unit tests (.NET Framework)Packages
: Create NuGet packages
You can get a list of options:
./build --help