mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
Merge branch 'master' of https://github.com/nikita-bykov/virtual-environments into pipx-windows
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
Describe "Git" {
|
||||
$gitTools = 'bash', 'awk', 'git', 'git-lfs'
|
||||
$gitTools = 'git', 'git-lfs'
|
||||
$gitTestCases = $gitTools | ForEach-Object {
|
||||
@{
|
||||
toolName = $_
|
||||
|
||||
50
images/win/scripts/Tests/Shell.Tests.ps1
Normal file
50
images/win/scripts/Tests/Shell.Tests.ps1
Normal file
@@ -0,0 +1,50 @@
|
||||
Describe "Shell" {
|
||||
$shellTestCases = @(
|
||||
@{Name = "C:\shells\bash.exe"; Target = "C:\msys64\usr\bin\bash.exe"},
|
||||
@{Name = "C:\shells\sh.exe"; Target = "C:\msys64\usr\bin\sh.exe"},
|
||||
@{Name = "C:\shells\gitbash.exe"; Target = "$env:ProgramFiles\Git\bin\bash.exe"},
|
||||
@{Name = "C:\shells\msysbash.exe"; Target = "C:\msys64\usr\bin\bash.exe"}
|
||||
)
|
||||
|
||||
$pathTestCases = @(
|
||||
@{Path = "C:\shells"},
|
||||
@{Path = "C:\msys64\mingw64\bin"},
|
||||
@{Path = "C:\msys64\usr\bin"}
|
||||
)
|
||||
|
||||
$IsWin16 = Test-IsWin16
|
||||
|
||||
It "Default bash.exe from MSYS2" {
|
||||
(Get-Command bash).Path | Should -BeExactly "C:\shells\bash.exe"
|
||||
}
|
||||
|
||||
It "Default sh.exe from MSYS2" {
|
||||
(Get-Command sh).Path | Should -BeExactly "C:\shells\sh.exe"
|
||||
}
|
||||
|
||||
It "Folder C:\shells exists" {
|
||||
"C:\shells" | Should -Exist
|
||||
}
|
||||
|
||||
It "C:\Windows\System32 before C:\msys64\mingw64\bin and C:\msys64\usr\bin" {
|
||||
$path = $env:Path.Split(";").ToLower()
|
||||
$indexOfSystem32 = $path.IndexOf("c:\windows\system32")
|
||||
|
||||
$path.IndexOf("c:\msys64\mingw64\bin") | Should -BeGreaterThan $indexOfSystem32
|
||||
$path.IndexOf("c:\msys64\usr\bin") | Should -BeGreaterThan $indexOfSystem32
|
||||
}
|
||||
|
||||
It "C:\shells\winbash.exe target to $env:SystemRoot\System32\bash.exe" -Skip:$IsWin16 {
|
||||
$Name = "C:\shells\winbash.exe"
|
||||
$Target = "$env:SystemRoot\System32\bash.exe"
|
||||
(Get-Item $Name).Target | Should -BeExactly $Target
|
||||
}
|
||||
|
||||
It "<Name> target to <Target>" -TestCases $shellTestCases {
|
||||
(Get-Item $Name).Target | Should -BeExactly $Target
|
||||
}
|
||||
|
||||
It "<Path> is in PATH" -TestCases $pathTestCases {
|
||||
$env:Path.Split(";") | Should -Contain $Path
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user