diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2021-02-21 21:23:40 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-03-20 07:48:38 -0400 |
commit | 95275a5f25a2e70b71240d4756109180486af1b1 (patch) | |
tree | eb4801bb0e00098b8b9d513479de4fbbd779ddac /hadrian/src/Rules/Test.hs | |
parent | f940fd466a86c2f8e93237b36835797be3f3c898 (diff) | |
download | haskell-95275a5f25a2e70b71240d4756109180486af1b1.tar.gz |
GHC Exactprint main commit
Metric Increase:
T10370
parsing001
Updates haddock submodule
Diffstat (limited to 'hadrian/src/Rules/Test.hs')
-rw-r--r-- | hadrian/src/Rules/Test.hs | 31 |
1 files changed, 19 insertions, 12 deletions
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 |