Skip to content

Commit 84e1fd4

Browse files
committed
CI: add support to skip testing selectively on full builds
This adds the ability to selectively skip the tests for various pieces (e.g. foundation or xctest) to give us better control for CI for some projects.
1 parent 050f3e2 commit 84e1fd4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

utils/build-windows-toolchain.bat

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,14 +709,25 @@ move %PackageRoot%\installer\installer.exe %BuildRoot%\artifacts || (exit /b)
709709

710710
:: TODO(compnerd) test LLVM
711711

712+
SET SKIP_TEST=0
713+
FOR %%T IN (%SKIP_TESTS%) DO (IF /I %%T==swift SET SKIP_TEST=1)
714+
IF "%SKIP_TEST%"=="1" (
712715
:: Test Swift
713716
:: TODO(compnerd) make lit adjust the path properly
714717
path %BuildRoot%\3;%BuildRoot%\1\bin;%PATH%;%SystemDrive%\Program Files\Git\usr\bin
715718
cmake --build %BuildRoot%\1 --target check-swift || (exit /b)
719+
)
716720

721+
SET SKIP_TEST=0
722+
FOR %%T IN (%SKIP_TESTS%) DO (IF /I %T==dispatch SET SKIP_TEST=1)
723+
IF "%SKIP_TEST%"=="1"(
717724
:: Test dispatch
718725
cmake --build %BuildRoot%\3 --target ExperimentalTest || (exit /b)
726+
)
719727

728+
SET SKIP_TEST=0
729+
FOR %%T IN (%SKIP_TESTS%) DO (IF /I %T==foundation SET SKIP_TEST=1)
730+
IF "%SKIP_TEST%"=="1" (
720731
:: NOTE(compnerd) update the path *before* the build because the tests are
721732
:: executed to shard the test suite.
722733
path %BuildRoot%\5;%BuildRoot%\4\bin;%PATH%
@@ -759,7 +770,11 @@ cmake --build %BuildRoot%\4 || (exit /b)
759770
:: Test Foundation
760771
set CTEST_OUTPUT_ON_FAILURE=1
761772
cmake --build %BuildRoot%\4 --target test || (exit /b)
773+
)
762774

775+
SET SKIP_TEST=0
776+
FOR %%T IN (%SKIP_TESTS%) DO (IF /I %T==xctest SET SKIP_TEST=1)
777+
IF "%SKIP_TEST%"=="1" (
763778
:: Rebuild XCTest (w/ testing)
764779
cmake ^
765780
-B %BuildRoot%\5 ^
@@ -790,6 +805,7 @@ cmake --build %BuildRoot%\5 || (exit /b)
790805

791806
:: Test XCTest
792807
cmake --build %BuildRoot%\5 --target check-xctest || (exit /b)
808+
)
793809

794810
:: Clean up the module cache
795811
rd /s /q %LocalAppData%\clang\ModuleCache

0 commit comments

Comments
 (0)