Skip to main content

Module util

Module util 

Source

Re-exportsΒ§

use foundry_compilers::Project; πŸ”’
use foundry_compilers::ProjectCompileOutput; πŸ”’
use foundry_compilers::Vyper; πŸ”’
use foundry_compilers::utils::RuntimeOrHandle; πŸ”’
use foundry_config::Config; πŸ”’
use std::env; πŸ”’
use std::env; πŸ”’
use std::fs; πŸ”’
use std::fs::File; πŸ”’
use std::io::Read; πŸ”’
use std::io::Seek; πŸ”’
use std::io::Write; πŸ”’
use std::path::Path; πŸ”’
use std::path::PathBuf; πŸ”’
use std::process::Command; πŸ”’
use std::sync::LazyLock; πŸ”’

StructsΒ§

ExtTester
External test builder
RemoteProject
How to initialize a remote git project
TestCommand
A simple wrapper around a Command with some conveniences.
TestProject
TestProject represents a temporary project to run tests against.

ConstantsΒ§

FORGE_STD_REVISION
The commit of forge-std to use.
OTHER_SOLC_VERSION
Another Solc version used when compiling tests.
SKIP_DIRS πŸ”’
Directories to skip when copying project directories. These are build artifacts and runtime-generated files that should not be copied to temp workspaces.
SOLC_VERSION
The default Solc version used when compiling tests.

StaticsΒ§

CURRENT_DIR_LOCK
NEXT_ID
Global test identifier.
TEMPLATE_LOCK πŸ”’
Global default template lock. If its contents are not exactly "1", the global template will be re-initialized. See initialize() for more info.
TEMPLATE_PATH πŸ”’
Global default template path. Contains the global template project from which all other temp projects are initialized. See initialize() for more info.

TraitsΒ§

OutputExt
Extension trait for Output.

FunctionsΒ§

canonicalize
cargo_build_target_dir_and_profile
cargo_profile_dir
Returns the Cargo profile directory (target/<profile>) for the currently running test executable.
checkout_revision
Checks out a fixture revision and restores its pinned submodule revisions.
checkout_revision_inner
clone_fixture
Clones fixture history without downloading unused file contents or default-branch submodules.
clone_remote
Clones a remote repository into the specified directory. Panics if the command fails.
config_paths_exist
copy_dir_filtered
Copies the directory at src to dst, skipping build artifact directories.
copy_dir_filtered_inner πŸ”’
get_compiled
Compile the project with a lock for the cache.
get_vyper
Installs Vyper if it’s not already present.
initialize
Initializes a project with forge init at the given path from a template directory.
insert_redactions
lossy_string
make_redactions
Creates a [snapbox] redactions object from a list of regex redactions.
prepare_cached_project
Refreshes a cached fixture, retaining only compiler artifacts and their cache metadata.
pretty_err
read_string
remove_cache_entry
retain_compiler_artifacts
setup_cast
setup_cast_project
setup_forge
Setup an empty test project and return a command pointing to the forge executable whose CWD is set to the project’s root.
setup_forge_project
setup_forge_remote
Setups a new local forge project by cloning and initializing the RemoteProject
test_redactions
try_setup_forge_remote
Same as setup_forge_remote but not panicking

Type AliasesΒ§

RegexRedaction
A tuple of a placeholder and a regex replacement string.