File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -266,7 +266,15 @@ fn main() {returns_result} {{
266266 )
267267 . unwrap ( ) ;
268268 }
269- let not_running = ignore || scraped_test. no_run ( opts) ;
269+ let should_panic = scraped_test. langstr . should_panic ;
270+ // On some platforms, exit code can only be 0 or 1, preventing us to actually know if it's a
271+ // panic. In this case, we ignore the tests with `should_panic`.
272+ //
273+ // Emscripten can catch panics but other wasm targets cannot
274+ let ignore_because_no_process_support = should_panic
275+ && ( cfg ! ( target_family = "wasm" ) || cfg ! ( target_os = "zkvm" ) )
276+ && !cfg ! ( target_os = "emscripten" ) ;
277+ let not_running = ignore_because_no_process_support || ignore || scraped_test. no_run ( opts) ;
270278 writeln ! (
271279 output_merged_tests,
272280 "
@@ -294,7 +302,6 @@ if let Some(bin_path) = crate::__doctest_mod::doctest_path() {{
294302 test::assert_test_result(doctest_bundle::{test_id}::__main_fn())
295303}}
296304" ,
297- should_panic = scraped_test. langstr. should_panic,
298305 )
299306 } ,
300307 )
You can’t perform that action at this time.
0 commit comments