forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[vcpkg] Port microsoft#14944 to vcpkg-tool
- Loading branch information
1 parent
cea3bde
commit 768d8f9
Showing
14 changed files
with
232 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
/.vscode | ||
/build* | ||
*.swp |
7 changes: 7 additions & 0 deletions
7
...lines/e2e_ports/overlays/vcpkg-default-features-fail-require-other-feature/portfile.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled) | ||
if("default-feature" IN_LIST FEATURES) | ||
message(FATAL_ERROR "the default feature was depended upon") | ||
endif() | ||
if(NOT "success" IN_LIST FEATURES) | ||
message(FATAL_ERROR "the success feature was not depended upon") | ||
endif() |
15 changes: 15 additions & 0 deletions
15
...pipelines/e2e_ports/overlays/vcpkg-default-features-fail-require-other-feature/vcpkg.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "vcpkg-default-features-fail-require-other-feature", | ||
"version": "0", | ||
"default-features": [ | ||
"default-feature" | ||
], | ||
"features": { | ||
"default-feature": { | ||
"description": "" | ||
}, | ||
"success": { | ||
"description": "" | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
azure-pipelines/e2e_ports/overlays/vcpkg-default-features-fail/portfile.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled) | ||
if("default-feature" IN_LIST FEATURES) | ||
message(FATAL_ERROR "the default feature was depended upon") | ||
endif() |
12 changes: 12 additions & 0 deletions
12
azure-pipelines/e2e_ports/overlays/vcpkg-default-features-fail/vcpkg.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "vcpkg-default-features-fail", | ||
"version": "0", | ||
"default-features": [ | ||
"default-feature" | ||
], | ||
"features": { | ||
"default-feature": { | ||
"description": "" | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
azure-pipelines/e2e_ports/overlays/vcpkg-empty-port/portfile.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled) |
4 changes: 4 additions & 0 deletions
4
azure-pipelines/e2e_ports/overlays/vcpkg-empty-port/vcpkg.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "vcpkg-empty-port", | ||
"version": "0" | ||
} |
2 changes: 2 additions & 0 deletions
2
azure-pipelines/e2e_ports/overlays/vcpkg-fail-if-depended-upon/portfile.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled) | ||
message(FATAL_ERROR "this port should not be depended upon") |
4 changes: 4 additions & 0 deletions
4
azure-pipelines/e2e_ports/overlays/vcpkg-fail-if-depended-upon/vcpkg.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "vcpkg-fail-if-depended-upon", | ||
"version": "0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
. "$PSScriptRoot/../end-to-end-tests-prelude.ps1" | ||
|
||
|
||
Write-Trace "test manifest features" | ||
$manifestDir = "$TestingRoot/manifest-dir" | ||
|
||
$manifestDirArgs = $commonArgs + @("--x-manifest-root=$manifestDir") | ||
$noDefaultFeatureArgs = $manifestDirArgs + @('--x-no-default-features') | ||
|
||
function feature { | ||
@{ | ||
'description' = ''; | ||
'dependencies' = $args; | ||
} | ||
} | ||
|
||
$vcpkgJson = @{ | ||
'name' = "manifest-test"; | ||
'version' = "1.0.0"; | ||
'default-features' = @( 'default-fail' ); | ||
'features' = @{ | ||
'default-fail' = feature 'vcpkg-fail-if-depended-upon'; | ||
'copied-feature' = feature 'vcpkg-empty-port' | ||
'multiple-dep-1' = feature 'vcpkg-empty-port' | ||
'multiple-dep-2' = feature 'vcpkg-empty-port' | ||
'no-default-features-1' = feature @{ | ||
'name' = 'vcpkg-default-features-fail'; | ||
'default-features' = $False; | ||
}; | ||
'no-default-features-2' = feature @{ | ||
'name' = 'vcpkg-default-features-fail-require-other-feature'; | ||
'default-features' = $False; | ||
'features' = @( 'success' ) | ||
}; | ||
} | ||
} | ||
|
||
New-Item -Path $manifestDir -ItemType Directory | ||
$manifestDir = (Get-Item $manifestDir).FullName | ||
New-Item -Path "$manifestDir/vcpkg.json" -ItemType File ` | ||
-Value (ConvertTo-Json -Depth 5 -InputObject $vcpkgJson) | ||
|
||
Write-Trace "test manifest features: default-features, features = []" | ||
Run-Vcpkg install @manifestDirArgs | ||
Throw-IfNotFailed | ||
|
||
Write-Trace "test manifest features: no-default-features, features = []" | ||
Run-Vcpkg install @manifestDirArgs --x-no-default-features | ||
Throw-IfFailed | ||
Write-Trace "test manifest features: default-features, features = [core]" | ||
Run-Vcpkg install @manifestDirArgs --x-feature=core | ||
Throw-IfFailed | ||
# test having both | ||
Write-Trace "test manifest features: no-default-features, features = [core]" | ||
Run-Vcpkg install @manifestDirArgs --x-no-default-features --x-feature=core | ||
Throw-IfFailed | ||
|
||
Write-Trace "test manifest features: no-default-features, features = [default-fail]" | ||
Run-Vcpkg install @manifestDirArgs --x-no-default-features --x-feature=default-fail | ||
Throw-IfNotFailed | ||
Write-Trace "test manifest features: default-features, features = [core, default-fail]" | ||
Run-Vcpkg install @manifestDirArgs --x-feature=core --x-feature=default-fail | ||
Throw-IfNotFailed | ||
|
||
Write-Trace "test manifest features: no-default-features, features = [copied-feature]" | ||
Run-Vcpkg install @noDefaultFeatureArgs --x-feature=copied-feature | ||
Throw-IfFailed | ||
Write-Trace "test manifest features: no-default-features, features = [copied-feature, copied-feature]" | ||
Run-Vcpkg install @noDefaultFeatureArgs --x-feature=copied-feature --x-feature=copied-feature | ||
Throw-IfFailed | ||
|
||
Write-Trace "test manifest features: no-default-features, features = [multiple-dep-1, multiple-dep-2]" | ||
Run-Vcpkg install @noDefaultFeatureArgs --x-feature=multiple-dep-1 --x-feature=multiple-dep-2 | ||
Throw-IfFailed | ||
|
||
Write-Trace "test manifest features: no-default-features, features = [no-default-features-1]" | ||
Run-Vcpkg install @noDefaultFeatureArgs --x-feature=no-default-features-1 | ||
Throw-IfFailed | ||
Write-Trace "test manifest features: no-default-features, features = [no-default-features-2]" | ||
Run-Vcpkg install @noDefaultFeatureArgs --x-feature=no-default-features-2 | ||
Throw-IfFailed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters