Crate gix_testtools
source ·Expand description
Utilities for testing gitoxide crates, many of which might be useful for testing programs that use git in general.
Re-exports§
Structs§
- A utility to set the current working dir to the given value, on drop.
- A utility to set environment variables, while unsetting them (or resetting them to their previous value) on drop.
- A wrapper for a running git-daemon process which is killed automatically on drop.
Enums§
- Define how
scripted_fixture_writable_with_args()uses produces the writable copy.
Statics§
- The major, minor and patch level of the git version on the system.
Functions§
- A utility to copy the entire contents of
src_dirintodst_dir. - Load the fixture from
<crate-root>/tests/fixtures/<path>and return its data, or panic. - Like
scripted_fixture_writable, but does not prefix the fixture directory withtests - Return the path to the
<crate-root>/tests/fixtures/<path>directory. - Return the path to the
<crate-root>/fixtures/<path>directory. - Run
gitinworking_dirwith all providedargs. - Run the executable at
script_name, likemake_repo.shormy_setup.pyto produce a read-only directory to which the path is returned. - Like
scripted_fixture_read_only, but does not prefix the fixture directory withtests - Like
scripted_fixture_read_only()], but passesargstoscript_name. - Like
scripted_fixture_read_only_with_args(), but does not prefix the fixture directory withtests - Run the executable at
script_name, likemake_repo.shto produce a writable directory to which the tempdir is returned. It will be removed automatically, courtesy oftempfile::TempDir. - Like
scripted_fixture_writable, but does not prefix the fixture directory withtests - Like
scripted_fixture_writable(), but passesargstoscript_namewhile providing control over the way files are created withmode. - Like
scripted_fixture_writable_with_args, but does not prefix the fixture directory withtests - Set the current working dir to
new_cwdand return a type that returns to the previous working dir on drop. - Returns true if the given
major,minorandpatchis smaller than the actual git version on the system to facilitate skipping a test on the caller. Will never return true on CI which is expected to have a recent enough git version. - Spawn a git daemon process to host all repository at or below
working_dir. - Transform a verbose parser errors from raw bytes into a
BStrto make printing/debugging human-readable.
Type Aliases§
- A result type to allow using the try operator
?in unit tests.