diff options
Diffstat (limited to 'hadrian/src/Rules')
-rw-r--r-- | hadrian/src/Rules/BinaryDist.hs | 4 | ||||
-rw-r--r-- | hadrian/src/Rules/Test.hs | 31 |
2 files changed, 21 insertions, 14 deletions
diff --git a/hadrian/src/Rules/BinaryDist.hs b/hadrian/src/Rules/BinaryDist.hs index a527664b23..8a4fd2c4ec 100644 --- a/hadrian/src/Rules/BinaryDist.hs +++ b/hadrian/src/Rules/BinaryDist.hs @@ -171,8 +171,8 @@ bindistRules = do -- other machine. need $ map (bindistFilesDir -/-) (["configure", "Makefile"] ++ bindistInstallFiles) - need $ map ((bindistFilesDir -/- "wrappers") -/-) ["check-api-annotations" - , "check-ppr", "ghc", "ghc-iserv", "ghc-pkg" + need $ map ((bindistFilesDir -/- "wrappers") -/-) + [ "check-ppr", "check-exact", "ghc", "ghc-iserv", "ghc-pkg" , "ghci-script", "haddock", "hpc", "hp2ps", "hsc2hs" , "runghc"] diff --git a/hadrian/src/Rules/Test.hs b/hadrian/src/Rules/Test.hs index b1e328368f..43982b9549 100644 --- a/hadrian/src/Rules/Test.hs +++ b/hadrian/src/Rules/Test.hs @@ -27,15 +27,20 @@ ghcConfigProgPath = "test/bin/ghc-config" <.> exe checkPprProgPath, checkPprSourcePath :: FilePath checkPprProgPath = "test/bin/check-ppr" <.> exe checkPprSourcePath = "utils/check-ppr/Main.hs" +checkPprExtra :: Maybe String +checkPprExtra = Nothing -checkApiAnnotationsProgPath, checkApiAnnotationsSourcePath :: FilePath -checkApiAnnotationsProgPath = "test/bin/check-api-annotations" <.> exe -checkApiAnnotationsSourcePath = "utils/check-api-annotations/Main.hs" +checkExactProgPath, checkExactSourcePath :: FilePath +checkExactProgPath = "test/bin/check-exact" <.> exe +checkExactSourcePath = "utils/check-exact/Main.hs" +checkExactExtra :: Maybe String +checkExactExtra = Just "-iutils/check-exact" -checkPrograms :: [(FilePath, FilePath, Package)] + +checkPrograms :: [(FilePath, FilePath, Maybe String, Package)] checkPrograms = - [ (checkPprProgPath, checkPprSourcePath, checkPpr) - , (checkApiAnnotationsProgPath, checkApiAnnotationsSourcePath, checkApiAnnotations) + [ (checkPprProgPath, checkPprSourcePath, checkPprExtra, checkPpr) + , (checkExactProgPath, checkExactSourcePath, checkExactExtra, checkExact) ] ghcConfigPath :: FilePath @@ -53,9 +58,10 @@ testRules = do -- Reasons why this is required are not entirely clear. cmd ["bash"] ["-c", ghc0Path ++ " " ++ ghcConfigHsPath ++ " -o " ++ (root -/- ghcConfigProgPath)] - -- Rules for building check-ppr and check-ppr-annotations with the compiler - -- we are going to test (in-tree or out-of-tree). - forM_ checkPrograms $ \(progPath, sourcePath, progPkg) -> + -- Rules for building check-ppr, check-exact and + -- check-ppr-annotations with the compiler we are going to test + -- (in-tree or out-of-tree). + forM_ checkPrograms $ \(progPath, sourcePath, mextra, progPkg) -> root -/- progPath %> \path -> do need [ sourcePath ] testGhc <- testCompiler <$> userSetting defaultTestArgs @@ -79,6 +85,7 @@ testRules = do cmd [bindir </> "ghc" <.> exe] $ concatMap (\p -> ["-package", pkgName p]) depsPkgs ++ ["-o", top -/- path, top -/- sourcePath] ++ + (maybe [] (\e -> [e]) mextra) ++ -- If GHC is build with debug options, then build check-ppr -- also with debug options. This allows, e.g., to print debug -- messages of various RTS subsystems while using check-ppr. @@ -125,7 +132,8 @@ testRules = do ] pythonPath <- builderPath Python - need [ root -/- checkPprProgPath, root -/- checkApiAnnotationsProgPath ] + need [ root -/- checkPprProgPath + , root -/- checkExactProgPath ] -- Set environment variables for test's Makefile. -- TODO: Ideally we would define all those env vars in 'env', so that @@ -141,8 +149,7 @@ testRules = do setEnv "TEST_HC_OPTS" ghcFlags setEnv "TEST_HC_OPTS_INTERACTIVE" ghciFlags setEnv "CHECK_PPR" (top -/- root -/- checkPprProgPath) - setEnv "CHECK_API_ANNOTATIONS" - (top -/- root -/- checkApiAnnotationsProgPath) + setEnv "CHECK_EXACT" (top -/- root -/- checkExactProgPath) -- This lets us bypass the need to generate a config -- through Make, which happens in testsuite/mk/boilerplate.mk |