mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 16:26:08 +03:00

Related to #7879 This commit updates `zig build test` to run Xcode tests, too. These run in parallel to the Zig tests, so they don't add any time to the test. The Xcode tests will _not_ run when: (1) the target is not macOS, or (2) the `-Dtest-filter` option is non-empty. This makes it so that this change doesn't affect non-macOS and doesn't affect the general dev cycle because you usually will run `-Dtest-filter` when developing a core feature. I didn't add a step to only run Xcode tests because I find that when I'm working in Xcode I'm probably going to run the tests from there anyways. The integration with `zig build test` is just a convenience, especially around CI. Speaking of CI, this change also makes it so this will run in CI.
33 lines
784 B
Swift
33 lines
784 B
Swift
//
|
|
// GhosttyTests.swift
|
|
// GhosttyTests
|
|
//
|
|
// Created by Mitchell Hashimoto on 7/9/25.
|
|
//
|
|
|
|
import Testing
|
|
import GhosttyKit
|
|
|
|
extension Tag {
|
|
@Tag static var benchmark: Self
|
|
}
|
|
|
|
/// The whole idea behind these benchmarks is that they're run by right-clicking
|
|
/// in Xcode and using "Profile" to open them in instruments. They aren't meant to
|
|
/// be run in general.
|
|
///
|
|
/// When running them, set the `if:` to `true`. There's probably a better
|
|
/// programmatic way to do this but I don't know it yet!
|
|
@Suite(
|
|
"Benchmarks",
|
|
.enabled(if: false),
|
|
.tags(.benchmark)
|
|
)
|
|
struct BenchmarkTests {
|
|
@Test func example() async throws {
|
|
ghostty_benchmark_cli(
|
|
"terminal-stream",
|
|
"--data=/Users/mitchellh/Documents/ghostty/bug.osc.txt")
|
|
}
|
|
}
|