Skip to content

Commit

Permalink
Fixing verbosity
Browse files Browse the repository at this point in the history
  • Loading branch information
msooseth committed Oct 25, 2023
1 parent 8a3e60f commit 016f3ec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions cli/cli.hs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ data Command w
, maxIterations :: w ::: Maybe Integer <?> "Number of times we may revisit a particular branching point"
, solver :: w ::: Maybe Text <?> "Used SMT solver: z3 (default) or cvc5"
, smtdebug :: w ::: Bool <?> "Print smt queries sent to the solver"
, verbose :: w ::: Maybe Bool <?> "More verbose printing of internal behaviour"
, verbose :: w ::: Maybe Int <?> "Verbose printing of internal behaviour (default:0)"
, assertions :: w ::: Maybe [Word256] <?> "Comma separated list of solc panic codes to check for (default: user defined assertion violations only)"
, askSmtIterations :: w ::: Integer <!> "1" <?> "Number of times we may revisit a particular branching point before we consult the smt solver to check reachability (default: 1)"
, numSolvers :: w ::: Maybe Natural <?> "Number of solver instances to use (default: number of cpu cores)"
Expand All @@ -105,7 +105,7 @@ data Command w
, solver :: w ::: Maybe Text <?> "Used SMT solver: z3 (default) or cvc5"
, smtoutput :: w ::: Bool <?> "Print verbose smt output"
, smtdebug :: w ::: Bool <?> "Print smt queries sent to the solver"
, verbose :: w ::: Maybe Bool <?> "More verbose printing of internal behaviour"
, verbose :: w ::: Maybe Int <?> "Verbose printing of internal behaviour (default:0)"
, trace :: w ::: Bool <?> "Dump trace"
, askSmtIterations :: w ::: Integer <!> "1" <?> "Number of times we may revisit a particular branching point before we consult the smt solver to check reachability (default: 1)"
, loopDetectionHeuristic :: w ::: LoopHeuristic <!> "StackBased" <?> "Which heuristic should be used to determine if we are in a loop: StackBased (default) or Naive"
Expand Down Expand Up @@ -147,7 +147,7 @@ data Command w
, match :: w ::: Maybe String <?> "Test case filter - only run methods matching regex"
, solver :: w ::: Maybe Text <?> "Used SMT solver: z3 (default) or cvc5"
, smtdebug :: w ::: Bool <?> "Print smt queries sent to the solver"
, verbose :: w ::: Maybe Bool <?> "More verbose printing of internal behaviour"
, verbose :: w ::: Maybe Int <?> "Verbose printing of internal behaviour (default:0)"
, trace :: w ::: Bool <?> "Dump trace"
, ffi :: w ::: Bool <?> "Allow the usage of the hevm.ffi() cheatcode (WARNING: this allows test authors to execute arbitrary code on your machine)"
, smttimeout :: w ::: Maybe Natural <?> "Timeout given to SMT solver in seconds (default: 300)"
Expand Down Expand Up @@ -193,7 +193,7 @@ main = do
cmd <- Options.unwrapRecord "hevm -- Ethereum evaluator"
let env = Env { config = defaultConfig
{ dumpQueries = cmd.smtdebug
, verbose = fromMaybe False cmd.verbose
, verbose = fromMaybe 0 cmd.verbose
, abstRefineMem = cmd.abstractMemory
, abstRefineArith = cmd.abstractArithmetic
, dumpTrace = cmd.trace
Expand Down Expand Up @@ -595,7 +595,7 @@ unitTestOptions cmd solvers buildOutput = do
, askSmtIters = cmd.askSmtIterations
, smtTimeout = cmd.smttimeout
, solver = cmd.solver
, verbose = cmd.verbose
, verbose = fromMaybe 0 cmd.verbose
, match = T.pack $ fromMaybe ".*" cmd.match
, testParams = params
, dapp = srcInfo
Expand Down
4 changes: 2 additions & 2 deletions src/EVM/Effects.hs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ data Config = Config
{ dumpQueries :: Bool
, dumpExprs :: Bool
, dumpEndStates :: Bool
, verbose :: Bool
, verbose :: Int
, abstRefineArith :: Bool
, abstRefineMem :: Bool
, dumpTrace :: Bool
Expand All @@ -58,7 +58,7 @@ defaultConfig = Config
{ dumpQueries = False
, dumpExprs = False
, dumpEndStates = False
, verbose = False
, verbose = 0
, abstRefineArith = False
, abstRefineMem = False
, dumpTrace = False
Expand Down
4 changes: 2 additions & 2 deletions test/test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ testEnv = Env { config = defaultConfig {
dumpQueries = False
, dumpExprs = False
, dumpEndStates = False
, verbose = False
, verbose = 0
, abstRefineArith = False
, abstRefineMem = False
, dumpTrace = False
Expand Down Expand Up @@ -3122,7 +3122,7 @@ tests = testGroup "hevm"
start <- liftIO $ getCurrentTime
putStrLnM $ "Checking file: " <> f
conf <- readConfig
when conf.verbose $ liftIO $ do
when (conf.verbose > 0) $ liftIO $ do
putStrLnM "-------------Original Below-----------------"
mapM_ putStrLn unfiltered
putStrLnM "------------- Filtered A + Symb below-----------------"
Expand Down

0 comments on commit 016f3ec

Please sign in to comment.