2020-07-01 11:36:09 -07:00
|
|
|
# Copyright (c) Microsoft Corporation.
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
#
|
|
|
|
<#
|
|
|
|
.SYNOPSIS
|
|
|
|
End-to-End tests for the vcpkg executable.
|
|
|
|
|
|
|
|
.DESCRIPTION
|
|
|
|
These tests cover the command line interface and broad functions of vcpkg, including `install`, `remove` and certain
|
|
|
|
binary caching scenarios. They use the vcpkg executable in the current directory.
|
|
|
|
|
|
|
|
.PARAMETER Triplet
|
|
|
|
The triplet to use for testing purposes.
|
|
|
|
|
|
|
|
.PARAMETER WorkingRoot
|
|
|
|
The location used as scratch space for testing.
|
|
|
|
|
|
|
|
#>
|
|
|
|
|
|
|
|
[CmdletBinding()]
|
|
|
|
Param(
|
|
|
|
[Parameter(Mandatory = $true)]
|
|
|
|
[ValidateNotNullOrEmpty()]
|
|
|
|
[string]$Triplet,
|
|
|
|
[Parameter(Mandatory = $true)]
|
|
|
|
[ValidateNotNullOrEmpty()]
|
2020-12-15 10:26:00 -08:00
|
|
|
[string]$WorkingRoot,
|
|
|
|
[Parameter(Mandatory = $false)]
|
|
|
|
[ValidateNotNullOrEmpty()]
|
|
|
|
[string]$Filter
|
2020-07-01 11:36:09 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
|
2021-01-14 19:50:31 -08:00
|
|
|
$WorkingRoot = (Get-Item $WorkingRoot).FullName
|
|
|
|
|
2020-12-15 10:26:00 -08:00
|
|
|
$AllTests = Get-ChildItem $PSScriptRoot/end-to-end-tests-dir/*.ps1
|
|
|
|
if ($Filter -ne $Null) {
|
2020-12-21 15:40:21 -08:00
|
|
|
$AllTests = $AllTests | ? { $_.Name -match $Filter }
|
2020-10-07 10:31:42 -07:00
|
|
|
}
|
2020-12-15 10:26:00 -08:00
|
|
|
$n = 1
|
|
|
|
$m = $AllTests.Count
|
2020-10-07 10:31:42 -07:00
|
|
|
|
2020-12-15 10:26:00 -08:00
|
|
|
$AllTests | % {
|
|
|
|
Write-Host "[end-to-end-tests.ps1] [$n/$m] Running suite $_"
|
|
|
|
& $_
|
|
|
|
$n += 1
|
2020-07-08 15:08:17 -07:00
|
|
|
}
|
|
|
|
|
2020-10-07 10:31:42 -07:00
|
|
|
$LASTEXITCODE = 0
|