Commit 38cb35e0 authored by Jan Rasmus Tikovsky 's avatar Jan Rasmus Tikovsky
Browse files

Modified testsuite due to deactivation of warnings for unused bindings

parent ac924220
......@@ -35,7 +35,7 @@ import Curry.Base.Message (Message, message, ppMessages, ppError)
import Curry.Base.Monad (CYIO, runCYIO)
import Curry.Base.Pretty (text)
import qualified CompilerOpts as CO ( Options (..), WarnOpts (..)
, Verbosity (VerbQuiet)
, WarnFlag (..), Verbosity (VerbQuiet)
, defaultOptions, defaultWarnOpts)
import CurryBuilder (buildCurry)
......@@ -50,7 +50,11 @@ runSecure act = runCYIO act `E.catch` handler
runTest :: CO.Options -> String -> [String] -> IO Progress
runTest opts test [] = passOrFail <$> runSecure (buildCurry opts' test)
where
opts' = opts { CO.optForce = True }
wOpts = CO.optWarnOpts opts
wFlags = CO.WarnUnusedBindings : CO.wnWarnFlags wOpts
opts' = opts { CO.optForce = True
, CO.optWarnOpts = wOpts { CO.wnWarnFlags = wFlags }
}
passOrFail = Finished . either fail pass
fail msgs
| null msgs = Pass
......@@ -58,7 +62,11 @@ runTest opts test [] = passOrFail <$> runSecure (buildCurry opts' test)
pass _ = Pass
runTest opts test errorMsgs = catchE <$> runSecure (buildCurry opts' test)
where
opts' = opts { CO.optForce = True }
wOpts = CO.optWarnOpts opts
wFlags = CO.WarnUnusedBindings : CO.wnWarnFlags wOpts
opts' = opts { CO.optForce = True
, CO.optWarnOpts = wOpts { CO.wnWarnFlags = wFlags }
}
catchE = Finished . either pass fail
pass msgs = let errorStr = showMessages msgs
in if all (`isInfixOf` errorStr) errorMsgs
......
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