Crate run_make_support
source ·Expand description
run-make-support is a support library for run-make tests. It provides command wrappers and
convenience utility functions to help test writers reduce duplication. The support library
notably is built via cargo: this means that if your test wants some non-trivial utility, such
as object or wasmparser, they can be re-exported and be made available through this library.
Re-exports§
pub use cc::cc;pub use cc::extra_c_flags;pub use cc::extra_cxx_flags;pub use cc::Cc;pub use clang::clang;pub use clang::Clang;pub use diff::diff;pub use diff::Diff;pub use llvm::llvm_filecheck;pub use llvm::llvm_objdump;pub use llvm::llvm_profdata;pub use llvm::llvm_readobj;pub use llvm::LlvmFilecheck;pub use llvm::LlvmObjdump;pub use llvm::LlvmProfdata;pub use llvm::LlvmReadobj;pub use run::cmd;pub use run::run;pub use run::run_fail;pub use run::run_with_args;pub use rustc::aux_build;pub use rustc::bare_rustc;pub use rustc::rustc;pub use rustc::Rustc;pub use rustdoc::bare_rustdoc;pub use rustdoc::rustdoc;pub use rustdoc::Rustdoc;pub use bstr;pub use gimli;pub use object;pub use regex;pub use wasmparser;
Modules§
- command 🔒
- This module implements “drop bombs” intended for use by command wrappers to ensure that the constructed commands are eventually executed. This is exactly like
rustc_errors::Diagwhere we force everyDiagto be consumed or we emit a bug, but we panic instead.
Macros§
- Implement common helpers for command wrappers. This assumes that the command wrapper is a struct containing a
cmd: Commandfield. The provided helpers are:
Functions§
AR- Check that
haystackcontainsneedle. Panic otherwise. - Check that
actualis equal toexpected. Panic otherwise. - Check that
haystackdoes not containneedle. Panic otherwise. - Construct the binary name based on platform.
- Copy a directory into another.
- Gathers all files in the current working directory that have the extension
ext, and counts the number of lines within that contain a match with the regex patternre. - Creates a new symlink to a path on the filesystem, adjusting for Windows or Unix.
- Return the current working directory.
- Use
cygpath -won a path to get a Windows path string back. This assumes thatcygpathis available on the platform! - Construct the dynamic library name based on the platform.
- Returns true if the filename at
pathis not inexpected. - Returns true if the filename at
pathhas the extensionextension. - Returns true if the filename at
pathstarts withprefix. - Read the contents of a file that cannot simply be read by read_to_string, due to invalid utf8 data, then assert that it contains
expected. - Read the contents of a file that cannot simply be read by read_to_string, due to invalid utf8 data, then assert that it does not contain
expected. - Check if target uses macOS.
- Check if target uses msvc.
- Check if target is windows-like.
- Returns true if the filename at
pathdoes not containexpected. - Returns the path for a local test file.
- Check that all files in
dir1exist and have the same content indir2. Panic otherwise. - This function is designed for running commands in a temporary directory that is cleared after the function ends.
- Generate the name a rust library (rlib) would have.
- Set the runtime library path as needed for running the host rustc/rustdoc/etc.
- Browse the directory
pathnon-recursively and return all files which respect the parameters outlined byclosure. - Path to the root rust-lang/rust source checkout.
- Construct the static library name based on the platform.
TARGET- Ensure that the path P is read-only while the test runs, and restore original permissions at the end so compiletest can clean up. This will panic on Windows if the path is a directory (as it would otherwise do nothing)
- Run
uname. This assumes thatunameis available on the platform!