File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 1313 RUSTDOCFLAGS : " -D warnings"
1414 NDK_VERSION : " r26d"
1515 ANDROID_VERSION : " 12.0.0"
16+ WASMTIME_BACKTRACE_DETAILS : 1
1617
1718name : CI
1819jobs :
@@ -125,7 +126,7 @@ jobs:
125126 - name : Build
126127 run : cargo build --target ${{ matrix.platform.target }} ${{ matrix.rust-version == 'nightly' && '--features nightly' || '' }}
127128 - name : Test
128- run : cargo test --target ${{ matrix.platform.target }} ${{ matrix.rust-version == 'nightly' && '--features nightly' || '' }} ${{ matrix.test-flags }}
129+ run : cargo test --target ${{ matrix.platform.target }} ${{ matrix.rust-version == 'nightly' && '--features nightly' || '' }} ${{ matrix.test-flags }} -- --nocapture
129130 - name : Stop the redroid container
130131 if : ${{ contains(matrix.platform.target, 'android') }}
131132 run : |
Original file line number Diff line number Diff line change @@ -321,23 +321,31 @@ fn test_write_after_close() {
321321}
322322
323323#[ test]
324- #[ cfg_attr( target_os = "wasi" , ignore = "env::temp_dir is not supported" ) ]
325324fn test_change_dir ( ) {
326- std:: env:: set_current_dir ( env:: temp_dir ( ) ) . unwrap ( ) ;
325+ configure_wasi_temp_dir ( ) ;
326+
327+ let dir_a = tempdir ( ) . unwrap ( ) ;
328+ let dir_b = tempdir ( ) . unwrap ( ) ;
329+
330+ std:: env:: set_current_dir ( & dir_a) . expect ( "failed to change to directory ~" ) ;
327331 let tmpfile = NamedTempFile :: new_in ( "." ) . unwrap ( ) ;
328332 let path = std:: env:: current_dir ( ) . unwrap ( ) . join ( tmpfile. path ( ) ) ;
329- std:: env:: set_current_dir ( "/" ) . unwrap ( ) ;
333+ std:: env:: set_current_dir ( & dir_b ) . expect ( "failed to change to directory B" ) ;
330334 drop ( tmpfile) ;
331335 assert ! ( !exists( path) )
332336}
333337
334338#[ test]
335- #[ cfg_attr( target_os = "wasi" , ignore = "env::temp_dir is not supported" ) ]
336339fn test_change_dir_make ( ) {
337- std:: env:: set_current_dir ( env:: temp_dir ( ) ) . unwrap ( ) ;
340+ configure_wasi_temp_dir ( ) ;
341+
342+ let dir_a = tempdir ( ) . unwrap ( ) ;
343+ let dir_b = tempdir ( ) . unwrap ( ) ;
344+
345+ std:: env:: set_current_dir ( & dir_a) . expect ( "failed to change to directory A" ) ;
338346 let tmpfile = Builder :: new ( ) . make_in ( "." , |p| File :: create ( p) ) . unwrap ( ) ;
339347 let path = std:: env:: current_dir ( ) . unwrap ( ) . join ( tmpfile. path ( ) ) ;
340- std:: env:: set_current_dir ( "/" ) . unwrap ( ) ;
348+ std:: env:: set_current_dir ( & dir_b ) . expect ( "failed to change to directory B" ) ;
341349 drop ( tmpfile) ;
342350 assert ! ( !exists( path) )
343351}
You can’t perform that action at this time.
0 commit comments