1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 14:31:46 +00:00
This commit is contained in:
deadc0de6
2023-11-09 13:58:00 +01:00
parent 94d97bf7a7
commit 0fdccf4e51
2 changed files with 14 additions and 1 deletions

8
tests-ng/dry.sh vendored
View File

@@ -113,18 +113,21 @@ _EOF
echo "dry install"
cd "${ddpath}" | ${bin} install -c "${cfg}" -f -p p1 -V --dry
echo "test tmpd:${tmpd}"
cnt=$(find "${tmpd}" -depth 1 -type f | wc -l)
ls -1 "${tmpd}"
[ "${cnt}" != "0" ] && echo "dry install failed (1 -> ${cnt})" && exit 1
echo "test tmpw:${tmpw}"
cnt=$(find "${tmpw}" -depth 1 -type f | wc -l)
ls -1 "${tmpw}"
[ "${cnt}" != "0" ] && echo "dry install failed (2 -> ${cnt})" && exit 1
echo "test tmpa:${tmpa}"
cnt=$(find "${tmpa}" -depth 1 -type f | wc -l)
ls -1 "${tmpa}"
[ "${cnt}" != "0" ] && echo "dry install failed (3 -> ${cnt})" && exit 1
echo "dry install ok"
# -----------------------------
# test import
# -----------------------------
@@ -164,6 +167,7 @@ ls -1 "${tmps}"/dotfiles
[ "${cnt}" != "0" ] && echo "dry import failed (1 -> ${cnt})" && exit 1
diff "${cfg}" "${tmpa}"/config.yaml || (echo "dry import failed (2)" && exit 1)
echo "dry import ok"
# -----------------------------
# test update
@@ -232,6 +236,7 @@ grep "modified" "${tmps}"/dotfiles/dirchildren/f1 && echo "dry update failed (4)
grep "modified" "${tmps}"/dotfiles/dirchildren/f2 && echo "dry update failed (5)" && exit 1
diff "${cfg}" "${tmpa}"/config.yaml || (echo "dry update failed (6)" && exit 1)
echo "dry update ok"
# -----------------------------
# test remove
@@ -294,6 +299,7 @@ cd "${ddpath}" | ${bin} remove -c "${cfg}" -f -p p1 -V --dry "${tmpd}"/file "${t
[ ! -e "${tmps}"/dotfiles/dirchildren/f2 ] && echo "dry remove failed (7)" && exit 1
diff "${cfg}" "${tmpa}"/config.yaml || (echo "dry remove failed (8)" && exit 1)
echo "dry remove ok"
echo "OK"
exit 0

7
tests.sh vendored
View File

@@ -19,6 +19,13 @@ echo "current dotdrop version ${dotdrop_version}"
echo "=> python version:"
python3 --version
if [ -n "${GH_WORKFLOW}" ]; then
# in CI/CD
if [ -z "${TERM}" ]; then
export TERM="linux"
fi
fi
# test syntax
echo "checking syntax..."
"${cur}"/scripts/check-syntax.sh