Skip to content

Commit

Permalink
Merge pull request #4 from ravimandala/feature-better-logging
Browse files Browse the repository at this point in the history
Feature better logging: Save as much debugging info as possible, if the tests fail.
  • Loading branch information
ravimandala authored Nov 16, 2023
2 parents 43e6fee + 9044647 commit 513afcd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
13 changes: 7 additions & 6 deletions bp/src/Bluepill.m
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,13 @@ - (void)runnerCompletedWithContext:(BPExecutionContext *)context {
[context.parser cleanup];
}

// Save as much debugging info as possible, if the tests fail.
// TBD: Put this behind a flag
if (context.runner.exitStatus != BPExitStatusAllTestsPassed && _config.saveDiagnosticsOnError) {
[BPUtils printInfo:INFO withString:@"Saving Diagnostics for Debugging"];
[BPUtils saveDebuggingDiagnostics:_config.outputDirectory];
}

if (context.simulatorCrashed) {
// If we crashed, we need to retry
[self deleteSimulatorWithContext:context andStatus:BPExitStatusSimulatorCrashed];
Expand All @@ -515,12 +522,6 @@ - (void)runnerCompletedWithContext:(BPExecutionContext *)context {
context.exitStatus = [context.runner exitStatus];
NEXT([self finishWithContext:context]);
} else {
// If the tests failed, save as much debugging info as we can. XXX: Put this behind a flag
if (context.runner.exitStatus != BPExitStatusAllTestsPassed && _config.saveDiagnosticsOnError) {
[BPUtils printInfo:INFO withString:@"Saving Diagnostics for Debugging"];
[BPUtils saveDebuggingDiagnostics:_config.outputDirectory];
}

[self deleteSimulatorWithContext:context andStatus:[context.runner exitStatus]];
}
}
Expand Down
25 changes: 15 additions & 10 deletions scripts/bluepill.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,26 @@ bluepill_build()
exit 1
}
set +o pipefail
# package bluepill
TAG=$(git describe --always --tags)
#### Original packaging of bluepill
# TAG=$(git describe --always --tags)
# ROOT="build"

# Custom packaging of bluepill
TAG="custom"
ROOT=".."
DST="Bluepill-$TAG"
mkdir -p "build/$DST/bin"
cp build/Build/Products/Release/{bp,bluepill} "build/$DST/bin"
mkdir -p "$ROOT/$DST/bin"
cp build/Build/Products/Release/{bp,bluepill} "$ROOT/$DST/bin"
## build the man page
mkdir -p "build/$DST/man/man1"
/usr/bin/python scripts/man.py "build/$DST/man/man1/bluepill.1"
mkdir -p "$ROOT/$DST/man/man1"
/usr/bin/python scripts/man.py "$ROOT/$DST/man/man1/bluepill.1"
# License
cp LICENSE "build/$DST"
cp LICENSE "$ROOT/$DST"
# bptestrunner
cp bptestrunner/* "build/$DST"
cp bptestrunner/* "$ROOT/$DST"

(cd build && zip -qr "$DST.zip" "$DST")
echo Release in "build/$DST.zip"
(cd "$ROOT" && zip -qr "$DST.zip" "$DST")
echo Release in "$ROOT/$DST.zip"
}

bluepill_build_sample_app()
Expand Down

0 comments on commit 513afcd

Please sign in to comment.