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
- Remote
Project - How to initialize a remote git project
- Test
Command - A simple wrapper around a Command with some conveniences.
- Test
Project TestProjectrepresents 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. Seeinitialize()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Β§
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
srctodst, 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 initat 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_remotebut not panicking
Type AliasesΒ§
- Regex
Redaction - A tuple of a placeholder and a regex replacement string.