[Windows] Add Ninja (#11737)

This commit is contained in:
Alexey-Ayupov
2025-03-10 18:45:03 +01:00
committed by GitHub
parent 7809601472
commit 71845af4a0
6 changed files with 41 additions and 5 deletions
@@ -117,6 +117,7 @@ $tools.AddToolVersion("WinAppDriver", $(Get-WinAppDriver))
$tools.AddToolVersion("WiX Toolset", $(Get-WixVersion))
$tools.AddToolVersion("yamllint", $(Get-YAMLLintVersion))
$tools.AddToolVersion("zstd", $(Get-ZstdVersion))
$tools.AddToolVersion("Ninja", $(Get-NinjaVersion))
# CLI Tools
$cliTools = $installedSoftware.AddHeader("CLI Tools")
@@ -322,3 +322,7 @@ function Get-MongoshVersion {
function Get-WSL2Version {
return $((Get-AppxPackage -Name "MicrosoftCorporationII.WindowsSubsystemForLinux").version)
}
function Get-NinjaVersion {
return $(ninja --version)
}
@@ -103,3 +103,31 @@ Describe "ImageMagick" {
"magick -version" | Should -ReturnZeroExitCode
}
}
Describe "Ninja" {
BeforeAll {
$ninjaProjectPath = $(Join-Path $env:TEMP_DIR "ninjaproject")
New-item -Path $ninjaProjectPath -ItemType Directory -Force
@'
cmake_minimum_required(VERSION 3.10)
project(NinjaTest NONE)
'@ | Out-File -FilePath "$ninjaProjectPath/CMakeLists.txt" -Encoding utf8
$ninjaProjectBuildPath = $(Join-Path $ninjaProjectPath "build")
New-item -Path $ninjaProjectBuildPath -ItemType Directory -Force
Set-Location $ninjaProjectBuildPath
}
It "Make a simple ninja project" {
"cmake -GNinja $ninjaProjectPath" | Should -ReturnZeroExitCode
}
It "build.ninja file should exist" {
$buildFilePath = $(Join-Path $ninjaProjectBuildPath "build.ninja")
$buildFilePath | Should -Exist
}
It "Ninja" {
"ninja --version" | Should -ReturnZeroExitCode
}
}