mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Skip VT100 tests on Windows Server 2012R2 as console does not support it (#19413)
This commit is contained in:
committed by
Dongbo Wang
parent
9fc8642474
commit
8450602d59
@@ -3,12 +3,19 @@
|
||||
|
||||
Describe '$env:__SuppressAnsiEscapeSequences tests' -Tag CI {
|
||||
BeforeAll {
|
||||
$originalDefaultParameterValues = $PSDefaultParameterValues.Clone()
|
||||
|
||||
if (-not $host.ui.SupportsVirtualTerminal) {
|
||||
$global:PSDefaultParameterValues["it:skip"] = $true
|
||||
}
|
||||
|
||||
$originalSuppressPref = $env:__SuppressAnsiEscapeSequences
|
||||
$originalRendering = $PSStyle.OutputRendering
|
||||
$PSStyle.OutputRendering = 'Ansi'
|
||||
}
|
||||
|
||||
AfterAll {
|
||||
$global:PSDefaultParameterValues = $originalDefaultParameterValues
|
||||
$env:__SuppressAnsiEscapeSequences = $originalSuppressPref
|
||||
$PSStyle.OutputRendering = $originalRendering
|
||||
}
|
||||
|
||||
@@ -127,6 +127,11 @@ Describe 'Get-Error tests' -Tag CI {
|
||||
}
|
||||
|
||||
It 'Get-Error uses Error color for Message and PositionMessage members' {
|
||||
|
||||
if (-not $host.ui.SupportsVirtualTerminal) {
|
||||
Set-ItResult -Skipped -Because 'Windows Server 2012 R2 does not support VT100 escape sequences'
|
||||
}
|
||||
|
||||
$suppressVT = $false
|
||||
if (Test-Path env:/__SuppressAnsiEscapeSequences) {
|
||||
$suppressVT = $true
|
||||
|
||||
@@ -1,7 +1,16 @@
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
|
||||
Describe 'OutputRendering tests' {
|
||||
Describe 'OutputRendering tests' -Tag 'CI' {
|
||||
BeforeAll {
|
||||
$originalDefaultParameterValues = $PSDefaultParameterValues.Clone()
|
||||
# Console host does not support VT100 escape sequences on Windows 2012R2 or earlier
|
||||
|
||||
if (-not $host.ui.SupportsVirtualTerminal) {
|
||||
$global:PSDefaultParameterValues["it:skip"] = $true
|
||||
}
|
||||
}
|
||||
|
||||
BeforeEach {
|
||||
if ($null -ne $PSStyle) {
|
||||
$oldOutputRendering = $PSStyle.OutputRendering
|
||||
|
||||
Reference in New Issue
Block a user