2022-08-23 14:29:21 +00:00
|
|
|
$env:ErrorActionPreference='Stop'
|
|
|
|
|
2022-09-12 12:17:17 +00:00
|
|
|
[string[]] $exclude_crates = @(
|
2022-09-10 08:21:37 +00:00
|
|
|
"--exclude",
|
|
|
|
"gst-plugin-csound",
|
|
|
|
"--exclude",
|
|
|
|
"gst-plugin-webp"
|
2022-08-23 14:29:21 +00:00
|
|
|
)
|
|
|
|
|
2022-09-12 12:17:17 +00:00
|
|
|
[string[]] $features_matrix = @(
|
|
|
|
"--no-default-features",
|
|
|
|
"",
|
|
|
|
"--all-features"
|
|
|
|
)
|
2022-08-23 14:29:21 +00:00
|
|
|
|
2022-09-12 12:17:17 +00:00
|
|
|
function Run-Tests {
|
|
|
|
param (
|
|
|
|
$Features
|
|
|
|
)
|
2021-10-19 06:45:07 +00:00
|
|
|
$local_exclude = $exclude_crates;
|
|
|
|
|
|
|
|
# In this case the plugin will pull x11/wayland features
|
|
|
|
# which will fail to build on windows.
|
|
|
|
if (($Features -eq '--all-features') -or ($Features -eq '')) {
|
|
|
|
$local_exclude += @("--exclude", "gst-plugin-gtk4")
|
|
|
|
}
|
2022-08-23 14:29:21 +00:00
|
|
|
|
2022-09-12 12:17:17 +00:00
|
|
|
Write-Host "Features: $Features"
|
2021-10-19 06:45:07 +00:00
|
|
|
Write-Host "Exclude string: $local_exclude"
|
2022-09-12 12:17:17 +00:00
|
|
|
|
2021-10-19 06:45:07 +00:00
|
|
|
cargo build --color=always --workspace $local_exclude --all-targets $Features
|
2022-08-23 14:29:21 +00:00
|
|
|
|
2022-09-12 12:17:17 +00:00
|
|
|
if (!$?) {
|
|
|
|
Write-Host "Build failed"
|
|
|
|
Exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
$env:G_DEBUG="fatal_warnings"
|
2021-10-19 06:45:07 +00:00
|
|
|
cargo test --no-fail-fast --color=always --workspace $local_exclude --all-targets $Features
|
2022-09-12 12:17:17 +00:00
|
|
|
|
|
|
|
if (!$?) {
|
|
|
|
Write-Host "Tests failed"
|
|
|
|
Exit 1
|
|
|
|
}
|
|
|
|
}
|
2022-08-23 14:29:21 +00:00
|
|
|
|
2022-09-12 12:17:17 +00:00
|
|
|
foreach($feature in $features_matrix) {
|
|
|
|
Run-Tests -Features $feature
|
2022-08-23 14:29:21 +00:00
|
|
|
}
|