From 56fb238bf6df1ff8b7dcac271a7aa5a21f7fe3bb Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Wed, 14 Mar 2012 11:00:35 -0700 Subject: [PATCH] Failures cause app to exit with exitStatus != 1 --- Atom/src/native_handler.mm | 5 ++++- vendor/jasmine-html.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Atom/src/native_handler.mm b/Atom/src/native_handler.mm index fd87050ed..5b48d36f9 100644 --- a/Atom/src/native_handler.mm +++ b/Atom/src/native_handler.mm @@ -254,7 +254,10 @@ bool NativeHandler::Execute(const CefString& name, return true; } else if (name == "exit") { - [NSApp terminate:NSApp]; + int exitStatus = 0; + if (arguments.size() > 0) exitStatus = arguments[0]->GetIntValue(); + + exit(exitStatus); return true; } diff --git a/vendor/jasmine-html.js b/vendor/jasmine-html.js index 6614465dd..bf8e88d11 100644 --- a/vendor/jasmine-html.js +++ b/vendor/jasmine-html.js @@ -104,7 +104,7 @@ jasmine.AtomReporter.prototype.reportRunnerResults = function(runner) { this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString())); - if (atom.exitAfterSpecs) $native.exit() + if (atom.exitAfterSpecs) $native.exit(results.failedCount > 0 ? 1 : 0) }; jasmine.AtomReporter.prototype.reportSuiteResults = function(suite) {