chiark / gitweb /
test suite: Introduce t-expect-fsck-fail
[dgit.git] / tests / lib
index d075bc763f0d05249b233294d64dd91bc6b7c0f7..569ca145c4b531fa795aa61749aaed896cc6bf82 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -349,6 +349,29 @@ t-git-dir-check () {
        esac
 }
 
+t-expect-fsck-fail () {
+       expect_fsck_fail+=" $1"
+}
+
+t-git-fsck () {
+       git fsck --no-dangling --strict || ${expect_fsck_fail:+true} false
+}
+
+t-fscks () {
+       (
+       shopt -s nullglob
+       for d in $tmp/*/.git $tmp/git/*.git; do
+               cd "$d"
+               t-git-fsck
+       done
+       )
+}
+
+t-ok () {
+       t-fscks
+       echo ok.
+}
+
 t-rm-dput-dropping () {
        rm -f $tmp/${p}_${v}_*.upload
 }