Skip to content

Commit

Permalink
Add test case for the recording head version feature noted in microso…
Browse files Browse the repository at this point in the history
  • Loading branch information
BillyONeal committed Nov 1, 2023
1 parent 4afdf87 commit ea1b965
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
if (VCPKG_USE_HEAD_VERSION)
set(VCPKG_HEAD_VERSION "detected-head")
endif()
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "set-detected-head-version",
"version": "1.0.0"
}
19 changes: 19 additions & 0 deletions azure-pipelines/end-to-end-tests-dir/classic-versions.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
. $PSScriptRoot/../end-to-end-tests-prelude.ps1

# Not a number
Refresh-TestRoot
$out = Run-VcpkgAndCaptureOutput @commonArgs install classic-versions-b
Throw-IfNotFailed
if ($out -notmatch ".*warning:.*dependency classic-versions-a.*at least version 2.*is currently 1.*")
{
throw "Expected to fail and print warning about mismatched versions"
}

Refresh-TestRoot
Run-Vcpkg @commonArgs install set-detected-head-version
Throw-IfFailed
$listResults = Run-VcpkgAndCaptureOutput @commonArgs list
if (-Not ($listResults.Trim() -match "set-detected-head-version:[\S]+[\s]+1.0.0"))
{
throw "Expected list to list the declared version"
}

Refresh-TestRoot
Run-Vcpkg @commonArgs install set-detected-head-version --head
Throw-IfFailed
$listResults = Run-VcpkgAndCaptureOutput @commonArgs list
if (-Not ($listResults.Trim() -match "set-detected-head-version:[\S]+[\s]+detected-head"))
{
throw "Expected list to list the declared version"
}

0 comments on commit ea1b965

Please sign in to comment.