Commit b3cfe9c4 authored by Ben Gamari's avatar Ben Gamari 🐢

Make sure that overlapping configuration doesn't break

parent 491e9d95
......@@ -9,6 +9,7 @@ import Control.Monad
import Data.Char
import Data.List
import Data.Maybe
import qualified Data.Map.Strict as M
import Data.Time.Clock
import qualified System.Directory as IO
import qualified Data.ByteString.Char8 as BS
......@@ -353,8 +354,17 @@ runTest nofib@Build{run=Just speed,..} test = do
-- | Given the source of a Makefile, slurp out the configuration strings.
convertConfig :: [String] -> [String]
convertConfig xs = [remap a ++ " = " ++ b | x <- xs, let (a,b) = separate x, a `elem` keep]
convertConfig xs =
[ k ++ " = " ++ v
| (k, v) <- M.toList vars
]
where
vars =
M.fromListWith (\a b -> a ++ " " ++ b)
[ (remap a, b)
| x <- xs
, let (a,b) = separate x, a `elem` keep
]
keep = words "PROG_ARGS SRC_HC_OPTS SRC_RUNTEST_OPTS SLOW_OPTS NORM_OPTS FAST_OPTS STDIN_FILE"
remap "SRC_RUNTEST_OPTS" = "PROG_ARGS"
remap x = x
......
......@@ -18,6 +18,7 @@ executable nofib-run
other-extensions: RecordWildCards, DeriveDataTypeable
build-depends: base >=4.11 && <4.12,
time >=1.8 && <1.9,
containers,
bytestring,
directory >=1.3 && <1.4,
process >=1.6 && <1.7,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment