Build CoreCLR on Unix.
DotNet is required to build the tests, this can be done on any platform then copied over if the arch or os does not support DotNet. If DotNet is not supported, CoreFX is also required to be built.
To build the tests on Unix:
./build-test.sh
Please note that this builds the Priority 0 tests. To build priority 1:
build-test.sh -priority 1
During development there are many instances where building an individual test is fast and necessary. All of the necessary tools to build are under coreclr
. It is possible to use coreclr/.dotnet/dotnet msbuild
as you would normally use MSBuild with a few caveats.
!! Note !! -- Passing /p:__BuildOs=[OSX|Linux] is required.
/path/to/coreclr/.dotnet/dotnet msbuild tests/src/path-to-proj-file /p:__BuildOS=<BuildOS> /p:__BuildType=<BuildType>
The following instructions assume that on the Unix machine:
- The CoreCLR repo is cloned at
/mnt/coreclr
build-test.sh will have setup the Core_Root directory correctly after the test build.
~/coreclr$ tests/runtest.sh x64 checked
Please use the following command for help.
./tests/runtest.sh -h
Test results will go into:
~/test/Windows_NT.x64.Debug/coreclrtests.xml
Unsupported tests outside of Windows have two annotations in their csproj to ignore them when run.
<TestUnsupportedOutsideWindows>true</TestUnsupportedOutsideWindows>
This will write in the bash target to skip the test by returning a passing value if run outside Windows.
In addition:
<DisableProjectBuild Condition="'$(TargetsUnix)' == 'true'">true</DisableProjectBuild>
Is used to disable the build, that way if building on Unix cycles are saved building/running.
Build CoreCLR on the Unix machine.
Run tests:
~/coreclr$ src/pal/tests/palsuite/runpaltests.sh ~/coreclr/bin/obj/Linux.x64.Debug
Test results will go into:
/tmp/PalTestOutput/default/pal_tests.xml