Improve detection of inability to check free disk space.

Don't check if configure indicated checks won't work. This should fix a
FTBFS on mipsel, where configure correctly detects the checks won't work,
while garbage is returned for disk space info at git-annex runtime. It also
means that, when built via cabal, disk space checks are not enabled,
unfortunatly.
This commit is contained in:
Joey Hess 2012-03-21 21:21:20 -04:00
parent d228377722
commit 181d2ccd20
6 changed files with 44 additions and 14 deletions

View file

@ -10,8 +10,12 @@ import Control.Applicative
import Build.TestConfig
import Utility.SafeCommand
tests :: [TestCase]
tests =
tests :: Bool -> [TestCase]
tests True = cabaltests ++ common
tests False = common
common :: [TestCase]
common =
[ TestCase "version" getVersion
, TestCase "git" $ requireCmd "git" "git --version >/dev/null"
, TestCase "git version" getGitVersion
@ -28,6 +32,11 @@ tests =
, TestCase "ssh connection caching" getSshConnectionCaching
] ++ shaTestCases [1, 256, 512, 224, 384]
cabaltests :: [TestCase]
cabaltests =
[ TestCase "StatFS" testStatFSDummy
]
shaTestCases :: [Int] -> [TestCase]
shaTestCases l = map make l
where make n =
@ -72,6 +81,10 @@ getSshConnectionCaching :: Test
getSshConnectionCaching = Config "sshconnectioncaching" . BoolConfig <$>
boolSystem "sh" [Param "-c", Param "ssh -o ControlPersist=yes -V >/dev/null 2>/dev/null"]
testStatFSDummy :: Test
testStatFSDummy =
return $ Config "statfs_sanity_checked" $ MaybeBoolConfig Nothing
{- Set up cabal file with version. -}
cabalSetup :: IO ()
cabalSetup = do