forked from psake/psake
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
247 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Properties { | ||
$x = 1 | ||
$y = 2 | ||
} | ||
|
||
FormatTaskName "[{0}]" | ||
|
||
Task default -Depends Verify | ||
|
||
Task Verify -Description "This task verifies psake's variables" { | ||
|
||
$assertions = @( | ||
((Test-Path 'variable:\psake'), "'psake' variable was not exported from module"), | ||
(($variable:psake.ContainsKey("build_success")), "psake variable does not contain 'build_success'"), | ||
(($variable:psake.ContainsKey("use_exit_on_error")), "psake variable does not contain 'use_exit_on_error'"), | ||
(($variable:psake.ContainsKey("log_error")), "psake variable does not contain 'log_error'"), | ||
(($variable:psake.ContainsKey("version")), "psake variable does not contain 'version'"), | ||
(($variable:psake.ContainsKey("build_script_file")), "psake variable does not contain 'build_script_file'"), | ||
(($variable:psake.ContainsKey("framework_version")), "psake variable does not contain 'framework_version'"), | ||
((!$variable:psake.build_success), 'psake.build_success should be $false'), | ||
((!$variable:psake.use_exit_on_error), 'psake.use_exit_on_error should be $false'), | ||
((!$variable:psake.log_error), 'psake.log_error should be $false'), | ||
((![string]::IsNullOrEmpty($variable:psake.version)), 'psake.version was null or empty'), | ||
(($variable:psake.build_script_file -ne $null), '$psake.build_script_file was null'), | ||
(($variable:psake.build_script_file.Name -eq "checkvariables.ps1"), ("psake variable: {0} was not equal to 'VerifyVariables.ps1'" -f $psake.build_script_file.Name)), | ||
((![string]::IsNullOrEmpty($variable:psake.framework_version)), 'psake variable: $psake.framework_version was null or empty'), | ||
(($variable:context.Peek().tasks.Count -ne 0), 'psake variable: $tasks had length zero'), | ||
(($variable:context.Peek().properties.Count -ne 0), 'psake variable: $properties had length zero'), | ||
(($variable:context.Peek().includes.Count -eq 0), 'psake variable: $includes should have had length zero'), | ||
(($variable:context.Peek().formatTaskNameString -eq "[{0}]"), 'psake variable: $formatTaskNameString was not set correctly'), | ||
(($variable:context.Peek().currentTaskName -eq "Verify"), 'psake variable: $currentTaskName was not set correctly') | ||
) | ||
|
||
foreach ($assertion in $assertions) | ||
{ | ||
Assert ( $assertion[0] ) $assertion[1] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Task default -Depends TaskA | ||
|
||
Task TaskA -Depends TaskB { | ||
"Task - A" | ||
} | ||
|
||
Task TaskB -Depends TaskC -ContinueOnError { | ||
"Task - B" | ||
throw "I failed on purpose!" | ||
} | ||
|
||
Task TaskC { | ||
"Task - C" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Properties { | ||
$x = 1 | ||
} | ||
|
||
Task default -Depends RunNested1, RunNested2, CheckX | ||
|
||
Task RunNested1 { | ||
Invoke-psake .\nested\nested1.ps1 | ||
} | ||
|
||
Task RunNested2 { | ||
Invoke-psake .\nested\nested2.ps1 | ||
} | ||
|
||
Task CheckX{ | ||
Assert ($x -eq 1) '$x was not 1' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
properties { | ||
$p1 = $null | ||
$p2 = $null | ||
} | ||
|
||
task default -depends TestParams | ||
|
||
task TestParams { | ||
Assert ($p1 -ne $null) "p1 should not be null" | ||
Assert ($p2 -ne $null) "p2 should not be null" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
task default -depends Test | ||
|
||
task Test -depends Compile, Clean -PreAction {"Pre-Test"} -Action { | ||
"Test" | ||
} -PostAction {"Post-Test"} | ||
|
||
task Compile -depends Clean { | ||
"Compile" | ||
} | ||
|
||
task Clean { | ||
"Clean" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.