This repository has been archived by the owner on Aug 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove more validation errors (#628)
* Improved GhcCabal library arguments * setting enviornment for extra programs * Copied necessary programs * Added support to generate ghcconfig We will need it for properly configuring python command Some revisions * Using ghcconfig file for test parameters * minor changes * minor revision * Update Ghc.hs
- Loading branch information
1 parent
233a638
commit d4b9c1f
Showing
6 changed files
with
170 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
-- | We create a file <root>/test/ghcconfig containing configuration of test | ||
-- | compiler. We need to search this file for required keys and setting | ||
-- | required for testsuite e.g. WORDSIZE, HOSTOS etc. | ||
|
||
module Oracles.TestSettings ( | ||
TestSetting (..), testSetting, testRTSSettings | ||
) where | ||
|
||
import Hadrian.Oracles.TextFile | ||
import Base | ||
|
||
testConfigFile :: Action FilePath | ||
testConfigFile = buildRoot <&> (-/- "test/ghcconfig") | ||
|
||
-- | Test settings that are obtained from ghcconfig file. | ||
data TestSetting = TestHostOS | ||
| TestWORDSIZE | ||
| TestTARGETPLATFORM | ||
| TestTargetOS_CPP | ||
| TestTargetARCH_CPP | ||
| TestGhcStage | ||
| TestGhcDebugged | ||
| TestGhcWithNativeCodeGen | ||
| TestGhcWithInterpreter | ||
| TestGhcUnregisterised | ||
| TestGhcWithSMP | ||
| TestGhcDynamicByDefault | ||
| TestGhcDynamic | ||
| TestGhcProfiled | ||
| TestAR | ||
| TestCLANG | ||
| TestLLC | ||
| TestTEST_CC | ||
| TestGhcPackageDbFlag | ||
| TestMinGhcVersion711 | ||
| TestMinGhcVersion801 | ||
deriving (Show) | ||
|
||
-- | Lookup for testsettings in ghcconfig file | ||
-- | To obtain RTS Ways supported in ghcconfig file, use testRTSSettings. | ||
testSetting :: TestSetting -> Action String | ||
testSetting key = do | ||
file <- testConfigFile | ||
lookupValueOrError file $ case key of | ||
TestHostOS -> "HostOS" | ||
TestWORDSIZE -> "WORDSIZE" | ||
TestTARGETPLATFORM -> "TARGETPLATFORM" | ||
TestTargetOS_CPP -> "TargetOS_CPP" | ||
TestTargetARCH_CPP -> "TargetARCH_CPP" | ||
TestGhcStage -> "GhcStage" | ||
TestGhcDebugged -> "GhcDebugged" | ||
TestGhcWithNativeCodeGen -> "GhcWithNativeCodeGen" | ||
TestGhcWithInterpreter -> "GhcWithInterpreter" | ||
TestGhcUnregisterised -> "GhcUnregisterised" | ||
TestGhcWithSMP -> "GhcWithSMP" | ||
TestGhcDynamicByDefault -> "GhcDynamicByDefault" | ||
TestGhcDynamic -> "GhcDynamic" | ||
TestGhcProfiled -> "GhcProfiled" | ||
TestAR -> "AR" | ||
TestCLANG -> "CLANG" | ||
TestLLC -> "LLC" | ||
TestTEST_CC -> "TEST_CC" | ||
TestGhcPackageDbFlag -> "GhcPackageDbFlag" | ||
TestMinGhcVersion711 -> "MinGhcVersion711" | ||
TestMinGhcVersion801 -> "MinGhcVersion801" | ||
|
||
|
||
-- | Get the RTS ways of the test compiler | ||
testRTSSettings :: Action [String] | ||
testRTSSettings = do | ||
file <- testConfigFile | ||
fmap words $ lookupValueOrError file "GhcRTSWays" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters