From 45ecb7018e72482a48b423e5d9154c291ecfe93c Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Thu, 5 Sep 2024 21:15:50 -0600 Subject: [PATCH] Capture the debug buffer for each spec. We can use this to show debug information in other runners, like the TestBox CLI runner. --- system/BaseSpec.cfc | 3 +++ system/TestResult.cfc | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/system/BaseSpec.cfc b/system/BaseSpec.cfc index f83a97d..2d9b153 100644 --- a/system/BaseSpec.cfc +++ b/system/BaseSpec.cfc @@ -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 ); @@ -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 ); @@ -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 ); diff --git a/system/TestResult.cfc b/system/TestResult.cfc index cd8d942..cb06619 100644 --- a/system/TestResult.cfc +++ b/system/TestResult.cfc @@ -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