diff options
author | Joey Hess <joey@kitenet.net> | 2010-11-18 15:15:40 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-11-18 15:15:40 -0400 |
commit | 68183b47212b7819b3fc0e7715c37ec38e4a9750 (patch) | |
tree | aaf2c7586597f369518cb0c98884ae6990791f02 /configure.hs | |
parent | f3f3bc6cae0f907fe023708d2c298c1219b0b603 (diff) |
add tests for uuid and xargs -0
Diffstat (limited to 'configure.hs')
-rw-r--r-- | configure.hs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/configure.hs b/configure.hs index b9ea2344f..4d0624a42 100644 --- a/configure.hs +++ b/configure.hs @@ -20,6 +20,8 @@ tests = [ TestDesc "cp -a" "cp_a" $ testCp "-a" , TestDesc "cp -p" "cp_p" $ testCp "-p" , TestDesc "cp --reflink=auto" "cp_reflink_auto" $ testCp "--reflink=auto" + , TestDesc "uuid" "uuid" $ requireCommand "uuid" "uuid" + , TestDesc "xargs -0" "xargs_0" $ requireCommand "xargs -0" "xargs -0 </dev/null" ] tmpDir :: String @@ -29,7 +31,16 @@ testFile :: String testFile = tmpDir ++ "/testfile" quiet :: String -> String -quiet s = s ++ " 2>/dev/null" +quiet s = s ++ " >/dev/null 2>&1" + +requireCommand :: String -> String -> Test +requireCommand command cmdline = do + ret <- testCmd $ quiet cmdline + if (ret) + then return True + else do + testEnd False + error $ "** the " ++ command ++ " command is required to use git-annex" testCp :: String -> Test testCp option = testCmd $ quiet $ "cp " ++ option ++ " " ++ testFile ++ |