diff options
author | Thomas Miedema <thomasmiedema@gmail.com> | 2016-01-29 05:19:46 +0100 |
---|---|---|
committer | Thomas Miedema <thomasmiedema@gmail.com> | 2016-01-29 05:26:55 +0100 |
commit | 1b72534b99ea17012746ef97b4892a7c9c3450dd (patch) | |
tree | 4a6a9bcd069aff65159270f13a8f24f62a6c7537 /testsuite | |
parent | 63700a193557ed63a1da18a6a059cb7ec5596796 (diff) | |
download | haskell-1b72534b99ea17012746ef97b4892a7c9c3450dd.tar.gz |
Fixup test for #10728
It was failing for WAY=ghci.
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/rts/T10728.hs | 16 | ||||
-rw-r--r-- | testsuite/tests/rts/all.T | 4 |
2 files changed, 8 insertions, 12 deletions
diff --git a/testsuite/tests/rts/T10728.hs b/testsuite/tests/rts/T10728.hs index ff005faa63..a7c3d796f5 100644 --- a/testsuite/tests/rts/T10728.hs +++ b/testsuite/tests/rts/T10728.hs @@ -4,13 +4,13 @@ module Main where import GHC.Conc (getNumProcessors, getNumCapabilities) import GHC.Environment -import Data.Char +import Data.List main :: IO () main = do -- We're parsing args passed in to make sure things are proper between the -- cli and the program. - n <- getN + n <- getN <$> getFullArgs c <- getNumCapabilities p <- getNumProcessors @@ -30,11 +30,7 @@ check n c p check _n _c _p = "maxN Error" -- Parsing ``-maxN<n>`` from Args to be sure of it. -getN :: IO Int -getN = getFullArgs >>= return . go - where - go :: [String] -> Int - go as = case reads ( - dropWhile (not . isDigit) . (!! 2) $ as ) :: [(Int, String)] of - [x] -> fst x - _ -> 0 +getN :: [String] -> Int +getN args = case filter (isPrefixOf "-maxN") (reverse args) of + (maxN:_) -> read (drop 5 maxN) + _ -> error "Please pass `-maxN<n>` on command-line" diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T index 951acbe4b3..5aa296a3b9 100644 --- a/testsuite/tests/rts/all.T +++ b/testsuite/tests/rts/all.T @@ -333,5 +333,5 @@ test('T10590', [ignore_output, when(opsys('mingw32'),skip)], compile_and_run, [' test('T10904', [ omit_ways(['ghci']), extra_run_opts('20000') ], compile_and_run, ['T10904lib.c']) -test('T10728', [extra_run_opts('+RTS -maxN3 -RTS'), req_smp], - compile_and_run, ['-threaded']) +test('T10728', [extra_run_opts('+RTS -maxN3 -RTS'), only_ways(['threaded2'])], + compile_and_run, ['']) |