[Git][ghc/ghc][master] testsuite: Implement `isInTreeCompiler` in a more robust way

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Sat Jan 20 17:21:18 UTC 2024



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
09875f48 by Matthew Pickering at 2024-01-20T12:20:44-05:00
testsuite: Implement `isInTreeCompiler` in a more robust way

Just a small refactoring to avoid redundantly specifying the same
strings in two different places.

- - - - -


2 changed files:

- hadrian/src/Oracles/TestSettings.hs
- hadrian/src/Rules/Test.hs


Changes:

=====================================
hadrian/src/Oracles/TestSettings.hs
=====================================
@@ -111,7 +111,7 @@ getCompilerPath "stage-cabal" = do
 getCompilerPath compiler = pure compiler
 
 isInTreeCompiler :: String -> Bool
-isInTreeCompiler c = c `elem` ["stage1","stage2","stage3"]
+isInTreeCompiler c = isJust (stageOfTestCompiler c)
 
 -- | Get the full path to the given program.
 fullPath :: Stage -> Package -> Action FilePath


=====================================
hadrian/src/Rules/Test.hs
=====================================
@@ -304,7 +304,7 @@ testRules = do
 -- We should have built them already by this point, but
 isOkToBuild :: TestArgs -> String -> Bool
 isOkToBuild args target
-   = isJust (stageOf (testCompiler args))
+   = isInTreeCompiler (testCompiler args)
   || testHasInTreeFiles args
   || target `elem` map cp_target checkPrograms
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/09875f48687388e63fdb2179709e1a963e1d6178

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/09875f48687388e63fdb2179709e1a963e1d6178
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240120/c06a5813/attachment-0001.html>


More information about the ghc-commits mailing list