Build CoreCLR on Unix.
Dotnet CLI is required to build the tests. This can be done on any platform then copied over if the architecture or OS does not support Dotnet.
To build the tests on Unix:
./src/tests/build.sh
Please note that this builds the Priority 0 tests. To build priority 1:
./src/tests/build.sh -priority1
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 ~/runtime/dotnet.sh msbuild
as you would normally use MSBuild with a few caveats.
!! Note !! -- Passing /p:TargetOS=[OSX|Linux] is required.
./dotnet.sh msbuild src/coreclr/tests/src/path-to-proj-file /p:TargetOS=<TargetOS> /p:Configuration=<BuildType>
The following instructions assume that on the Unix machine:
- The CoreCLR repo is cloned at
/mnt/coreclr
src/tests/build.sh
will have set up the Core_Root
directory correctly after the test build.
./src/tests/run.sh x64 checked
Please use the following command for help.
./src/tests/run.sh -h
To support building all tests for all targets on single target, we use the conditional property
<CLRTestTargetUnsupported Condition="...">true</CLRTestTargetUnsupported>
This property disables building of a test in a default build. It also
disables running a test in the bash/batch wrapper scripts. It allows the
test to be built on any target in CI when the allTargets
option is
passed to the build.*
scripts.
Tests which never should be built or run are marked
<DisableProjectBuild>true</DisableProjectBuild>
This propoerty should not be conditioned on Target properties to allow
all tests to be built for allTargets
.
Build CoreCLR with PAL tests on the Unix machine:
./build.sh clr.paltests
Run tests:
To run all tests including disabled tests
./src/coreclr/src/pal/tests/palsuite/runpaltests.sh $(pwd)/artifacts/bin/coreclr/$(uname).x64.Debug/paltests
# on macOS, replace $(uname) with OSX
To only run enabled tests for the platform the tests were built for:
artifacts/bin/coreclr/$(uname).x64.Debug/paltests/runpaltests.sh $(pwd)/artifacts/bin/coreclr/$(uname).x64.Debug/paltests
# on macOS, replace $(uname) with OSX
Test results will go into: /tmp/PalTestOutput/default/pal_tests.xml
To disable tests in the CI edit
src/coreclr/src/pal/tests/palsuite/issues.targets