mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-22 15:25:20 +00:00
macOS: Add GhosttyUITests (Drafting to save some ci checks) (#9185)
### Background
~~I was trying to add a few UI test cases for
`macOS-titlebar-style`[Already in this PR]~~. In order to do this, I
need a way from `GhosttyKit` to load a temporary configuration without
messing around with users'.
### Changes
- Add `ghostty_config_load_file` using the existing
[`loadFile`](dafb9e89a3/src/config/Config.zig (L3399))
- Use `xcbeautify` to format test&build errors
**Couldn't find a way to do this in `GhosttyXcodebuild`, if you have a
better approach please let me know!**
- Add GhosttyUITests target and test cases for
`GhosttyTitlebarTabsUITests`(#2349) and `GhosttyThemeTests`(#9360)
### NOTE
Running UI tests on the runner could be **very** slow and I couldn't
find a way to guarantee success, so I made these only runnable by
manually testing in Xcode.
Better to squash this🤪
> > Some of the test cases could fail when testing all the cases
together; a rerun would succeed.
This commit is contained in:
@@ -65,6 +65,15 @@ export fn ghostty_config_load_default_files(self: *Config) void {
|
||||
};
|
||||
}
|
||||
|
||||
/// Load the configuration from a specific file path.
|
||||
/// The path must be null-terminated.
|
||||
export fn ghostty_config_load_file(self: *Config, path: [*:0]const u8) void {
|
||||
const path_slice = std.mem.span(path);
|
||||
self.loadFile(state.alloc, path_slice) catch |err| {
|
||||
log.err("error loading config from file path={s} err={}", .{ path_slice, err });
|
||||
};
|
||||
}
|
||||
|
||||
/// Load the configuration from the user-specified configuration
|
||||
/// file locations in the previously loaded configuration. This will
|
||||
/// recursively continue to load up to a built-in limit.
|
||||
|
||||
Reference in New Issue
Block a user