aboutsummaryrefslogtreecommitdiff
path: root/scripts/azure-pipelines
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/azure-pipelines')
-rw-r--r--scripts/azure-pipelines/end-to-end-tests-dir/env-passthrough.ps121
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/azure-pipelines/end-to-end-tests-dir/env-passthrough.ps1 b/scripts/azure-pipelines/end-to-end-tests-dir/env-passthrough.ps1
new file mode 100644
index 000000000..6de1335d7
--- /dev/null
+++ b/scripts/azure-pipelines/end-to-end-tests-dir/env-passthrough.ps1
@@ -0,0 +1,21 @@
+if (-not $IsLinux -and -not $IsMacOS) {
+ . $PSScriptRoot/../end-to-end-tests-prelude.ps1
+
+ $env:_VCPKG_TEST_TRACKED = "a"
+ $env:_VCPKG_TEST_UNTRACKED = "b"
+
+ $x = ./vcpkg "--overlay-triplets=$PSScriptRoot/../../testing/env-passthrough" env "echo %_VCPKG_TEST_TRACKED% %_VCPKG_TEST_TRACKED2% %_VCPKG_TEST_UNTRACKED% %_VCPKG_TEST_UNTRACKED2%"
+ if ($x -ne "%_VCPKG_TEST_TRACKED% %_VCPKG_TEST_TRACKED2% %_VCPKG_TEST_UNTRACKED% %_VCPKG_TEST_UNTRACKED2%")
+ {
+ throw "env should have cleaned the environment ($x)"
+ }
+
+ $y = ./vcpkg "--overlay-triplets=$PSScriptRoot/../../testing/env-passthrough" env --triplet passthrough "echo %_VCPKG_TEST_TRACKED% %_VCPKG_TEST_TRACKED2% %_VCPKG_TEST_UNTRACKED% %_VCPKG_TEST_UNTRACKED2%"
+ if ($y -ne "a %_VCPKG_TEST_TRACKED2% b %_VCPKG_TEST_UNTRACKED2%")
+ {
+ throw "env should have kept the environment ($y)"
+ }
+
+ rm env:_VCPKG_TEST_TRACKED
+ rm env:_VCPKG_TEST_UNTRACKED
+} \ No newline at end of file