Skip to content

Testing cake scripts output #2846

Answered by devlead
supernik asked this question in Q&A
Sep 1, 2020 · 4 comments · 1 reply
Discussion options

You must be logged in to vote

@supernik there are several ways to do this, the example below is one way, it's just a quick n' dirty script I did now, so room for improvement, but hopefully you get the gist of it, happy to elaborate if anythings unclear.

Example script ( build.cake ) to execute in integration tests.

var target = Argument("target", "Default");

Task("TaskA")
    .Does(()=>Information("Hello from TaskA"));

Task("TaskB")
    .IsDependentOn("TaskA")
    .Does(()=>Information("Hello from TaskB"));

Task("TaskC")
    .IsDependentOn("TaskB")
    .Does(()=>Information("Hello from TaskC"));

Task("Default")
    .IsDependentOn("TaskC");

RunTarget(target);

This will for TaskA output something like

=============…

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by pascalberger
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@devlead
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants