mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-03 17:24:29 +00:00 
			
		
		
		
	CI/Appveyor: set powershell strict mode
Set-PSDebug produces too much noise and has global scope. Strict mode is scoped to the script context and catches errors.
This commit is contained in:
		@@ -1,10 +1,10 @@
 | 
			
		||||
Set-StrictMode -Version Latest
 | 
			
		||||
$ErrorActionPreference = 'stop'
 | 
			
		||||
Set-PSDebug -Strict -Trace 1
 | 
			
		||||
 | 
			
		||||
$isPullRequest = ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -ne $null)
 | 
			
		||||
$env:CONFIGURATION -match '^(?<compiler>\w+)_(?<bits>32|64)(?:-(?<option>\w+))?$'
 | 
			
		||||
$compiler = $Matches.compiler
 | 
			
		||||
$compileOption = $Matches.option
 | 
			
		||||
$compileOption = if ($Matches -contains 'option') {$Matches.option} else {''}
 | 
			
		||||
$bits = $Matches.bits
 | 
			
		||||
$cmakeBuildType = $(if ($env:CMAKE_BUILD_TYPE -ne $null) {$env:CMAKE_BUILD_TYPE} else {'RelWithDebInfo'});
 | 
			
		||||
$buildDir = [System.IO.Path]::GetFullPath("$(pwd)")
 | 
			
		||||
@@ -23,7 +23,6 @@ $uploadToCodeCov = $false
 | 
			
		||||
 | 
			
		||||
function exitIfFailed() {
 | 
			
		||||
  if ($LastExitCode -ne 0) {
 | 
			
		||||
    Set-PSDebug -Off
 | 
			
		||||
    exit $LastExitCode
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@@ -146,8 +145,6 @@ if ($env:USE_LUACOV -eq 1) {
 | 
			
		||||
# Functional tests
 | 
			
		||||
# The $LastExitCode from MSBuild can't be trusted
 | 
			
		||||
$failed = $false
 | 
			
		||||
# Temporarily turn off tracing to reduce log file output
 | 
			
		||||
Set-PSDebug -Off
 | 
			
		||||
cmake --build . --config $cmakeBuildType --target functionaltest -- $cmakeGeneratorArgs 2>&1 |
 | 
			
		||||
  foreach { $failed = $failed -or
 | 
			
		||||
    $_ -match 'functional tests failed with error'; $_ }
 | 
			
		||||
@@ -161,7 +158,6 @@ if ($uploadToCodecov) {
 | 
			
		||||
if ($failed) {
 | 
			
		||||
  exit $LastExitCode
 | 
			
		||||
}
 | 
			
		||||
Set-PSDebug -Strict -Trace 1
 | 
			
		||||
 | 
			
		||||
# Old tests
 | 
			
		||||
# Add MSYS to path, required for e.g. `find` used in test scripts.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user