Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
6d87fc8
Fix ICE due to `unwrap` in `probe_for_name_many`
gurry Jun 8, 2024
d5fb825
interpret: do not ICE on padded non-pow2 SIMD vectors
RalfJung Jun 9, 2024
041e204
fix `NonZero` doctest inconsistencies
ivan-shrimp Jun 9, 2024
f88c647
rewrite `short-ice` in `rmake` format
Oneirical Jun 5, 2024
bba05d6
Add set_backtrace_level helper function to run_make_support
Oneirical Jun 9, 2024
63ec8dd
fix: build on haiku
SteveLauC Jun 10, 2024
91f5530
migrate tests/run-make/llvm-outputs to use rmake.rs
lolbinarycat Jun 10, 2024
29629d0
Remove some unused crate dependencies.
nnethercote Jun 5, 2024
256387b
run-make: add run_in_tmpdir self-test
jieyouxu Jun 10, 2024
3c57ea0
ScalarInt: size mismatches are a bug, do not delay the panic
RalfJung Jun 8, 2024
251d2d0
Add explanatory note to async block type mismatch error
gurry Jun 10, 2024
79388f6
Rollup merge of #126036 - Oneirical:the-intelligent-intestor, r=jieyouxu
matthiaskrgr Jun 10, 2024
22d65d7
Rollup merge of #126063 - nnethercote:rm-unused-crate-deps, r=jackh726
matthiaskrgr Jun 10, 2024
a247b8e
Rollup merge of #126115 - gurry:125876-ice-unwrap-probe-many-result, …
matthiaskrgr Jun 10, 2024
1a87171
Rollup merge of #126159 - RalfJung:scalarint-size-mismatch, r=oli-obk
matthiaskrgr Jun 10, 2024
62f5c6d
Rollup merge of #126184 - RalfJung:interpret-simd-nonpow2, r=oli-obk
matthiaskrgr Jun 10, 2024
515e051
Rollup merge of #126191 - ivan-shrimp:nonzero_doc, r=scottmcm
matthiaskrgr Jun 10, 2024
a90835b
Rollup merge of #126211 - lolbinarycat:llvm-outputs-rmake, r=jieyouxu
matthiaskrgr Jun 10, 2024
1bffb2f
Rollup merge of #126212 - SteveLauC:fix/haiku, r=joboet
matthiaskrgr Jun 10, 2024
a9ce799
Rollup merge of #126215 - gurry:125737-bad-err-anon-futs, r=lcnr
matthiaskrgr Jun 10, 2024
ef89929
Rollup merge of #126223 - jieyouxu:rmake-run-in-tmpdir-self-test, r=K…
matthiaskrgr Jun 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
run-make: add run_in_tmpdir self-test
  • Loading branch information
jieyouxu committed Jun 10, 2024
commit 256387b63e33edf3517157fa737ee4369d9d3e3f
38 changes: 38 additions & 0 deletions tests/run-make/run-in-tmpdir-self-test/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//! This is a self-test for the `run_in_tmpdir` helper in the support library. This test tries to
//! check that files and directories created within the temporary directory gets properly cleared
//! when returning from the closure.

use std::fs;
use std::path::{Path, PathBuf};

use run_make_support::{cwd, run_in_tmpdir};

fn main() {
let mut file_path = PathBuf::new();
let mut dir_path = PathBuf::new();
let mut readonly_file_path = PathBuf::new();
let test_cwd = cwd();
run_in_tmpdir(|| {
assert_ne!(test_cwd, cwd(), "test cwd should not be the same as tmpdir cwd");

file_path = cwd().join("foo.txt");
fs::write(&file_path, "hi").unwrap();

dir_path = cwd().join("bar");
fs::create_dir_all(&dir_path).unwrap();

readonly_file_path = cwd().join("readonly-file.txt");
fs::write(&readonly_file_path, "owo").unwrap();
let mut perms = fs::metadata(&readonly_file_path).unwrap().permissions();
perms.set_readonly(true);
fs::set_permissions(&mut readonly_file_path, perms).unwrap();

assert!(file_path.exists());
assert!(dir_path.exists());
assert!(readonly_file_path.exists());
});
assert!(!file_path.exists());
assert!(!dir_path.exists());
assert!(!readonly_file_path.exists());
assert_eq!(test_cwd, cwd(), "test cwd is not correctly restored");
}