test(apple): skip ibtool-compiled NIB tests when Xcode ibtool is unavailable (#2070)

Command Line Tools install the /usr/bin/ibtool and xcrun shims without ibtool itself, so the existing /usr/bin/ibtool existence guard never skipped the storyboard test, and the native NIB hierarchy suite had no guard. On a Command Line Tools-only macOS host these seven tests failed at fixture compilation. Probe xcrun --find ibtool once and use it for both suites.
This commit is contained in:
TonyWu
2026-10-13 06:07:16 +09:00
committed by GitHub
parent 5c2956587a
commit 7bc57e1e64
3 changed files with 15 additions and 3 deletions
+11
View File
@@ -0,0 +1,11 @@
import { spawnSync } from "node:child_process";
/**
* Whether Xcode's ibtool can compile Interface Builder sources on this host.
* Command Line Tools install the /usr/bin/ibtool and xcrun shims without the
* tool itself, so probe resolution instead of checking the shim path.
*/
export const xcodeIbtoolAvailable =
process.platform === "darwin" &&
spawnSync("/usr/bin/xcrun", ["--find", "ibtool"], { stdio: "ignore" })
.status === 0;