File tree 2 files changed +26
-0
lines changed
src/rustup-win-installer/msi
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ install:
47
47
} else {
48
48
Write-Host "MSYS2 not required" -ForegroundColor Green
49
49
}
50
+ - pwsh : |
51
+ Install-Module Pester -Force
50
52
51
53
# Install rust, x86_64-pc-windows-msvc host
52
54
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
@@ -81,6 +83,9 @@ test_script:
81
83
- if defined BUILD_MSI pushd src\rustup-win-installer && cargo build --release --target %TARGET% & popd
82
84
- if defined BUILD_MSI pushd src\rustup-win-installer\msi && powershell .\build.ps1 -Target %TARGET% & popd
83
85
- cargo fmt --all -- --check
86
+ - pwsh : |
87
+ $pesterOutputFile = 'src\rustup-win-installer\msi\PesterTestsResults.xml'
88
+ Invoke-Pester -OutputFormat NUnitXml -OutputFile $pesterOutputFile
84
89
85
90
notifications :
86
91
- provider : Webhook
Original file line number Diff line number Diff line change
1
+ if (Get-Command - Name rustup - ErrorAction Stop) {
2
+ # Enable rustup tab completion
3
+ rustup completions powershell | Out-String | Invoke-Expression
4
+ }
5
+
6
+ function Get-Result ([string ]$Text , [int ]$CursorPosition = $Text.Length , [hashtable ]$Options ) {
7
+ [System.Management.Automation.CommandCompletion ]::CompleteInput($Text , $CursorPosition , $Options ).CompletionMatches
8
+ }
9
+
10
+ Describe ' rustup flags and subcommands' {
11
+ $result = Get-Result ' rustup '
12
+
13
+ # Keep it simple because over-specify testing might be risky
14
+ $result.Count | Should - BeGreaterThan 10
15
+ $result.CompletionText | Should - Contain ' completions'
16
+ $result.CompletionText | Should - Contain ' install'
17
+ $result.CompletionText | Should - Contain ' uninstall'
18
+ $result.CompletionText | Should - Contain ' update'
19
+ $result.CompletionText | Should - Contain ' --help'
20
+ $result.CompletionText | Should - Contain ' --verbose'
21
+ }
You can’t perform that action at this time.
0 commit comments