1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 14:20:04 -04:00

Add Harness::new_eframe and TestRenderer trait (#5539)

Co-authored-by: Andreas Reich <r_andreas2@web.de>
This commit is contained in:
lucasmerlin
2025-01-02 17:48:39 +01:00
committed by GitHub
parent ee4ab08c8a
commit 46b58e5bcc
28 changed files with 593 additions and 180 deletions

View File

@@ -405,7 +405,7 @@ mod tests {
options.threshold = 2.1;
}
let result = harness.try_wgpu_snapshot_options(&format!("demos/{name}"), &options);
let result = harness.try_snapshot_options(&format!("demos/{name}"), &options);
if let Err(err) = result {
errors.push(err.to_string());
}

View File

@@ -235,21 +235,21 @@ mod tests {
let mut results = Vec::new();
harness.run();
results.push(harness.try_wgpu_snapshot("modals_1"));
results.push(harness.try_snapshot("modals_1"));
harness.get_by_label("Save").click();
// TODO(lucasmerlin): Remove these extra runs once run checks for repaint requests
harness.run();
harness.run();
harness.run();
results.push(harness.try_wgpu_snapshot("modals_2"));
results.push(harness.try_snapshot("modals_2"));
harness.get_by_label("Yes Please").click();
// TODO(lucasmerlin): Remove these extra runs once run checks for repaint requests
harness.run();
harness.run();
harness.run();
results.push(harness.try_wgpu_snapshot("modals_3"));
results.push(harness.try_snapshot("modals_3"));
for result in results {
result.unwrap();
@@ -282,6 +282,6 @@ mod tests {
harness.run();
// This snapshots should show the progress bar modal on top of the save modal.
harness.wgpu_snapshot("modals_backdrop_should_prevent_focusing_lower_area");
harness.snapshot("modals_backdrop_should_prevent_focusing_lower_area");
}
}

View File

@@ -307,6 +307,6 @@ mod tests {
harness.fit_contents();
harness.wgpu_snapshot("widget_gallery");
harness.snapshot("widget_gallery");
}
}

View File

@@ -703,7 +703,7 @@ mod tests {
harness.fit_contents();
let result = harness.try_wgpu_snapshot(&format!("rendering_test/dpi_{dpi:.2}"));
let result = harness.try_snapshot(&format!("rendering_test/dpi_{dpi:.2}"));
if let Err(err) = result {
errors.push(err);
}