Skip to content

Commit

Permalink
Log number of tests and test distribution on property test pass
Browse files Browse the repository at this point in the history
  • Loading branch information
rynoV committed Jan 6, 2025
1 parent 37098eb commit 47d15bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Expecto.FsCheck/FsCheck.fs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ module ExpectoFsCheck =
| xs -> sprintf "%s\n" (String.concat "\n" xs)

match testResult with
| TestResult.True (_testData,_b) -> ()
| TestResult.True (data, suppressOutput) ->
if not suppressOutput && config.logger.IsSome then
config.logger.Value.log Logging.LogLevel.Info (Logging.Message.eventX $"Passed {numTests data.NumberOfTests}.\n{stampsToString data.Stamps}") |> Async.RunSynchronously

| TestResult.False (_,_,_, Outcome.Exception (:? IgnoreException as e),_) ->
raise e
Expand Down
4 changes: 3 additions & 1 deletion Expecto.FsCheck3/FsCheck3.fs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ module ExpectoFsCheck =
| xs -> sprintf "%s\n" (String.concat "\n" xs)

match testResult with
| TestResult.Passed (_testData,_b) -> ()
| TestResult.Passed (data, suppressOutput) ->
if not suppressOutput && config.logger.IsSome then
config.logger.Value.log Logging.LogLevel.Info (Logging.Message.eventX $"Passed {numTests data.NumberOfTests}.\n{stampsToString data.Stamps}") |> Async.RunSynchronously

| TestResult.Failed (_,_,_, Outcome.Failed (:? IgnoreException as e),_,_,_) ->
raise e
Expand Down

0 comments on commit 47d15bb

Please sign in to comment.