summaryrefslogtreecommitdiff
path: root/tools/eos-run-test.in
diff options
context:
space:
mode:
authorPhilip Chimento <philip@endlessm.com>2013-12-09 12:27:46 -0800
committerPhilip Chimento <philip@endlessm.com>2013-12-09 12:27:46 -0800
commitb60363fe96b449d4f929b851163ed59adbf10536 (patch)
tree218cc5f0b670b18178608c6096a9bdbbddf3595f /tools/eos-run-test.in
parent740895d484a73e1791e7b4d4db1f14d27ae98a8a (diff)
Use System.exit() and System.programInvocationName
In GJS >= 1.38, these facilities are available. This removes the workarounds that we had for lack of these facilities. [endlessm/eos-sdk#432]
Diffstat (limited to 'tools/eos-run-test.in')
-rw-r--r--tools/eos-run-test.in11
1 files changed, 4 insertions, 7 deletions
diff --git a/tools/eos-run-test.in b/tools/eos-run-test.in
index 888e53b..e36fdd7 100644
--- a/tools/eos-run-test.in
+++ b/tools/eos-run-test.in
@@ -7,9 +7,6 @@ const Lang = imports.lang;
const System = imports.system;
String.prototype.format = Format.format;
-// Monkeypatch System.programInvocationName if not in this version of GJS
-if(!('programInvocationName' in System))
- System.programInvocationName = 'eos-run-test';
const PACKAGE_VERSION = '@PACKAGE_VERSION@';
const JS_EXTENSION = '.js';
@@ -26,7 +23,7 @@ function usage() {
print('Options:');
print(' --help This help message');
print(' --version Print version and exit');
- throw(0); // FIXME System.exit(0);
+ System.exit(0);
}
/**
@@ -35,9 +32,9 @@ function usage() {
* Print command-line version output.
*/
function version() {
- print('%s %s - Discover unit tests in a source tree'.format(
+ print('%s %s - Run jsUnit tests in a GJS source file'.format(
System.programInvocationName, PACKAGE_VERSION));
- throw(0); // FIXME System.exit(0);
+ System.exit(0);
}
if(ARGV.indexOf('--help') != -1)
@@ -146,5 +143,5 @@ print(totalsString);
if (totals.testsFailedCount > 0){
printerr("Test(s) did not complete successfully");
- throw(1); // FIXME System.exit(1);
+ System.exit(1);
}