From 5504dfa7da38a65981868fc7885744ac5d8f234e Mon Sep 17 00:00:00 2001 From: Billy O'Neal Date: Thu, 14 May 2020 12:49:31 -0700 Subject: [vcpkg] Turn on tests and PREfast in CI, and fix tests to pass. (#11239) Co-authored-by: nicole mazzuca --- scripts/azure-pipelines/azure-pipelines.yml | 4 ++++ scripts/azure-pipelines/linux/azure-pipelines.yml | 3 +++ scripts/azure-pipelines/osx/azure-pipelines.yml | 4 +++- scripts/azure-pipelines/windows/run-tests.yml | 25 +++++++++++++++++++++++ scripts/bootstrap.sh | 5 ++++- 5 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 scripts/azure-pipelines/windows/run-tests.yml (limited to 'scripts') diff --git a/scripts/azure-pipelines/azure-pipelines.yml b/scripts/azure-pipelines/azure-pipelines.yml index a0d9f3953..f97a3a01e 100644 --- a/scripts/azure-pipelines/azure-pipelines.yml +++ b/scripts/azure-pipelines/azure-pipelines.yml @@ -6,6 +6,10 @@ variables: linux-pool: 'PrLin-2020-05-07' jobs: + - template: windows/run-tests.yml + parameters: + poolName: $(windows-pool) + - template: windows/azure-pipelines.yml parameters: triplet: x86-windows diff --git a/scripts/azure-pipelines/linux/azure-pipelines.yml b/scripts/azure-pipelines/linux/azure-pipelines.yml index 58e82efef..7120a9323 100644 --- a/scripts/azure-pipelines/linux/azure-pipelines.yml +++ b/scripts/azure-pipelines/linux/azure-pipelines.yml @@ -24,6 +24,9 @@ jobs: displayName: 'Build vcpkg' inputs: filePath: bootstrap-vcpkg.sh + arguments: "-buildTests" + - bash: toolsrc/build.rel/vcpkg-test + displayName: 'Run vcpkg tests' - powershell: | $skipList = ./scripts/azure-pipelines/generate-skip-list.ps1 -Triplet "x64-linux" -BaselineFile "$(System.DefaultWorkingDirectory)/scripts/ci.baseline.txt" mkdir $(System.ArtifactsDirectory)/xml-results diff --git a/scripts/azure-pipelines/osx/azure-pipelines.yml b/scripts/azure-pipelines/osx/azure-pipelines.yml index 912339dfd..2427a899e 100644 --- a/scripts/azure-pipelines/osx/azure-pipelines.yml +++ b/scripts/azure-pipelines/osx/azure-pipelines.yml @@ -30,7 +30,9 @@ jobs: displayName: 'Build vcpkg' inputs: filePath: bootstrap-vcpkg.sh - arguments: '-allowAppleClang' + arguments: '-buildTests' + - bash: toolsrc/build.rel/vcpkg-test + displayName: 'Run vcpkg tests' - powershell: | $skip_list = ./scripts/azure-pipelines/generate-skip-list.ps1 -Triplet "x64-osx" -BaselineFile "$(System.DefaultWorkingDirectory)/scripts/ci.baseline.txt" mkdir $(System.ArtifactsDirectory)/xml-results diff --git a/scripts/azure-pipelines/windows/run-tests.yml b/scripts/azure-pipelines/windows/run-tests.yml new file mode 100644 index 000000000..e6c27f70d --- /dev/null +++ b/scripts/azure-pipelines/windows/run-tests.yml @@ -0,0 +1,25 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# +# Builds and runs vcpkg-test.exe for PRs and CIs. + +jobs: +- job: windows_tests + pool: + name: ${{ parameters.poolName }} + steps: + - task: CmdLine@2 + displayName: "Build and Test vcpkg" + inputs: + script: | + :: TRANSITION, get these tools on the VMs next time we roll them + call .\bootstrap-vcpkg.bat + .\vcpkg.exe fetch cmake + .\vcpkg.exe fetch ninja + set PATH=downloads\tools\cmake-3.14.0-windows\cmake-3.14.0-win32-x86\bin;downloads\tools\ninja-1.10.0-windows;%PATH% + call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x86 -host_arch=x86 + rmdir /s /q build.x86.debug > nul 2> nul + cmake.exe -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=ON -B build.x86.debug -S toolsrc + ninja.exe -C build.x86.debug + build.x86.debug\vcpkg-test.exe + failOnStderr: true diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index c3ba881d8..8567fd552 100644 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -18,6 +18,7 @@ fi vcpkgDisableMetrics="OFF" vcpkgUseSystem=false vcpkgAllowAppleClang=false +vcpkgBuildTests="OFF" for var in "$@" do if [ "$var" = "-disableMetrics" -o "$var" = "--disableMetrics" ]; then @@ -26,6 +27,8 @@ do vcpkgUseSystem=true elif [ "$var" = "-allowAppleClang" -o "$var" = "--allowAppleClang" ]; then vcpkgAllowAppleClang=true + elif [ "$var" = "-buildTests" ]; then + vcpkgBuildTests="ON" elif [ "$var" = "-help" -o "$var" = "--help" ]; then echo "Usage: ./bootstrap-vcpkg.sh [options]" echo @@ -240,7 +243,7 @@ buildDir="$vcpkgRootDir/toolsrc/build.rel" rm -rf "$buildDir" mkdir -p "$buildDir" -(cd "$buildDir" && CXX="$CXX" "$cmakeExe" .. -DCMAKE_BUILD_TYPE=Release -G "Ninja" "-DCMAKE_MAKE_PROGRAM=$ninjaExe" "-DBUILD_TESTING=OFF" "-DVCPKG_DEVELOPMENT_WARNINGS=OFF" "-DVCPKG_DISABLE_METRICS=$vcpkgDisableMetrics" "-DVCPKG_ALLOW_APPLE_CLANG=$vcpkgAllowAppleClang") || exit 1 +(cd "$buildDir" && CXX="$CXX" "$cmakeExe" .. -DCMAKE_BUILD_TYPE=Release -G "Ninja" "-DCMAKE_MAKE_PROGRAM=$ninjaExe" "-DBUILD_TESTING=$vcpkgBuildTests" "-DVCPKG_DEVELOPMENT_WARNINGS=OFF" "-DVCPKG_DISABLE_METRICS=$vcpkgDisableMetrics" "-DVCPKG_ALLOW_APPLE_CLANG=$vcpkgAllowAppleClang") || exit 1 (cd "$buildDir" && "$cmakeExe" --build .) || exit 1 rm -rf "$vcpkgRootDir/vcpkg" -- cgit v1.2.3