test runs only selected tasks

This commit is contained in:
southerntofu 2020-09-16 15:48:00 +02:00
parent 64701a2f25
commit 65b3f6995f
1 changed files with 25 additions and 9 deletions

View File

@ -103,15 +103,6 @@ function clean {
[[ "$(cat /tmp/forgebuild-host)" = "default" ]]
}
@test "forced run triggers task" {
$FORGEBUILD -b $FORGEBUILDDIR time
[ -f /tmp/forgebuild-time ]
TIME="$(cat /tmp/forgebuild-time)"
$FORGEBUILD -f -b $FORGEBUILDDIR time
NEWTIME="$(cat /tmp/forgebuild-time)"
[[ "$TIME" != "$NEWTIME" ]]
}
@test "can checkout to a specific branch/commit" {
echo "branch" > $FORGEBUILDDIR/branch.checkout
cd $GITREPO
@ -221,3 +212,28 @@ function setup_submodule {
[[ "$TIME" != "$NEWTIME" ]]
}
# CLI arguments/flags
@test "running specific tasks only runs those tasks" {
$FORGEBUILD -b $FORGEBUILDDIR time host
[ -f /tmp/forgebuild-time ]
[ -f /tmp/forgebuild-host ]
[ ! -f /tmp/forgebuild-branch ]
}
@test "not specifying tasks runs all tasks" {
$FORGEBUILD -b $FORGEBUILDDIR
[ -f /tmp/forgebuild-time ]
[ -f /tmp/forgebuild-host ]
[ -f /tmp/forgebuild-branch ]
}
@test "forced run triggers task" {
$FORGEBUILD -b $FORGEBUILDDIR time
[ -f /tmp/forgebuild-time ]
TIME="$(cat /tmp/forgebuild-time)"
$FORGEBUILD -f -b $FORGEBUILDDIR time
NEWTIME="$(cat /tmp/forgebuild-time)"
[[ "$TIME" != "$NEWTIME" ]]
}