diff options
author | Bruce Forstall <brucefo@microsoft.com> | 2018-08-07 14:58:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-07 14:58:12 -0700 |
commit | 01908e9fe3b5a3c51935e1f6622ef4bf10b805c3 (patch) | |
tree | d2dba60b101eeedaea2f9417dcbf90da99422708 /tests/runtest.proj | |
parent | 525b5e1f990a37c16f4db797e6a5e20419f4059a (diff) | |
download | coreclr-01908e9fe3b5a3c51935e1f6622ef4bf10b805c3.tar.gz coreclr-01908e9fe3b5a3c51935e1f6622ef4bf10b805c3.tar.bz2 coreclr-01908e9fe3b5a3c51935e1f6622ef4bf10b805c3.zip |
Add basic check that the correct number of tests is built (#19290)
Fixes #19286
Diffstat (limited to 'tests/runtest.proj')
-rw-r--r-- | tests/runtest.proj | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/runtest.proj b/tests/runtest.proj index 3d12bd32fb..52eeaaf1e5 100644 --- a/tests/runtest.proj +++ b/tests/runtest.proj @@ -27,7 +27,7 @@ <Target Name="FindCmdDirectories" DependsOnTargets="GetListOfTestCmds"> <Error Condition="!Exists('$(XunitTestBinBase)')" - Text="$(XunitTestBinBase) does not exist. Please run buildtest.cmd from the (repo root)\tests at least once to get the tests built." /> + Text="$(XunitTestBinBase) does not exist. Please run build-test.cmd from the repo root at least once to get the tests built." /> <ItemGroup> @@ -54,6 +54,29 @@ </Target> + <!-- Target to check the test build, to see if it looks ok. We've had several cases where a change inadvertently and drastically changes + the set of tests that are built, and that change is unnoticed. The most common case is for a build of the Priority 1 tests + to only build the Priority 0 tests. This target is run after a test build to verify that the basic number of tests that were + built is basically what was expected. When this was written, there were about 2500 Priority 0 tests and about 12270 Priority 1 + tests (differing slightly based on platform). We currently check that the number of Priority 0 tests is greater than 2000 and + less than 3000, and the number of Priority 1 tests is greater than 12000. + --> + <Target Name="CheckTestBuild" DependsOnTargets="GetListOfTestCmds"> + <Error Condition="!Exists('$(XunitTestBinBase)')" + Text="$(XunitTestBinBase) does not exist. Please run build-test.cmd from the repo root at least once to get the tests built." /> + + <PropertyGroup> + <TestCount>@(AllRunnableTestPaths->Count())</TestCount> + </PropertyGroup> + + <Message Text="Found $(TestCount) built tests"/> + + <Error Condition="'$(CLRTestPriorityToBuild)' == '0' and '$(TestCount)' <= 2000" Text="Unexpected test count. Expected > 2000, found $(TestCount).'" /> + <Error Condition="'$(CLRTestPriorityToBuild)' == '0' and '$(TestCount)' >= 3000" Text="Unexpected test count. Expected < 3000, found $(TestCount).'" /> + <Error Condition="'$(CLRTestPriorityToBuild)' == '1' and '$(TestCount)' <= 12000" Text="Unexpected test count. Expected > 12000, found $(TestCount).'" /> + <Error Condition="'$(CLRTestPriorityToBuild)' != '0' and '$(CLRTestPriorityToBuild)' != '1'" Text="Unknown priority $(CLRTestPriorityToBuild)" /> + </Target> + <Import Project="$(__Exclude)" Condition="'$(__Exclude)' != '' AND '$(XunitTestBinBase)' != ''" /> <PropertyGroup> <HaveExcludes>False</HaveExcludes> |