From f8acb77e6b9d6df2b6a4e5f1c0765812ab6aa2bb Mon Sep 17 00:00:00 2001 From: Nikolay Yakimov Date: Sun, 28 Aug 2016 23:33:40 +0300 Subject: [PATCH] [Test] Use git to clean test/data/ --- test/Main.hs | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/test/Main.hs b/test/Main.hs index fd0dc77..5afd64d 100644 --- a/test/Main.hs +++ b/test/Main.hs @@ -4,7 +4,6 @@ import Dir import Control.Exception as E import Control.Monad (void) -import Data.List import Language.Haskell.GhcMod (debugInfo) import System.Process import System.Environment @@ -29,31 +28,15 @@ main = do , "test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d"] genGhcPkgCache dir = system $ "ghc-pkg recache --force -f" ++ dir - genSandboxCfg `mapM_` sandboxes - genGhcPkgCache `mapM_` pkgDirs - - let caches = [ "setup-config" - , "setup-config.ghc-mod.cabal-helper" - , "setup-config.ghc-mod.cabal-components" - , "setup-config.ghc-mod.resolved-components" - , "setup-config.ghc-mod.package-options" - , "setup-config.ghc-mod.package-db-stack" - , "ghc-mod.cache" - ] - findExp = unwords $ intersperse "-o " $ concat [ - stackWorkFindExp, - cachesFindExp - ] - cachesFindExp = map ("-name "++) caches - stackWorkFindExp = ["-name .stack-work -type d"] - - cleanCmd = "find test \\( "++ findExp ++" \\) -exec rm -r {} \\;" - + let cleanCmd = "git clean -dxf test/data/" putStrLn $ "$ " ++ cleanCmd void $ system cleanCmd void $ system "cabal --version" void $ system "ghc --version" + genSandboxCfg `mapM_` sandboxes + genGhcPkgCache `mapM_` pkgDirs + let stackDir = "test/data/stack-project" void $ withDirectory_ stackDir $ do let ghcver = let gvn = show (__GLASGOW_HASKELL__ :: Int)