diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-12-31 16:08:31 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-12-31 16:36:39 -0400 |
commit | 8f3134e5408ea1ea6207028ae17f2b5fb84e0c65 (patch) | |
tree | 99739954cd6b8a3c229a230f005d69f6ed74fb8c /Test.hs | |
parent | 6f83a6c8f45d7aa325d315654c4fd28de9feb4a6 (diff) |
finally really add back custom-setup stanza
Fourth or fifth try at this and finally found a way to make it work.
Absurd amount of busy-work forced on me by change in cabal's behavior.
Split up Utility modules that need posix stuff out of ones used by
Setup. Various other hacks around inability for Setup to use anything
that ifdefs a use of unix.
Probably lost a full day of my life to this.
This is how build systems make their users hate them. Just saying.
Diffstat (limited to 'Test.hs')
-rw-r--r-- | Test.hs | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -83,6 +83,7 @@ import qualified Utility.Process import qualified Utility.Misc import qualified Utility.InodeCache import qualified Utility.Env +import qualified Utility.Env.Set import qualified Utility.Matcher import qualified Utility.Exception import qualified Utility.Hash @@ -91,7 +92,7 @@ import qualified Utility.Scheduled.QuickCheck import qualified Utility.HumanTime import qualified Utility.ThreadScheduler import qualified Utility.Base64 -import qualified Utility.Tmp +import qualified Utility.Tmp.Dir import qualified Utility.FileSystemEncoding import qualified Command.Uninit import qualified CmdLine.GitAnnex as GitAnnex @@ -130,7 +131,7 @@ runner = Just go subenv = "GIT_ANNEX_TEST_SUBPROCESS" runsubprocesstests opts Nothing = do pp <- Annex.Path.programPath - Utility.Env.setEnv subenv "1" True + Utility.Env.Set.setEnv subenv "1" True ps <- getArgs (Nothing, Nothing, Nothing, pid) <-createProcess (proc pp ps) exitcode <- waitForProcess pid @@ -356,7 +357,7 @@ test_log = intmpclonerepo $ do git_annex "log" [annexedfile] @? "log failed" test_import :: Assertion -test_import = intmpclonerepo $ Utility.Tmp.withTmpDir "importtest" $ \importdir -> do +test_import = intmpclonerepo $ Utility.Tmp.Dir.withTmpDir "importtest" $ \importdir -> do (toimport1, importf1, imported1) <- mktoimport importdir "import1" git_annex "import" [toimport1] @? "import failed" annexed_present_imported imported1 @@ -1917,11 +1918,11 @@ ensuretmpdir = do {- Prevent global git configs from affecting the test suite. -} isolateGitConfig :: IO a -> IO a -isolateGitConfig a = Utility.Tmp.withTmpDir "testhome" $ \tmphome -> do +isolateGitConfig a = Utility.Tmp.Dir.withTmpDir "testhome" $ \tmphome -> do tmphomeabs <- absPath tmphome - Utility.Env.setEnv "HOME" tmphomeabs True - Utility.Env.setEnv "XDG_CONFIG_HOME" tmphomeabs True - Utility.Env.setEnv "GIT_CONFIG_NOSYSTEM" "1" True + Utility.Env.Set.setEnv "HOME" tmphomeabs True + Utility.Env.Set.setEnv "XDG_CONFIG_HOME" tmphomeabs True + Utility.Env.Set.setEnv "GIT_CONFIG_NOSYSTEM" "1" True a cleanup :: FilePath -> IO () @@ -1933,7 +1934,7 @@ cleanup dir = whenM (doesDirectoryExist dir) $ do finalCleanup :: IO () finalCleanup = whenM (doesDirectoryExist tmpdir) $ do - Utility.Misc.reapZombies + Annex.Action.reapZombies Command.Uninit.prepareRemoveAnnexDir' tmpdir catchIO (removeDirectoryRecursive tmpdir) $ \e -> do print e @@ -1941,7 +1942,7 @@ finalCleanup = whenM (doesDirectoryExist tmpdir) $ do Utility.ThreadScheduler.threadDelaySeconds $ Utility.ThreadScheduler.Seconds 10 whenM (doesDirectoryExist tmpdir) $ do - Utility.Misc.reapZombies + Annex.Action.reapZombies removeDirectoryRecursive tmpdir checklink :: FilePath -> Assertion @@ -2107,7 +2108,7 @@ setTestMode testmode = do currdir <- getCurrentDirectory p <- Utility.Env.getEnvDefault "PATH" "" - mapM_ (\(var, val) -> Utility.Env.setEnv var val True) + mapM_ (\(var, val) -> Utility.Env.Set.setEnv var val True) -- Ensure that the just-built git annex is used. [ ("PATH", currdir ++ [searchPathSeparator] ++ p) , ("TOPDIR", currdir) |