allow building w/o rsync installed
rsync is needed to run, but may not be on the build machine; that's ok
This commit is contained in:
parent
4a72b17bd0
commit
96734ba350
2 changed files with 3 additions and 15 deletions
|
@ -24,14 +24,14 @@ tests :: [TestCase]
|
||||||
tests =
|
tests =
|
||||||
[ TestCase "version" (Config "packageversion" . StringConfig <$> getVersion)
|
[ TestCase "version" (Config "packageversion" . StringConfig <$> getVersion)
|
||||||
, TestCase "UPGRADE_LOCATION" getUpgradeLocation
|
, TestCase "UPGRADE_LOCATION" getUpgradeLocation
|
||||||
, TestCase "git" $ requireCmd "git" "git --version >/dev/null"
|
, TestCase "git" $ testCmd "git" "git --version >/dev/null"
|
||||||
, TestCase "git version" getGitVersion
|
, TestCase "git version" getGitVersion
|
||||||
, testCp "cp_a" "-a"
|
, testCp "cp_a" "-a"
|
||||||
, testCp "cp_p" "-p"
|
, testCp "cp_p" "-p"
|
||||||
, testCp "cp_preserve_timestamps" "--preserve=timestamps"
|
, testCp "cp_preserve_timestamps" "--preserve=timestamps"
|
||||||
, testCp "cp_reflink_auto" "--reflink=auto"
|
, testCp "cp_reflink_auto" "--reflink=auto"
|
||||||
, TestCase "xargs -0" $ requireCmd "xargs_0" "xargs -0 </dev/null"
|
, TestCase "xargs -0" $ testCmd "xargs_0" "xargs -0 </dev/null"
|
||||||
, TestCase "rsync" $ requireCmd "rsync" "rsync --version >/dev/null"
|
, TestCase "rsync" $ testCmd "rsync" "rsync --version >/dev/null"
|
||||||
, TestCase "curl" $ testCmd "curl" "curl --version >/dev/null"
|
, TestCase "curl" $ testCmd "curl" "curl --version >/dev/null"
|
||||||
, TestCase "wget" $ testCmd "wget" "wget --version >/dev/null"
|
, TestCase "wget" $ testCmd "wget" "wget --version >/dev/null"
|
||||||
, TestCase "wget unclutter options" checkWgetUnclutter
|
, TestCase "wget unclutter options" checkWgetUnclutter
|
||||||
|
|
|
@ -61,18 +61,6 @@ runTests (TestCase tname t : ts) = do
|
||||||
rest <- runTests ts
|
rest <- runTests ts
|
||||||
return $ c:rest
|
return $ c:rest
|
||||||
|
|
||||||
{- Tests that a command is available, aborting if not. -}
|
|
||||||
requireCmd :: ConfigKey -> String -> Test
|
|
||||||
requireCmd k cmdline = do
|
|
||||||
ret <- testCmd k cmdline
|
|
||||||
handle ret
|
|
||||||
where
|
|
||||||
handle r@(Config _ (BoolConfig True)) = return r
|
|
||||||
handle r = do
|
|
||||||
testEnd r
|
|
||||||
error $ "** the " ++ c ++ " command is required"
|
|
||||||
c = head $ words cmdline
|
|
||||||
|
|
||||||
{- Checks if a command is available by running a command line. -}
|
{- Checks if a command is available by running a command line. -}
|
||||||
testCmd :: ConfigKey -> String -> Test
|
testCmd :: ConfigKey -> String -> Test
|
||||||
testCmd k cmdline = do
|
testCmd k cmdline = do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue