File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed
Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -146,11 +146,12 @@ impl RunCommand {
146146 // a message and exit.
147147 if let Some ( exit) = e. downcast_ref :: < Exit > ( ) {
148148 eprintln ! ( "Error: {}" , exit) ;
149- if cfg ! ( unix) {
150- // On Unix, if it's a normal exit status, return it.
151- process:: exit ( exit. status ( ) . get ( ) ) ;
149+ // On Windows, exit status 3 indicates an abort (see below),
150+ // so just return 1 indicating a non-zero status.
151+ if cfg ! ( windows) {
152+ process:: exit ( 1 ) ;
152153 }
153- process:: exit ( 1 ) ;
154+ process:: exit ( exit . status ( ) . get ( ) ) ;
154155 }
155156
156157 // If the program exited because of a trap, return an error code
Original file line number Diff line number Diff line change @@ -189,7 +189,11 @@ fn timeout_in_invoke() -> Result<()> {
189189fn exit125_wasi_snapshot0 ( ) -> Result < ( ) > {
190190 let wasm = build_wasm ( "tests/wasm/exit125_wasi_snapshot0.wat" ) ?;
191191 let output = run_wasmtime_for_output ( & [ wasm. path ( ) . to_str ( ) . unwrap ( ) , "--disable-cache" ] ) ?;
192- assert_eq ! ( output. status. code( ) . unwrap( ) , 125 ) ;
192+ if cfg ! ( windows) {
193+ assert_eq ! ( output. status. code( ) . unwrap( ) , 1 ) ;
194+ } else {
195+ assert_eq ! ( output. status. code( ) . unwrap( ) , 125 ) ;
196+ }
193197 Ok ( ( ) )
194198}
195199
@@ -198,7 +202,11 @@ fn exit125_wasi_snapshot0() -> Result<()> {
198202fn exit125_wasi_snapshot1 ( ) -> Result < ( ) > {
199203 let wasm = build_wasm ( "tests/wasm/exit125_wasi_snapshot1.wat" ) ?;
200204 let output = run_wasmtime_for_output ( & [ wasm. path ( ) . to_str ( ) . unwrap ( ) , "--disable-cache" ] ) ?;
201- assert_eq ! ( output. status. code( ) . unwrap( ) , 125 ) ;
205+ if cfg ! ( windows) {
206+ assert_eq ! ( output. status. code( ) . unwrap( ) , 1 ) ;
207+ } else {
208+ assert_eq ! ( output. status. code( ) . unwrap( ) , 125 ) ;
209+ }
202210 Ok ( ( ) )
203211}
204212
You can’t perform that action at this time.
0 commit comments