diff options
Diffstat (limited to 'js/test/Common/run.js')
-rwxr-xr-x | js/test/Common/run.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/js/test/Common/run.js b/js/test/Common/run.js new file mode 100755 index 00000000000..40d83aff47a --- /dev/null +++ b/js/test/Common/run.js @@ -0,0 +1,39 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + + + +var Ice = require(process.argv[2] === "--es5" ? "ice/src/es5" : "ice").Ice; + +var write = function(msg) +{ + process.stdout.write(msg); +}; + +var writeLine = function(msg) +{ + this.write(msg + "\n"); +}; + +var id = new Ice.InitializationData(); +id.properties = Ice.createProperties(process.argv); +exe = process.argv[2] === "--es5" ? process.argv[3] : process.argv[2] +var test = module.require(exe) +test = exe === "ClientBidir" ? test.__testBidir__ : test.__test__; + +test({write: write, writeLine: writeLine}, id).catch( + ex => + { + console.log(ex.toString()); + if(ex.stack) + { + console.log(ex.stack); + } + process.exit(1); + }); |