-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use single conf.verb
, warn users on zero-address use
#686
Conversation
04216a2
to
7b87a4e
Compare
passOutput :: VM t s -> UnitTestOptions s -> Text -> Text | ||
passOutput vm UnitTestOptions { .. } testName = | ||
let ?context = DappContext { info = dapp | ||
, contracts = vm.env.contracts | ||
, labels = vm.labels } | ||
in let v = fromMaybe 0 verbose | ||
in if (v > 1) then | ||
mconcat | ||
[ "Success: " | ||
, fromMaybe "" (stripSuffix "()" testName) | ||
, "\n" | ||
, if (v > 2) then indentLines 2 (showTraceTree dapp vm) else "" | ||
, indentLines 2 (formatTestLogs dapp.eventMap vm.logs) | ||
, "\n" | ||
] | ||
else "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used anywhere, removing.
@@ -59,7 +59,6 @@ testOpts solvers root buildOutput match maxIter allowFFI rpcinfo = do | |||
, askSmtIters = 1 | |||
, smtTimeout = Nothing | |||
, solver = Nothing | |||
, verbose = Just 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now conf
and in cli.hs is set to by default 1. In API library use mode it's set to 0 by default.
88870e5
to
7a75500
Compare
conf.verb
, warn users on zero-address useconf.verb
, warn users on zero-address use
65a1161
to
d412468
Compare
Fixing up tests, strings
d412468
to
5640901
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT!
Description
This attempts to fix #671
We need to add a general verbosity flag, otherwise libraries that use us will have all sorts of junk printed on the console. Default is zero (is it's seamless for libraries), but we set it to 1 when running from the command line.
Note:
hevm test
's--verbosity
flag has been rolled into this, and it is now part ofApp
rather thanUnitTestOptions
. This makes it more general, and makes it such that global options are truly in a single place (App
).The
hevm test --verbose X
seems to have been broken. When it wasNothing
, then nothing extra was printed, but when it wasJust
then stuff got printed. However, the description seems to have talked about a difference between1
and2
levels. This doesn't seem to exist. Now it's set to print more failure info when it's2
or above. This preserves the default "silent" operation when running from the command line (where verbosity is 1 by default).Checklist