From a4021ffba11cd9404c7451c6eaeff68588f3001b Mon Sep 17 00:00:00 2001 From: Shamil Mubarakshin <127750046+shamil-mubarakshin@users.noreply.github.com> Date: Mon, 7 Jul 2025 14:33:16 +0200 Subject: [PATCH] Update Ninja pester test (#12534) --- images/ubuntu/scripts/tests/Tools.Tests.ps1 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/images/ubuntu/scripts/tests/Tools.Tests.ps1 b/images/ubuntu/scripts/tests/Tools.Tests.ps1 index ef762fbc4..cddb78276 100644 --- a/images/ubuntu/scripts/tests/Tools.Tests.ps1 +++ b/images/ubuntu/scripts/tests/Tools.Tests.ps1 @@ -392,15 +392,16 @@ Describe "Kotlin" { } Describe "Ninja" { - New-item -Path "/tmp/ninjaproject" -ItemType Directory -Force - Set-Location '/tmp/ninjaproject' + BeforeAll { + New-item -Path "/tmp/ninjaproject" -ItemType Directory -Force @' cmake_minimum_required(VERSION 3.10) project(NinjaTest NONE) -'@ | Out-File -FilePath "./CMakeLists.txt" +'@ | Out-File -FilePath "/tmp/ninjaproject/CMakeLists.txt" + } It "Make a simple ninja project" { - "cmake -GNinja /tmp/ninjaproject" | Should -ReturnZeroExitCode + "cmake -GNinja -S /tmp/ninjaproject -B /tmp/ninjaproject" | Should -ReturnZeroExitCode } It "build.ninja file should exist" { @@ -411,4 +412,8 @@ project(NinjaTest NONE) It "Ninja" { "ninja --version" | Should -ReturnZeroExitCode } + + AfterAll { + Remove-Item -Path "/tmp/ninjaproject" -Recurse -Force + } }