Skip to content

Commit

Permalink
Capture the debug buffer for each spec. We can use this to show debug
Browse files Browse the repository at this point in the history
information in other runners, like the TestBox CLI runner.
  • Loading branch information
elpete committed Sep 6, 2024
1 parent 5b9cdd5 commit 45ecb70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions system/BaseSpec.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,7 @@ component {
specStats.failExtendedInfo = e.extendedInfo;
specStats.failStacktrace = e.stackTrace;
specStats.failOrigin = e.tagContext;
specStats.debugBuffer = duplicate( this.$debugBuffer );

// Increment recursive pass stats
arguments.testResults.incrementSpecStat( type = "fail", stats = specStats );
Expand Down Expand Up @@ -1030,6 +1031,7 @@ component {
specStats.failDetail = e.detail;
specStats.failExtendedInfo = e.extendedInfo;
specStats.failStacktrace = e.stackTrace;
specStats.debugBuffer = duplicate( this.$debugBuffer );

// Increment recursive pass stats
arguments.testResults.incrementSpecStat( type = "error", stats = specStats );
Expand Down Expand Up @@ -1356,6 +1358,7 @@ component {
specStats.failExtendedInfo = e.extendedInfo;
specStats.failStacktrace = e.stackTrace;
specStats.failOrigin = e.tagContext;
specStats.debugBuffer = duplicate( this.$debugBuffer );

// Increment recursive pass stats
arguments.testResults.incrementSpecStat( type = "fail", stats = specStats );
Expand Down
4 changes: 3 additions & 1 deletion system/TestResult.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@ component accessors="true" {
// the failure stack trace
"failStacktrace" : "",
// the failure origin
"failOrigin" : {}
"failOrigin" : {},
// the debug buffer
"debugBuffer" : []
};

// append to the parent stats
Expand Down

0 comments on commit 45ecb70

Please sign in to comment.