Skip to content

Commit 39f3616

Browse files
committed
utils: add support to run the Windows toolchain tests
1 parent cafa252 commit 39f3616

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed

utils/build-windows-toolchain.bat

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ cmake ^
294294
-D ZLIB_INCLUDE_DIR=%BuildRoot%\Library\zlib-1.2.11\usr\include ^
295295
-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
296296

297+
-D ENABLE_TESTING=NO ^
298+
297299
-G Ninja ^
298300
-S %SourceRoot%\swift-corelibs-foundation || (exit /b)
299301
cmake --build %BuildRoot%\4 || (exit /b)
@@ -318,6 +320,8 @@ cmake ^
318320
-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
319321
-D Foundation_DIR=%BuildRoot%\4\cmake\modules ^
320322

323+
-D ENABLE_TESTING=NO ^
324+
321325
-G Ninja ^
322326
-S %SourceRoot%\swift-corelibs-xctest || (exit /b)
323327
cmake --build %BuildRoot%\5 || (exit /b)
@@ -662,6 +666,89 @@ msbuild %SourceRoot%\swift-installer-scripts\platforms\Windows\installer.wixproj
662666
:: TODO(compnerd) actually perform the code-signing
663667
:: signtool sign /f Apple_CodeSign.pfx /p Apple_CodeSign_Password /tr http://timestamp.digicert.com /fd sha256 %PackageRoot%\installer\installer.exe
664668

669+
:: TODO(compnerd) test LLVM
670+
671+
:: Test Swift
672+
:: TODO(compnerd) make lit adjust the path properly
673+
path %BuildRoot%\3;%BuildRoot%\1\bin;%BuildRoot%\Library\icu-67.1\usr\bin;%PATH%;%SystemDrive%\Program Files\Git\usr\bin
674+
cmake --build %BuildRoot%\1 --target check-swift || (exit /b)
675+
676+
:: Test dispatch
677+
cmake --build %BuildRoot%\3 --target ExperimentalTest || (exit /b)
678+
679+
:: NOTE(compnerd) update the path *before* the build because the tests are
680+
:: executed to shard the test suite.
681+
path %BuildRoot%\5;%BuildRoot%\4\bin;%PATH%
682+
683+
:: Rebuild Foundation (w/ testing)
684+
cmake ^
685+
-B %BuildRoot%\4 ^
686+
687+
-D CMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% ^
688+
-D CMAKE_C_COMPILER=%BuildRoot%/1/bin/clang-cl.exe ^
689+
-D CMAKE_C_FLAGS="/GS- /Oy /Gw /Gy" ^
690+
-D CMAKE_CXX_COMPILER=%BuildRoot%/1/bin/clang-cl.exe ^
691+
-D CMAKE_CXX_FLAGS="/GS- /Oy /Gw /Gy" ^
692+
-D CMAKE_MT=mt ^
693+
-D CMAKE_Swift_COMPILER=%BuildRoot%/1/bin/swiftc.exe ^
694+
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
695+
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^
696+
697+
-D CMAKE_INSTALL_PREFIX=%SDKInstallRoot%\usr ^
698+
699+
-D CURL_DIR=%BuildRoot%\Library\curl-7.77.0\usr\lib\cmake\CURL ^
700+
-D ICU_ROOT=%BuildRoot%\Library\icu-67.1 ^
701+
-D ICU_UC_LIBRARY=%BuildRoot%\Library\icu-67.1\lib64\icuuc67.lib ^
702+
-D ICU_I18N_LIBRARY=%BuildRoot%\Library\icu-67.1\lib64\icuin67.lib ^
703+
-D LIBXML2_LIBRARY=%BuildRoot%\Library\libxml2-2.9.12\usr\lib\libxml2s.lib ^
704+
-D LIBXML2_INCLUDE_DIR=%BuildRoot%\Library\libxml2-2.9.12\usr\include\libxml2 ^
705+
-D LIBXML2_DEFINITIONS="/DLIBXML_STATIC" ^
706+
-D ZLIB_LIBRARY=%BuildRoot%\Library\zlib-1.2.11\usr\lib\zlibstatic.lib ^
707+
-D ZLIB_INCLUDE_DIR=%BuildRoot%\Library\zlib-1.2.11\usr\include ^
708+
-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
709+
-D XCTest_DIR=%BuildRoot%\5\cmake\modules ^
710+
711+
-D ENABLE_TESTING=YES ^
712+
713+
-G Ninja ^
714+
-S %SourceRoot%\swift-corelibs-foundation || (exit /b)
715+
cmake --build %BuildRoot%\4 || (exit /b)
716+
717+
:: Test Foundation
718+
set CTEST_OUTPUT_ON_FAILURE=1
719+
cmake --build %BuildRoot%\4 --target test || (exit /b)
720+
721+
:: Rebuild XCTest (w/ testing)
722+
cmake ^
723+
-B %BuildRoot%\5 ^
724+
725+
-D CMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% ^
726+
-D CMAKE_C_COMPILER=%BuildRoot%/1/bin/clang-cl.exe ^
727+
-D CMAKE_C_FLAGS="/GS- /Oy /Gw /Gy" ^
728+
-D CMAKE_CXX_COMPILER=%BuildRoot%/1/bin/clang-cl.exe ^
729+
-D CMAKE_CXX_FLAGS="/GS- /Oy /Gw /Gy" ^
730+
-D CMAKE_MT=mt ^
731+
-D CMAKE_Swift_COMPILER=%BuildRoot%/1/bin/swiftc.exe ^
732+
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
733+
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^
734+
735+
-D CMAKE_INSTALL_PREFIX=%PlatformRoot%\Developer\Library\XCTest-development\usr ^
736+
737+
-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
738+
-D Foundation_DIR=%BuildRoot%\4\cmake\modules ^
739+
740+
-D ENABLE_TESTING=YES ^
741+
-D XCTEST_PATH_TO_LIBDISPATCH_BUILD=%BuildRoot%\3 ^
742+
-D XCTEST_PATH_TO_LIBDISPATCH_SOURCE=%SourceRoot%\swift-corelibs-libdispatch ^
743+
-D XCTEST_PATH_TO_FOUNDATION_BUILD=%BuildRoot%\4 ^
744+
745+
-G Ninja ^
746+
-S %SourceRoot%\swift-corelibs-xctest || (exit /b)
747+
cmake --build %BuildRoot%\5 || (exit /b)
748+
749+
:: Test XCTest
750+
cmake --build %BuildRoot%\5 --target check-xctest || (exit /b)
751+
665752
:: Clean up the module cache
666753
rd /s /q %LocalAppData%\clang\ModuleCache
667754

0 commit comments

Comments
 (0)