From 8c9d8ddefadeee159cdc93f985e8bca5ce70e6d8 Mon Sep 17 00:00:00 2001 From: ijones Date: Sun, 16 Oct 2005 03:57:01 +0000 Subject: [PATCH] cleaned up test suite --- Distribution/Program.hs | 1 + Distribution/Setup.hs | 2 +- Distribution/Simple/Install.hs | 4 ++-- tests/ModuleTest.hs | 2 +- tests/depOnLib/test.cabal | 2 +- tests/withHooks/Setup.lhs | 21 +++++++++++---------- 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Distribution/Program.hs b/Distribution/Program.hs index 49bc1ef476d..04dcd9200a1 100644 --- a/Distribution/Program.hs +++ b/Distribution/Program.hs @@ -69,6 +69,7 @@ defaultProgramConfiguration :: ProgramConfiguration defaultProgramConfiguration = progListToFM [ haddockProgram , pfesetupProgram] +-- FIXME: Add ranlib! -- haddock is currently the only one that really works. {- [ ghcProgram , ghcPkgProgram diff --git a/Distribution/Setup.hs b/Distribution/Setup.hs index c3d63ad36f8..2e3f29a2ad4 100644 --- a/Distribution/Setup.hs +++ b/Distribution/Setup.hs @@ -135,7 +135,7 @@ data ConfigFlags = ConfigFlags { emptyConfigFlags :: ConfigFlags emptyConfigFlags = ConfigFlags { configPrograms = defaultProgramConfiguration, - configHcFlavor = Nothing, + configHcFlavor = defaultCompilerFlavor, configHcPath = Nothing, configHcPkg = Nothing, -- configHaddock = EmptyLocation, diff --git a/Distribution/Simple/Install.hs b/Distribution/Simple/Install.hs index e27164b9b9a..066ea55d3cf 100644 --- a/Distribution/Simple/Install.hs +++ b/Distribution/Simple/Install.hs @@ -144,8 +144,8 @@ installLibGHC verbose hasProf hasGHCi pref buildPref pd@PackageDescription{libra -- don't worry too much about it. mRanlibLoc <- findExecutable "ranlib" case mRanlibLoc of - Just ranLibLoc -> do rawSystemVerbose verbose "ranlib" [libTargetLoc] - ifProf $ rawSystemVerbose verbose "ranlib" [profLibTargetLoc] + Just ranLibLoc -> do rawSystemVerbose verbose ranLibLoc [libTargetLoc] + ifProf $ rawSystemVerbose verbose ranLibLoc [profLibTargetLoc] return () Nothing -> do mArLoc <- findExecutable "ar" case mArLoc of diff --git a/tests/ModuleTest.hs b/tests/ModuleTest.hs index 2db18406255..4577469cfcc 100644 --- a/tests/ModuleTest.hs +++ b/tests/ModuleTest.hs @@ -185,7 +185,7 @@ tests currDir comp compConf = [ doesFileExist ",tmp/bin/testB" >>= assertBool "testB not produced" assertCmd' compCmd "sdist" "setup sdist returned error code" - doesFileExist "dist/test-1.0.tgz" >>= + doesFileExist "dist/test-1.0.tar.gz" >>= assertBool "sdist did not put the expected file in place" doesFileExist "dist/src" >>= assertEqual "dist/src exists" False diff --git a/tests/depOnLib/test.cabal b/tests/depOnLib/test.cabal index cc368a39d74..4da7478ee38 100644 --- a/tests/depOnLib/test.cabal +++ b/tests/depOnLib/test.cabal @@ -9,5 +9,5 @@ exposed-modules: A Executable: mainForA Other-Modules: Main, A -hs-source-dir: mains +hs-source-dirs: mains, libs Main-is: Main.hs diff --git a/tests/withHooks/Setup.lhs b/tests/withHooks/Setup.lhs index a94182c29be..602b9f8d2a7 100644 --- a/tests/withHooks/Setup.lhs +++ b/tests/withHooks/Setup.lhs @@ -6,6 +6,7 @@ > import Distribution.PackageDescription (PackageDescription, > readPackageDescription, readHookedBuildInfo) > import Distribution.Simple.Configure(LocalBuildInfo(..)) +> import Distribution.Setup(CopyFlags, CopyDest(..)) > import Distribution.Compat.Directory (copyFile) > import Distribution.Compat.FilePath(joinPaths) > import Distribution.Simple.Utils (defaultHookedPackageDesc) @@ -36,18 +37,18 @@ > writeFile outFile ("-- this file has been preprocessed as a test\n\n" ++ stuff) > return ExitSuccess -> testing :: Args -> Bool -> a -> IO ExitCode -> testing [] _ _ = return ExitSuccess -> testing a@(h:_) _ _ = do putStrLn $ "testing: " ++ (show a) -> if h == "--pass" -> then return ExitSuccess -> else return (ExitFailure 1) +> testing :: Args -> Bool -> a -> b -> IO ExitCode +> testing [] _ _ _ = return ExitSuccess +> testing a@(h:_) _ _ _ = do putStrLn $ "testing: " ++ (show a) +> if h == "--pass" +> then return ExitSuccess +> else return (ExitFailure 1) > myCopyHook :: PackageDescription > -> LocalBuildInfo -> -> (Maybe FilePath,Int) -- ^install-prefix, verbose +> -> CopyFlags -- ^install-prefix, verbose > -> IO () -> myCopyHook a b c@((Just p), _) = do +> myCopyHook a b c@((CopyPrefix p), _) = do > createDirectoryIfMissing True p > copyFile (foldl1 joinPaths ["dist", "build", "withHooks", "withHooks"]) > (p `joinPaths` "withHooks") @@ -60,8 +61,8 @@ Override "gc" to test the overriding mechanism. > main = defaultMainWithHooks defaultUserHooks > {preConf=myPreConf, > runTests=testing, -> postConf=(\_ _ _-> return ExitSuccess), +> postConf=(\_ _ _ _ -> return ExitSuccess), > hookedPreProcessors= [("testSuffix", ppTestHandler), ("gc", ppTestHandler)], -> postClean=(\_ _ _ -> removeFile "Setup.buildinfo" >> return ExitSuccess), +> postClean=(\_ _ _ _ -> removeFile "Setup.buildinfo" >> return ExitSuccess), > copyHook=myCopyHook > }