Skip to content

Commit d9d53b4

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 d9d53b4

File tree

1 file changed

+97
-81
lines changed

1 file changed

+97
-81
lines changed

utils/build-windows-toolchain.bat

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

710710
:: TODO(compnerd) test LLVM
711711

712-
:: Test Swift
713-
:: TODO(compnerd) make lit adjust the path properly
714-
path %BuildRoot%\3;%BuildRoot%\1\bin;%PATH%;%SystemDrive%\Program Files\Git\usr\bin
715-
cmake --build %BuildRoot%\1 --target check-swift || (exit /b)
716-
717-
:: Test dispatch
718-
cmake --build %BuildRoot%\3 --target ExperimentalTest || (exit /b)
719-
720-
:: NOTE(compnerd) update the path *before* the build because the tests are
721-
:: executed to shard the test suite.
722-
path %BuildRoot%\5;%BuildRoot%\4\bin;%PATH%
723-
724-
:: Rebuild Foundation (w/ testing)
725-
cmake ^
726-
-B %BuildRoot%\4 ^
727-
728-
-D CMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% ^
729-
-D CMAKE_C_COMPILER=%BuildRoot%/1/bin/clang-cl.exe ^
730-
-D CMAKE_C_FLAGS="/GS- /Oy /Gw /Gy" ^
731-
-D CMAKE_CXX_COMPILER=%BuildRoot%/1/bin/clang-cl.exe ^
732-
-D CMAKE_CXX_FLAGS="/GS- /Oy /Gw /Gy" ^
733-
-D CMAKE_MT=mt ^
734-
-D CMAKE_Swift_COMPILER=%BuildRoot%/1/bin/swiftc.exe ^
735-
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
736-
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^
737-
738-
-D CMAKE_INSTALL_PREFIX=%SDKInstallRoot%\usr ^
739-
740-
-D CURL_DIR=%BuildRoot%\Library\curl-7.77.0\usr\lib\cmake\CURL ^
741-
-D ICU_ROOT=%BuildRoot%\Library\icu-69.1\usr ^
742-
-D ICU_DATA_LIBRARY_RELEASE=%BuildRoot%\Library\icu-69.1\usr\lib\sicudt69.lib ^
743-
-D ICU_I18N_LIBRARY_RELEASE=%BuildRoot%\Library\icu-69.1\usr\lib\sicuin69.lib ^
744-
-D ICU_UC_LIBRARY_RELEASE=%BuildRoot%\Library\icu-69.1\usr\lib\sicuuc69.lib ^
745-
-D LIBXML2_LIBRARY=%BuildRoot%\Library\libxml2-2.9.12\usr\lib\libxml2s.lib ^
746-
-D LIBXML2_INCLUDE_DIR=%BuildRoot%\Library\libxml2-2.9.12\usr\include\libxml2 ^
747-
-D LIBXML2_DEFINITIONS="/DLIBXML_STATIC" ^
748-
-D ZLIB_LIBRARY=%BuildRoot%\Library\zlib-1.2.11\usr\lib\zlibstatic.lib ^
749-
-D ZLIB_INCLUDE_DIR=%BuildRoot%\Library\zlib-1.2.11\usr\include ^
750-
-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
751-
-D XCTest_DIR=%BuildRoot%\5\cmake\modules ^
752-
753-
-D ENABLE_TESTING=YES ^
754-
755-
-G Ninja ^
756-
-S %SourceRoot%\swift-corelibs-foundation || (exit /b)
757-
cmake --build %BuildRoot%\4 || (exit /b)
758-
759-
:: Test Foundation
760-
set CTEST_OUTPUT_ON_FAILURE=1
761-
cmake --build %BuildRoot%\4 --target test || (exit /b)
762-
763-
:: Rebuild XCTest (w/ testing)
764-
cmake ^
765-
-B %BuildRoot%\5 ^
766-
767-
-D CMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% ^
768-
-D CMAKE_C_COMPILER=%BuildRoot%/1/bin/clang-cl.exe ^
769-
-D CMAKE_C_FLAGS="/GS- /Oy /Gw /Gy" ^
770-
-D CMAKE_CXX_COMPILER=%BuildRoot%/1/bin/clang-cl.exe ^
771-
-D CMAKE_CXX_FLAGS="/GS- /Oy /Gw /Gy" ^
772-
-D CMAKE_MT=mt ^
773-
-D CMAKE_Swift_COMPILER=%BuildRoot%/1/bin/swiftc.exe ^
774-
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
775-
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^
776-
777-
-D CMAKE_INSTALL_PREFIX=%PlatformRoot%\Developer\Library\XCTest-development\usr ^
778-
779-
-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
780-
-D Foundation_DIR=%BuildRoot%\4\cmake\modules ^
781-
782-
-D ENABLE_TESTING=YES ^
783-
-D XCTEST_PATH_TO_LIBDISPATCH_BUILD=%BuildRoot%\3 ^
784-
-D XCTEST_PATH_TO_LIBDISPATCH_SOURCE=%SourceRoot%\swift-corelibs-libdispatch ^
785-
-D XCTEST_PATH_TO_FOUNDATION_BUILD=%BuildRoot%\4 ^
786-
787-
-G Ninja ^
788-
-S %SourceRoot%\swift-corelibs-xctest || (exit /b)
789-
cmake --build %BuildRoot%\5 || (exit /b)
790-
791-
:: Test XCTest
792-
cmake --build %BuildRoot%\5 --target check-xctest || (exit /b)
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" (
715+
:: Test Swift
716+
:: TODO make lit adjust the path properly
717+
path %BuildRoot%\3;%BuildRoot%\1\bin;%PATH%;%SystemDrive%\Program Files\Git\usr\bin
718+
cmake --build %BuildRoot%\1 --target check-swift || (exit /b)
719+
)
720+
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"(
724+
:: Test dispatch
725+
cmake --build %BuildRoot%\3 --target ExperimentalTest || (exit /b)
726+
)
727+
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" (
731+
:: NOTE(compnerd) update the path *before* the build because the tests are
732+
:: executed to shard the test suite.
733+
path %BuildRoot%\5;%BuildRoot%\4\bin;%PATH%
734+
735+
:: Rebuild Foundation (w/ testing)
736+
cmake ^
737+
-B %BuildRoot%\4 ^
738+
739+
-D CMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% ^
740+
-D CMAKE_C_COMPILER=%BuildRoot%/1/bin/clang-cl.exe ^
741+
-D CMAKE_C_FLAGS="/GS- /Oy /Gw /Gy" ^
742+
-D CMAKE_CXX_COMPILER=%BuildRoot%/1/bin/clang-cl.exe ^
743+
-D CMAKE_CXX_FLAGS="/GS- /Oy /Gw /Gy" ^
744+
-D CMAKE_MT=mt ^
745+
-D CMAKE_Swift_COMPILER=%BuildRoot%/1/bin/swiftc.exe ^
746+
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
747+
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^
748+
749+
-D CMAKE_INSTALL_PREFIX=%SDKInstallRoot%\usr ^
750+
751+
-D CURL_DIR=%BuildRoot%\Library\curl-7.77.0\usr\lib\cmake\CURL ^
752+
-D ICU_ROOT=%BuildRoot%\Library\icu-69.1\usr ^
753+
-D ICU_DATA_LIBRARY_RELEASE=%BuildRoot%\Library\icu-69.1\usr\lib\sicudt69.lib ^
754+
-D ICU_I18N_LIBRARY_RELEASE=%BuildRoot%\Library\icu-69.1\usr\lib\sicuin69.lib ^
755+
-D ICU_UC_LIBRARY_RELEASE=%BuildRoot%\Library\icu-69.1\usr\lib\sicuuc69.lib ^
756+
-D LIBXML2_LIBRARY=%BuildRoot%\Library\libxml2-2.9.12\usr\lib\libxml2s.lib ^
757+
-D LIBXML2_INCLUDE_DIR=%BuildRoot%\Library\libxml2-2.9.12\usr\include\libxml2 ^
758+
-D LIBXML2_DEFINITIONS="/DLIBXML_STATIC" ^
759+
-D ZLIB_LIBRARY=%BuildRoot%\Library\zlib-1.2.11\usr\lib\zlibstatic.lib ^
760+
-D ZLIB_INCLUDE_DIR=%BuildRoot%\Library\zlib-1.2.11\usr\include ^
761+
-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
762+
-D XCTest_DIR=%BuildRoot%\5\cmake\modules ^
763+
764+
-D ENABLE_TESTING=YES ^
765+
766+
-G Ninja ^
767+
-S %SourceRoot%\swift-corelibs-foundation || (exit /b)
768+
cmake --build %BuildRoot%\4 || (exit /b)
769+
770+
:: Test Foundation
771+
set CTEST_OUTPUT_ON_FAILURE=1
772+
cmake --build %BuildRoot%\4 --target test || (exit /b)
773+
)
774+
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" (
778+
:: Rebuild XCTest (w/ testing)
779+
cmake ^
780+
-B %BuildRoot%\5 ^
781+
782+
-D CMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% ^
783+
-D CMAKE_C_COMPILER=%BuildRoot%/1/bin/clang-cl.exe ^
784+
-D CMAKE_C_FLAGS="/GS- /Oy /Gw /Gy" ^
785+
-D CMAKE_CXX_COMPILER=%BuildRoot%/1/bin/clang-cl.exe ^
786+
-D CMAKE_CXX_FLAGS="/GS- /Oy /Gw /Gy" ^
787+
-D CMAKE_MT=mt ^
788+
-D CMAKE_Swift_COMPILER=%BuildRoot%/1/bin/swiftc.exe ^
789+
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
790+
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^
791+
792+
-D CMAKE_INSTALL_PREFIX=%PlatformRoot%\Developer\Library\XCTest-development\usr ^
793+
794+
-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
795+
-D Foundation_DIR=%BuildRoot%\4\cmake\modules ^
796+
797+
-D ENABLE_TESTING=YES ^
798+
-D XCTEST_PATH_TO_LIBDISPATCH_BUILD=%BuildRoot%\3 ^
799+
-D XCTEST_PATH_TO_LIBDISPATCH_SOURCE=%SourceRoot%\swift-corelibs-libdispatch ^
800+
-D XCTEST_PATH_TO_FOUNDATION_BUILD=%BuildRoot%\4 ^
801+
802+
-G Ninja ^
803+
-S %SourceRoot%\swift-corelibs-xctest || (exit /b)
804+
cmake --build %BuildRoot%\5 || (exit /b)
805+
806+
:: Test XCTest
807+
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)