Skip to content

VinTest.Cake.GameTestsTaskBase TContext

VinTest.Cake

GameTestsTaskBase<TContext> Class

Base Cake task that launches VintageStory, waits for test results, and reports them. Derive from this in your mod's CakeBuild project.

public abstract class GameTestsTaskBase<TContext> : Cake.Frosting.FrostingTask<TContext>
    where TContext : VinTest.Cake.ContextBase

Type parameters

TContext

Inheritance ObjectCake.Frosting.FrostingTask<TContext> → GameTestsTaskBase<TContext>

Properties

GameTestsTaskBase<TContext>.AdditionalLogCapture Property

Lines containing these substrings will be printed in the filtered log.

Joined with VinTest.Cake.GameTestsTaskBase<>.DefaultLogCapture: "[VinTest]".

Can be demoted or promoted via LogSuppressions.

Override to customize.

protected virtual string[] AdditionalLogCapture { protected get; }

Property Value

String[]

GameTestsTaskBase<TContext>.AdditionalLogErrors Property

Lines containing these substrings will be highlighted in red in the filtered log, and will cause the task to fail, unless IgnoreLogErrors is set, or demoted via LogSuppressions.

Joined with VinTest.Cake.GameTestsTaskBase<>.DefaultLogErrors: "[Error]".

Override to customize.

protected virtual string[] AdditionalLogErrors { protected get; }

Property Value

String[]

GameTestsTaskBase<TContext>.AdditionalLogWarnings Property

Lines containing these substrings will be highlighted in yellow in the filtered log.

Joined with VinTest.Cake.GameTestsTaskBase<>.DefaultLogWarnings: "[Warning]", "not found. Hint:".

Can be demoted or promoted via LogSuppressions.

Override to customize.

protected virtual string[] AdditionalLogWarnings { protected get; }

Property Value

String[]

GameTestsTaskBase<TContext>.LogSuppressions Property

Change level of specific log lines, pattern-matched after primary classification. Each entry is a (RegexPattern, Level?) pair.

If Level == null - ignore the line entirely (not captured).

If Level != null - override the classified level (e.g. demote Error -> Warning).

Lines that remain/become Error-level after suppression will cause the task to fail.

Override to customize.

protected virtual IEnumerable<(string Pattern,Nullable<Cake.Core.Diagnostics.LogLevel> TargetLevel)> LogSuppressions { protected get; }

Property Value

IEnumerable<<String,Nullable<Cake.Core.Diagnostics.LogLevel>>>

Methods

GameTestsTaskBase<TContext>.Build(TContext) Method

Called during Run(TContext), after Prepare(TContext). Build (or rebuild) whatever is needed before VS is launched.

Default implementation builds AutotestsProjectName (which should pull in core mod project transitively via ProjectReference in .csproj).

Override to customize.

NOTE: this *OMITS* rebuilding cake orchestrator project: its executable would be locked and cause MsBuild to fail, since the executable is already driving the build. This should not be a problem for dotnet run since it rebuilds cake automatically, but it *WILL* mess things up if you run CakeBuild.exe manually.

protected virtual void Build(TContext context);

Parameters

context TContext

GameTestsTaskBase<TContext>.Finally(TContext) Method

Performs cleanup after Run(TContext) finishes, even if it fails. Will be called by Cake internals. If you override this, make sure to call the base method first.

public override void Finally(TContext context);

Parameters

context TContext

GameTestsTaskBase<TContext>.GetAssetsPaths(TContext) Method

Absolute paths to asset directories to pass to --addOrigin when launching VS.

protected virtual IEnumerable<string> GetAssetsPaths(TContext context);

Parameters

context TContext

Returns

IEnumerable<String>

GameTestsTaskBase<TContext>.GetModBinaryPaths(TContext) Method

Absolute paths to mod directories to pass to --addModPath when launching VS.

Override to customize.

protected virtual IEnumerable<string> GetModBinaryPaths(TContext context);

Parameters

context TContext

Returns

IEnumerable<String>

GameTestsTaskBase<TContext>.Prepare(TContext) Method

Called during Run(TContext), after generic Cleanup(). Create mod-specific config files here.

Override to customize.

protected virtual void Prepare(TContext context);

Parameters

context TContext

GameTestsTaskBase<TContext>.Run(TContext) Method

Entry point for the gametests task, driving the entire process. Cleanup(), Prepare(TContext), Build(TContext), Launch(), Wait(), Print(). Will be called by Cake internals.

public sealed override void Run(TContext context);

Parameters

context TContext