Skip to content

Commit 51a847a

Browse files
committed
Print total calls as part of the stats on exit
Echidna will now print the number of calls done as part of the stats printed when exiting. Unique instructions: 287 Unique codehashes: 1 Corpus size: 1 Seed: 830942768189866820 Total calls: 10 Closes #1322
1 parent 6d5ac38 commit 51a847a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/Echidna/UI/Report.hs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ ppCampaignEventLog vm ev = (ppCampaignEvent ev <>) <$> ppTxIfHas where
4343
(WorkerEvent _ _ (TestFalsified test)) -> ("\n Call sequence:\n" <>) . unlines <$> mapM (ppTx vm $ length (nub $ (.src) <$> test.reproducer) /= 1) test.reproducer
4444
_ -> pure ""
4545

46+
ppTotalCalls :: [WorkerState] -> String
47+
ppTotalCalls workerStates = "Total calls: " <> show calls
48+
where
49+
calls = sum $ (.ncalls) <$> workerStates
50+
4651
ppCampaign :: (MonadIO m, MonadReader Env m) => VM Concrete RealWorld -> [WorkerState] -> m String
4752
ppCampaign vm workerStates = do
4853
tests <- liftIO . traverse readIORef =<< asks (.testRefs)
@@ -51,12 +56,14 @@ ppCampaign vm workerStates = do
5156
coveragePrinted <- ppCoverage
5257
let seedPrinted = "Seed: " <> show (head workerStates).genDict.defSeed
5358
corpusPrinted <- ppCorpus
59+
let callsPrinted = ppTotalCalls workerStates
5460
pure $ unlines
5561
[ testsPrinted
5662
, gasInfoPrinted
5763
, coveragePrinted
5864
, corpusPrinted
5965
, seedPrinted
66+
, callsPrinted
6067
]
6168

6269
-- | Given rules for pretty-printing associated addresses, and whether to print

0 commit comments

Comments
 (0)