summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-05-20 14:09:50 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-05-20 14:09:50 -0400
commitdcd8970a8feae8b699922f5bd1d69d698f0b0c4f (patch)
tree91611f3be0672b9ec06eb6532fcce96deb17ec2f
parent751258da057d5dc83ea312d3547bf0f7a098af63 (diff)
run the test suite twice, once in direct mode
On a filesystem that only supports direct mode, it will test direct mode twice, but oh well.
-rw-r--r--Test.hs28
-rw-r--r--debian/changelog3
2 files changed, 22 insertions, 9 deletions
diff --git a/Test.hs b/Test.hs
index c624bbe47..0755ff3db 100644
--- a/Test.hs
+++ b/Test.hs
@@ -72,15 +72,18 @@ main = do
putStrLn "Now, some broader checks ..."
putStrLn " (Do not be alarmed by odd output here; it's normal."
putStrLn " wait for the last line to see how it went.)"
- env <- prepare
- rs <- forM hunit $ \t -> do
- divider
- t env
- cleanup tmpdir
+ rs <- runhunit =<< prepare False
+ directrs <- runhunit =<< prepare True
divider
- propigate rs qcok
+ propigate (rs++directrs) qcok
where
divider = putStrLn $ replicate 70 '-'
+ runhunit env = do
+ r <- forM hunit $ \t -> do
+ divider
+ t env
+ cleanup tmpdir
+ return r
propigate :: [Counts] -> Bool -> IO ()
propigate cs qcok
@@ -170,6 +173,7 @@ hunit =
test_init :: TestEnv -> Test
test_init env = "git-annex init" ~: TestCase $ innewrepo env $ do
git_annex env "init" [reponame] @? "init failed"
+ handleforcedirect env
where
reponame = "test repo"
@@ -870,7 +874,14 @@ clonerepo env old new bare = do
boolSystem "git" [Params ("clone -q" ++ b), File old, File new] @? "git clone failed"
indir env new $
git_annex env "init" ["-q", new] @? "git annex init failed"
+ when (not bare) $
+ indir env new $
+ handleforcedirect env
return new
+
+handleforcedirect :: TestEnv -> IO ()
+handleforcedirect env = when (M.lookup "FORCEDIRECT" env == Just "1") $
+ git_annex env "direct" ["-q"] @? "git annex direct failed"
ensuretmpdir :: IO ()
ensuretmpdir = do
@@ -976,8 +987,8 @@ annexed_present = runchecks
unannexed :: FilePath -> Assertion
unannexed = runchecks [checkregularfile, checkcontent, checkwritable]
-prepare :: IO TestEnv
-prepare = do
+prepare :: Bool -> IO TestEnv
+prepare forcedirect = do
whenM (doesDirectoryExist tmpdir) $
error $ "The temporary directory " ++ tmpdir ++ " already exists; cannot run test suite."
@@ -997,6 +1008,7 @@ prepare = do
, ("GIT_COMMITTER_NAME", "git-annex test")
-- force gpg into batch mode for the tests
, ("GPG_BATCH", "1")
+ , ("FORCEDIRECT", if forcedirect then "1" else "")
]
return $ M.fromList env
diff --git a/debian/changelog b/debian/changelog
index c302f55b5..91265bef4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,9 +12,10 @@ git-annex (4.20130517) UNRELEASED; urgency=low
failing to link -lHSrts_thr
* Temporarily build without webapp on kfreebsd-i386, until yesod is
installable there again.
- * direct mode bug fix: After a conflicted merge was automatically resolved,
+ * Direct mode bug fix: After a conflicted merge was automatically resolved,
the content of a file that was already present could incorrectly
be replaced with a symlink.
+ * Direct mode is now fully tested by the test suite.
-- Joey Hess <joeyh@debian.org> Fri, 17 May 2013 11:17:03 -0400