Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: Add the ability for TestDub to use an initialized filesystem #2849

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions source/dub/test/base.d
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,26 @@
super(root, extras, skip);
}

/***************************************************************************

Instantiate a new `TestDub` instance with the provided filesystem state

This exposes the raw virtual filesystem to the user, allowing any kind
of customization to happen: Empty directory, non-writeable ones, etc...

Params:
dg = Delegate to be called with the filesystem, before `TestDub`
instantiation is performed;

***************************************************************************/

public this (scope void delegate(scope FSEntry root) dg)

Check warning on line 180 in source/dub/test/base.d

View check run for this annotation

Codecov / codecov/patch

source/dub/test/base.d#L180

Added line #L180 was not covered by tests
{
this.fs = new FSEntry();
dg(this.fs);
super(ProjectPath.toNativeString(), null, SkipPackageSuppliers.none);

Check warning on line 184 in source/dub/test/base.d

View check run for this annotation

Codecov / codecov/patch

source/dub/test/base.d#L182-L184

Added lines #L182 - L184 were not covered by tests
}

/// Avoid loading user configuration
protected override Settings loadConfig(ref SpecialDirs dirs) const
{
Expand Down
Loading