Skip to content

Commit

Permalink
Added a log that will always fire after test reporters
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdp committed Jan 13, 2025
1 parent 4227065 commit 9b80589
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bsc-plugin/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ async function main() {
await telnet.activate();
await telnet.connect();

const failRegex = /RESULT: Fail/g;
const endRegex = /\[END TEST REPORT\]/g;
const failRegex = /\[Rooibos Result\]: (FAIL|PASS)/g;
const endRegex = /\[Rooibos Shutdown\]/g;

async function doExit(emitAppExit = false) {
if (emitAppExit) {
Expand All @@ -82,7 +82,9 @@ async function main() {
//check for Fails or Crashes
let failMatches = failRegex.exec(output);
if (failMatches && failMatches.length > 0) {
currentErrorCode = 1;
if (failMatches[1] === 'FAIL') {
currentErrorCode = 1;
}
}

let endMatches = endRegex.exec(output);
Expand Down
7 changes: 7 additions & 0 deletions framework/src/source/TestRunner.bs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ namespace rooibos
else
rooibos.common.logDebug("rooibos.Coverage.reportCodeCoverage is not a function")
end if

' Final results to be logged after all test reporters have finished
resultStatus = "PASS"
if isFailed then resultStatus = "FAIL"
print "[Rooibos Result]: " + resultStatus
print "[Rooibos Shutdown]"

if m.config.sendHomeOnFinish <> false
m.sendHomeKeypress()
end if
Expand Down

0 comments on commit 9b80589

Please sign in to comment.