Skip to content

Commit f62037c

Browse files
authored
Merge pull request #59060 from compnerd/skipping
CI: add support to skip testing selectively on full builds
2 parents 6390fcb + 49ac2f9 commit f62037c

File tree

1 file changed

+93
-49
lines changed

1 file changed

+93
-49
lines changed

utils/build-windows-toolchain.bat

Lines changed: 93 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -709,17 +709,99 @@ 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%"=="0" call :TestSwift
715+
716+
SET SKIP_TEST=0
717+
FOR %%T IN (%SKIP_TESTS%) DO (IF /I %T==dispatch SET SKIP_TEST=1)
718+
IF "%SKIP_TEST%"=="0" call :TestDispatch
719+
720+
SET SKIP_TEST=0
721+
FOR %%T IN (%SKIP_TESTS%) DO (IF /I %T==foundation SET SKIP_TEST=1)
722+
IF "%SKIP_TEST%"=="0" call :TestFoundation
723+
724+
SET SKIP_TEST=0
725+
FOR %%T IN (%SKIP_TESTS%) DO (IF /I %T==xctest SET SKIP_TEST=1)
726+
IF "%SKIP_TEST%"=="0" call :TestXCTest
727+
728+
:: Clean up the module cache
729+
rd /s /q %LocalAppData%\clang\ModuleCache
730+
731+
goto :end
732+
endlocal
733+
734+
:CloneRepositories
735+
setlocal enableextensions enabledelayedexpansion
736+
737+
if defined SKIP_UPDATE_CHECKOUT goto :eof
738+
739+
if defined REPO_SCHEME set "args=--scheme %REPO_SCHEME%"
740+
741+
:: Always enable symbolic links
742+
git config --global core.symlink true
743+
744+
:: Ensure that we have the files in the original line endings, the swift tests
745+
:: depend on this being the case.
746+
git -C "%SourceRoot%\swift" config --local core.autocrlf input
747+
git -C "%SourceRoot%\swift" checkout-index --force --all
748+
749+
set "args=%args% --skip-repository swift"
750+
set "args=%args% --skip-repository ninja"
751+
set "args=%args% --skip-repository icu"
752+
set "args=%args% --skip-repository swift-integration-tests"
753+
set "args=%args% --skip-repository swift-stress-tester"
754+
set "args=%args% --skip-repository swift-xcode-playground-support"
755+
756+
call "%SourceRoot%\swift\utils\update-checkout.cmd" %args% --clone --skip-history --github-comment "%ghprbCommentBody%"
757+
758+
goto :eof
759+
endlocal
760+
761+
:CloneDependencies
762+
setlocal enableextensions enabledelayedexpansion
763+
764+
:: Always enable symbolic links
765+
git config --global core.symlink true
766+
767+
:: FIXME(compnerd) avoid the fresh clone
768+
rd /s /q zlib libxml2 sqlite icu curl
769+
770+
git clone --quiet --no-tags --depth 1 --branch v1.2.11 https://github.com/madler/zlib
771+
git clone --quiet --no-tags --depth 1 --branch v2.9.12 https://github.com/gnome/libxml2
772+
git clone --quiet --no-tags --depth 1 --branch version-3.36.0 https://github.com/sqlite/sqlite
773+
git clone --quiet --no-tags --depth 1 --branch maint/maint-69 https://github.com/unicode-org/icu
774+
git clone --quiet --no-tags --depth 1 --branch curl-7_77_0 https://github.com/curl/curl
775+
776+
goto :eof
777+
endlocal
778+
779+
:TestSwift
780+
setlocal enableextensions enabledelayedexpansion
781+
712782
:: Test Swift
713783
:: TODO(compnerd) make lit adjust the path properly
714784
path %BuildRoot%\3;%BuildRoot%\1\bin;%PATH%;%SystemDrive%\Program Files\Git\usr\bin
715785
cmake --build %BuildRoot%\1 --target check-swift || (exit /b)
716786

787+
goto :eof
788+
endlocal
789+
790+
:TestDispatch
791+
setlocal enableextensions enabledelayedexpansion
792+
717793
:: Test dispatch
718794
cmake --build %BuildRoot%\3 --target ExperimentalTest || (exit /b)
719795

796+
goto :eof
797+
endlocal
798+
799+
:TestFoundation
800+
setlocal enableextensions enabledelayedexpansion
801+
720802
:: NOTE(compnerd) update the path *before* the build because the tests are
721803
:: executed to shard the test suite.
722-
path %BuildRoot%\5;%BuildRoot%\4\bin;%PATH%
804+
path %BuildRoot%\5;%BuildRoot%\4\bin;%BuildRoot%\3;%BuildRoot%\1\bin;%PATH%;%SystemDrive%\Program Files\Git\usr\bin
723805

724806
:: Rebuild Foundation (w/ testing)
725807
cmake ^
@@ -760,6 +842,16 @@ cmake --build %BuildRoot%\4 || (exit /b)
760842
set CTEST_OUTPUT_ON_FAILURE=1
761843
cmake --build %BuildRoot%\4 --target test || (exit /b)
762844

845+
goto :eof
846+
endlocal
847+
848+
:TestXCTest
849+
setlocal enableextensions enabledelayedexpansion
850+
851+
:: NOTE(compnerd) update the path *before* the build because the tests are
852+
:: executed to shard the test suite.
853+
path %BuildRoot%\5;%BuildRoot%\4\bin;%BuildRoot%\3;%BuildRoot%\1\bin;%PATH%;%SystemDrive%\Program Files\Git\usr\bin
854+
763855
:: Rebuild XCTest (w/ testing)
764856
cmake ^
765857
-B %BuildRoot%\5 ^
@@ -791,54 +883,6 @@ cmake --build %BuildRoot%\5 || (exit /b)
791883
:: Test XCTest
792884
cmake --build %BuildRoot%\5 --target check-xctest || (exit /b)
793885

794-
:: Clean up the module cache
795-
rd /s /q %LocalAppData%\clang\ModuleCache
796-
797-
goto :end
798-
endlocal
799-
800-
:CloneRepositories
801-
setlocal enableextensions enabledelayedexpansion
802-
803-
if defined SKIP_UPDATE_CHECKOUT goto :eof
804-
805-
if defined REPO_SCHEME set "args=--scheme %REPO_SCHEME%"
806-
807-
:: Always enable symbolic links
808-
git config --global core.symlink true
809-
810-
:: Ensure that we have the files in the original line endings, the swift tests
811-
:: depend on this being the case.
812-
git -C "%SourceRoot%\swift" config --local core.autocrlf input
813-
git -C "%SourceRoot%\swift" checkout-index --force --all
814-
815-
set "args=%args% --skip-repository swift"
816-
set "args=%args% --skip-repository ninja"
817-
set "args=%args% --skip-repository icu"
818-
set "args=%args% --skip-repository swift-integration-tests"
819-
set "args=%args% --skip-repository swift-stress-tester"
820-
set "args=%args% --skip-repository swift-xcode-playground-support"
821-
822-
call "%SourceRoot%\swift\utils\update-checkout.cmd" %args% --clone --skip-history --github-comment "%ghprbCommentBody%"
823-
824-
goto :eof
825-
endlocal
826-
827-
:CloneDependencies
828-
setlocal enableextensions enabledelayedexpansion
829-
830-
:: Always enable symbolic links
831-
git config --global core.symlink true
832-
833-
:: FIXME(compnerd) avoid the fresh clone
834-
rd /s /q zlib libxml2 sqlite icu curl
835-
836-
git clone --quiet --no-tags --depth 1 --branch v1.2.11 https://github.com/madler/zlib
837-
git clone --quiet --no-tags --depth 1 --branch v2.9.12 https://github.com/gnome/libxml2
838-
git clone --quiet --no-tags --depth 1 --branch version-3.36.0 https://github.com/sqlite/sqlite
839-
git clone --quiet --no-tags --depth 1 --branch maint/maint-69 https://github.com/unicode-org/icu
840-
git clone --quiet --no-tags --depth 1 --branch curl-7_77_0 https://github.com/curl/curl
841-
842886
goto :eof
843887
endlocal
844888

0 commit comments

Comments
 (0)