Skip to main content

Module paths

Module paths 

Source
Expand description

Access common paths and manipulate the filesystem

Re-exportsΒ§

use filetime::FileTime; πŸ”’
use itertools::Itertools; πŸ”’
use walkdir::WalkDir; πŸ”’
use std::cell::RefCell; πŸ”’
use std::fs; πŸ”’
use std::io; πŸ”’
use std::io::ErrorKind; πŸ”’
use std::path::Path; πŸ”’
use std::path::PathBuf; πŸ”’
use std::process::Command; πŸ”’
use std::sync::Mutex; πŸ”’
use std::sync::OnceLock; πŸ”’
use std::sync::atomic::AtomicUsize; πŸ”’
use std::sync::atomic::Ordering; πŸ”’
use crate::compare::assert_e2e; πŸ”’
use crate::compare::match_contains; πŸ”’

StructsΒ§

ReadOnly
Temporarily sets a file or directory as read only until this struct is dropped. Useful to make sure tests reset permissions if they fail.
TestIdGuard
See init_root

ConstantsΒ§

TEST_DIR πŸ”’
TEST_ID πŸ”’

StaticsΒ§

CARGO_INTEGRATION_TEST_DIR πŸ”’
GLOBAL_ROOT πŸ”’

TraitsΒ§

CargoPathExt
Common path and file operations

FunctionsΒ§

build_dir_ignored_path_patterns πŸ”’
The paths to ignore when CargoPathExt::assert_build_dir_layout is called
cargo_home
Path to the current test’s $CARGO_HOME
chmod_readonly πŸ”’
do_op πŸ”’
get_lib_extension
See get_lib_filename for more details
get_lib_filename
Get the filename for a library.
get_lib_prefix
See get_lib_filename for more details
global_root
Path to the parent directory of all test roots
home
Path to the current test’s $HOME
init_root
For test harnesses like crate::cargo_test
log_dir
Path to the current test’s $CARGO_LOG
log_file
Path to the current test’s $CARGO_LOG file
root
Path to the test’s filesystem scratchpad
set_global_root πŸ”’
set_readonly πŸ”’
sysroot
Path to rustcs sysroot
test_dir
This takes the test location (std::file!() should be passed) and the test name and outputs the location the test should be places in, inside of target/tmp/cit