@@ -43,6 +43,10 @@ const DISPLAY_FAILED = (
43
43
44
44
const FAIL_FAST = Ref {Bool} (false )
45
45
46
+ const record_passes = OncePerProcess {Bool} () do
47
+ return Base. get_bool_env (" JULIA_TEST_RECORD_PASSES" , false )
48
+ end
49
+
46
50
# -----------------------------------------------------------------------
47
51
48
52
# Backtrace utility functions
@@ -1100,8 +1104,18 @@ struct FailFastError <: Exception end
1100
1104
1101
1105
# For a broken result, simply store the result
1102
1106
record (ts:: DefaultTestSet , t:: Broken ) = (push! (ts. results, t); t)
1103
- # For a passed result, do not store the result since it uses a lot of memory
1104
- record (ts:: DefaultTestSet , t:: Pass ) = (ts. n_passed += 1 ; t)
1107
+ # For a passed result, do not store the result since it uses a lot of memory, unless
1108
+ # `record_passes()` is true. i.e. set env var `JULIA_TEST_RECORD_PASSES=true` before running any testsets
1109
+ function record (ts:: DefaultTestSet , t:: Pass )
1110
+ ts. n_passed += 1
1111
+ if record_passes ()
1112
+ # throw away the captured data so it can be GC-ed
1113
+ t_nodata = Pass (t. test_type, t. orig_expr, nothing , t. value, t. source, t. message_only)
1114
+ push! (ts. results, t_nodata)
1115
+ return t_nodata
1116
+ end
1117
+ return t
1118
+ end
1105
1119
1106
1120
# For the other result types, immediately print the error message
1107
1121
# but do not terminate. Print a backtrace.
0 commit comments