Fix some tests

This commit is contained in:
southerntofu 2021-03-30 18:41:40 +02:00
parent ad55c62383
commit f8af68be33
2 changed files with 7 additions and 4 deletions

View File

@ -28,10 +28,10 @@ function setup {
echo "date +%s%N > $TMPDIR/forgebuild-time" > $FORGEBUILDDIR/time
chmod +x $FORGEBUILDDIR/time
echo "$GITREPO" > $FORGEBUILDDIR/host.source
echo "cat \$GITBUILDCONF/entry > $TMPDIR/forgebuild-host" > $FORGEBUILDDIR/host
echo "cat \$FORGEBUILDCONF/entry > $TMPDIR/forgebuild-host" > $FORGEBUILDDIR/host
chmod +x $FORGEBUILDDIR/host
echo "$GITREPO" > $FORGEBUILDDIR/branch.source
echo "cat \$GITBUILDDIR/.branch/branch > $TMPDIR/forgebuild-branch" > $FORGEBUILDDIR/branch
echo "cat \$FORGEBUILDDIR/.branch/branch > $TMPDIR/forgebuild-branch" > $FORGEBUILDDIR/branch
chmod +x $FORGEBUILDDIR/branch
echo "echo \$(pwd) > $TMPDIR/forgebuild-pwd" > $FORGEBUILDDIR/pwd
chmod +x $FORGEBUILDDIR/pwd
@ -145,12 +145,13 @@ function clean {
@test "can checkout to a specific branch/commit" {
echo "branch" > $FORGEBUILDDIR/branch.checkout
cd $GITREPO
# Fetch default branch
default="$(git rev-parse --abbrev-ref HEAD)"
git checkout -b branch
echo "branch" > branch
git add branch
git commit -m "new branch"
# TODO: should be able to checkout to the default branch even when it's not called master
git checkout master
git checkout "$default"
$FORGEBUILD -b $FORGEBUILDDIR branch
[[ "$(cat $TMPDIR/forgebuild-branch)" = "branch" ]]
}

View File

@ -97,7 +97,9 @@ function clean {
hg add branch
hg commit -m "new branch"
hg update default
$FORGEBUILD -b $FORGEBUILDDIR branch
# TODO: not sure why this test fails
[[ "$(cat $TMPDIR/forgebuild-branch)" = "branch" ]]
}