mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-12 06:19:01 +08:00
27 lines
1.0 KiB
PowerShell
27 lines
1.0 KiB
PowerShell
|
. $PSScriptRoot/../end-to-end-tests-prelude.ps1
|
||
|
|
||
|
# Test that prohibiting backcompat features actually prohibits
|
||
|
$backcompatFeaturePorts = @('vcpkg-uses-test-cmake', 'vcpkg-uses-vcpkg-common-functions')
|
||
|
foreach ($backcompatFeaturePort in $backcompatFeaturePorts) {
|
||
|
$succeedArgs = $commonArgs + @('install',$backcompatFeaturePort,'--no-binarycaching')
|
||
|
$failArgs = $succeedArgs + @('--x-prohibit-backcompat-features')
|
||
|
$CurrentTest = "Should fail: ./vcpkg $($failArgs -join ' ')"
|
||
|
Write-Host $CurrentTest
|
||
|
./vcpkg @failArgs
|
||
|
if ($LastExitCode -ne 0) {
|
||
|
Write-Host "... failed (this is good!)"
|
||
|
} else {
|
||
|
throw $CurrentTest
|
||
|
}
|
||
|
|
||
|
# Install failed when prohibiting backcompat features, so it should succeed if we allow them
|
||
|
$CurrentTest = "Should succeeed: ./vcpkg $($succeedArgs -join ' ')"
|
||
|
Write-Host $CurrentTest
|
||
|
./vcpkg @succeedArgs
|
||
|
if ($LastExitCode -ne 0) {
|
||
|
throw $CurrentTest
|
||
|
} else {
|
||
|
Write-Host "... succeeded."
|
||
|
}
|
||
|
}
|