fix: use Glow renderer for app smoke startup #17

Merged
moldybits merged 4 commits from feat/terrain-gen-abstraction into main 2026-05-25 21:02:10 -04:00
4 changed files with 45 additions and 15 deletions
Showing only changes of commit 922ab29304 - Show all commits
Generated
+1 -8
View File
@@ -584,6 +584,7 @@ dependencies = [
"egui-wgpu", "egui-wgpu",
"egui-winit", "egui-winit",
"egui_glow", "egui_glow",
"glow",
"glutin", "glutin",
"glutin-winit", "glutin-winit",
"image", "image",
@@ -594,7 +595,6 @@ dependencies = [
"objc2-foundation 0.2.2", "objc2-foundation 0.2.2",
"parking_lot", "parking_lot",
"percent-encoding", "percent-encoding",
"pollster",
"profiling", "profiling",
"raw-window-handle", "raw-window-handle",
"static_assertions", "static_assertions",
@@ -602,7 +602,6 @@ dependencies = [
"wasm-bindgen-futures", "wasm-bindgen-futures",
"web-sys", "web-sys",
"web-time", "web-time",
"wgpu",
"winapi", "winapi",
"windows-sys 0.59.0", "windows-sys 0.59.0",
"winit", "winit",
@@ -1990,12 +1989,6 @@ dependencies = [
"windows-sys 0.61.2", "windows-sys 0.61.2",
] ]
[[package]]
name = "pollster"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f3a9f18d041e6d0e102a0a46750538147e5e8992d3b4873aaafee2520b00ce3"
[[package]] [[package]]
name = "portable-atomic" name = "portable-atomic"
version = "1.13.1" version = "1.13.1"
+1 -2
View File
@@ -12,8 +12,7 @@ import-geotiff = ["dep:geotiff-reader"]
[dependencies] [dependencies]
clap = { version = "4.6.1", features = ["derive"] } clap = { version = "4.6.1", features = ["derive"] }
eframe = { version = "0.32.3", optional = true, default-features = false, features = ["default_fonts", "wayland", "wgpu", "x11"] } eframe = { version = "0.32.3", optional = true, default-features = false, features = ["default_fonts", "glow", "wayland", "x11"] }
#wgpu = { version = "25.0.2", features = ["metal"] }
image = { version = "0.25.9", default-features = false, features = ["png"] } image = { version = "0.25.9", default-features = false, features = ["png"] }
geotiff-reader = { version = "0.4.0", optional = true, default-features = false, features = ["local"] } geotiff-reader = { version = "0.4.0", optional = true, default-features = false, features = ["local"] }
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
+18 -5
View File
@@ -765,14 +765,27 @@ fn rgb_image_to_color_image(image: &RgbImage) -> egui::ColorImage {
egui::ColorImage::from_rgb(size, image.as_raw()) egui::ColorImage::from_rgb(size, image.as_raw())
} }
pub fn run() -> eframe::Result<()> { pub(crate) fn native_options() -> eframe::NativeOptions {
let options = eframe::NativeOptions { eframe::NativeOptions {
renderer: eframe::Renderer::Wgpu, renderer: eframe::Renderer::Glow,
..Default::default() ..Default::default()
}; }
}
pub fn run() -> eframe::Result<()> {
eframe::run_native( eframe::run_native(
WINDOW_TITLE, WINDOW_TITLE,
options, native_options(),
Box::new(|_cc| Ok(Box::new(OpenVistaProApp::new()))), Box::new(|_cc| Ok(Box::new(OpenVistaProApp::new()))),
) )
} }
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn native_options_prefer_glow_renderer_for_the_interactive_shell() {
assert_eq!(native_options().renderer, eframe::Renderer::Glow);
}
}
+25
View File
@@ -0,0 +1,25 @@
#![cfg(feature = "app")]
use std::process::Command;
#[test]
fn app_binary_starts_under_xvfb_without_panicking() {
if Command::new("xvfb-run").arg("--help").output().is_err() {
eprintln!("skipping app smoke test because xvfb-run is unavailable");
return;
}
let bin = env!("CARGO_BIN_EXE_openvistapro_app");
let output = Command::new("xvfb-run")
.args(["-a", "timeout", "8s", bin])
.output()
.expect("failed to launch xvfb-run for openvistapro_app");
assert_eq!(
output.status.code(),
Some(124),
"expected the app to start and then be interrupted by timeout; stdout={:?}; stderr={:?}",
String::from_utf8_lossy(&output.stdout),
String::from_utf8_lossy(&output.stderr)
);
}