diff --git a/.eslintignore b/.eslintignore index d7257755..92373297 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,2 @@ frameworks/javascript/angular/ +frameworks/java diff --git a/docker-compose.yml b/docker-compose.yml index 11fbd8aa..8bc28d98 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -192,6 +192,16 @@ services: entrypoint: '' command: bash + chapel-runner: + image: codewars/chapel-runner + volumes: + - ./lib:/runner/lib + - ./examples:/runner/examples + - ./frameworks:/runner/frameworks + - ./test:/runner/test + entrypoint: '' + command: bash + # LANGUAGE SPECIFIC HELPERS javascript: image: codewars/node-runner diff --git a/docker/alt.docker b/docker/alt.docker index 03d13675..e9c69c82 100644 --- a/docker/alt.docker +++ b/docker/alt.docker @@ -42,4 +42,4 @@ RUN mocha -t 3000 test/runners/php_spec.js #timeout is a fallback in case an error with node #prevents it from exiting properly -ENTRYPOINT ["timeout", "15", "node"] +ENTRYPOINT ["node"] diff --git a/docker/chapel.docker b/docker/chapel.docker index 6e2723fa..c4803e66 100644 --- a/docker/chapel.docker +++ b/docker/chapel.docker @@ -34,4 +34,4 @@ WORKDIR /runner USER codewarrior RUN mocha -t 10000 test/runners/chapel_spec.js -ENTRYPOINT ["timeout", "15", "node"] +ENTRYPOINT ["node"] diff --git a/docker/crystal.docker b/docker/crystal.docker index a74a753e..feefbeca 100644 --- a/docker/crystal.docker +++ b/docker/crystal.docker @@ -44,3 +44,5 @@ ADD frameworks/crystal/formatter.cr /home/codewarrior/crystal/formatter.cr USER codewarrior RUN mocha -t 10000 test/runners/crystal_spec.js + +ENTRYPOINT ["node"] diff --git a/docker/dart.docker b/docker/dart.docker index d0e51c8f..b6cdd648 100644 --- a/docker/dart.docker +++ b/docker/dart.docker @@ -42,3 +42,5 @@ RUN ln -s /home/codewarrior /workspace USER codewarrior RUN mocha -t 10000 test/runners/dart_spec.js + +ENTRYPOINT ["node"] diff --git a/docker/dotnet.docker b/docker/dotnet.docker index a5aedb6c..2e28a925 100644 --- a/docker/dotnet.docker +++ b/docker/dotnet.docker @@ -57,4 +57,4 @@ RUN mono -V #timeout is a fallback in case an error with node #prevents it from exiting properly -ENTRYPOINT ["timeout", "15", "node"] +ENTRYPOINT ["node"] diff --git a/docker/erlang.docker b/docker/erlang.docker index ae080b3a..056233ad 100644 --- a/docker/erlang.docker +++ b/docker/erlang.docker @@ -56,4 +56,4 @@ RUN mocha -t 5000 test/runners/{erlang,elixir}_spec.js #timeout is a fallback in case an error with node #prevents it from exiting properly -ENTRYPOINT ["timeout", "15", "node"] +ENTRYPOINT ["node"] diff --git a/docker/esolangs.docker b/docker/esolangs.docker index e660c8df..49cc3501 100644 --- a/docker/esolangs.docker +++ b/docker/esolangs.docker @@ -25,4 +25,4 @@ RUN mocha -t 10000 test/runners/bf_spec.js #timeout is a fallback in case an error with node #prevents it from exiting properly -ENTRYPOINT ["timeout", "15", "node"] +ENTRYPOINT ["node"] diff --git a/docker/func.docker b/docker/func.docker index 2ddfef9c..cf26b158 100644 --- a/docker/func.docker +++ b/docker/func.docker @@ -34,4 +34,4 @@ RUN mocha -t 5000 test/runners/{ocaml,racket}_spec.js #timeout is a fallback in case an error with node #prevents it from exiting properly -ENTRYPOINT ["timeout", "15", "node"] +ENTRYPOINT ["node"] diff --git a/docker/go.docker b/docker/go.docker index 88ed4865..b559541d 100644 --- a/docker/go.docker +++ b/docker/go.docker @@ -52,4 +52,4 @@ RUN mocha -t 5000 test/runners/go_spec.js #timeout is a fallback in case an error with node #prevents it from exiting properly -ENTRYPOINT ["timeout", "17", "node"] +ENTRYPOINT ["node"] diff --git a/docker/haskell.docker b/docker/haskell.docker index df2b1e23..e016c564 100644 --- a/docker/haskell.docker +++ b/docker/haskell.docker @@ -28,7 +28,7 @@ RUN cabal update RUN cabal install cabal-install # Install Haskell Packages -# To install additional packages use "RUN cabal install " +# To install additional packages use "RUN cabal install " RUN cabal install split ifelse RUN cabal install persistent-sqlite persistent-template RUN cabal install haskell-src-exts lens @@ -38,7 +38,7 @@ RUN cabal install hspec hspec-core hspec-discover # Haskell stuff end. # ========================================================================= -# Add the package json first to a tmp directory and build, +# Add the package json first to a tmp directory and build, # copy over so that we dont rebuild every time USER root ADD package.json /tmp/package.json @@ -55,4 +55,4 @@ RUN mocha -t 10000 test/runners/haskell_spec.js # timeout is a fallback in case an error with node # prevents it from exiting properly -ENTRYPOINT ["timeout", "15", "node"] +ENTRYPOINT ["node"] diff --git a/docker/julia.docker b/docker/julia.docker index 6745a345..1d884609 100644 --- a/docker/julia.docker +++ b/docker/julia.docker @@ -51,4 +51,4 @@ RUN mocha -t 5000 test/runners/julia_spec.js #timeout is a fallback in case an error with node #prevents it from exiting properly -ENTRYPOINT ["timeout", "15", "node"] \ No newline at end of file +ENTRYPOINT ["node"] diff --git a/docker/jvm.docker b/docker/jvm.docker index 65b70da4..b6534fbc 100644 --- a/docker/jvm.docker +++ b/docker/jvm.docker @@ -62,4 +62,4 @@ RUN mocha -t 10000 test/runners/{clojure,groovy,scala,kotlin}_spec.js #timeout is a fallback in case an error with node #prevents it from exiting properly -ENTRYPOINT ["timeout", "15", "node"] +ENTRYPOINT ["node"] diff --git a/docker/lua.docker b/docker/lua.docker index 7a344703..1647fb53 100644 --- a/docker/lua.docker +++ b/docker/lua.docker @@ -32,4 +32,4 @@ RUN mocha -t 5000 test/runners/lua_spec.js #timeout is a fallback in case an error with node #prevents it from exiting properly -ENTRYPOINT ["timeout", "15", "node"] +ENTRYPOINT ["node"] diff --git a/docker/node.docker b/docker/node.docker index a9733854..77e10a74 100644 --- a/docker/node.docker +++ b/docker/node.docker @@ -58,4 +58,4 @@ RUN mocha -t 10000 test/runners/typescript_spec.js #timeout is a fallback in case an error with node #prevents it from exiting properly -ENTRYPOINT ["timeout", "15", "node"] +ENTRYPOINT ["node"] diff --git a/docker/objc.docker b/docker/objc.docker index 4485c742..a5b07e9d 100644 --- a/docker/objc.docker +++ b/docker/objc.docker @@ -149,4 +149,4 @@ RUN mocha -t 5000 test/runners/objc_spec.js # timeout is a fallback in case an error with node # prevents it from exiting properly -ENTRYPOINT ["timeout", "15", "node"] +ENTRYPOINT ["node"] diff --git a/docker/ocaml.docker b/docker/ocaml.docker index 2dfb9831..e26dc87c 100644 --- a/docker/ocaml.docker +++ b/docker/ocaml.docker @@ -44,4 +44,4 @@ RUN /home/codewarrior/run_ocaml.sh mocha -t 5000 test/runners/ocaml_spec.js #timeout is a fallback in case an error with node #prevents it from exiting properly -ENTRYPOINT ["/home/codewarrior/run_ocaml.sh", "timeout", "15", "node"] +ENTRYPOINT ["/home/codewarrior/run_ocaml.sh", "node"] diff --git a/docker/python.docker b/docker/python.docker index 9e3fa71f..b770d68a 100644 --- a/docker/python.docker +++ b/docker/python.docker @@ -102,4 +102,4 @@ RUN mocha -t 5000 test/runners/python_spec.js #timeout is a fallback in case an error with node #prevents it from exiting properly -ENTRYPOINT ["timeout", "15", "node"] +ENTRYPOINT ["node"] diff --git a/docker/ruby.docker b/docker/ruby.docker index ecfb2b1b..9a68f79b 100644 --- a/docker/ruby.docker +++ b/docker/ruby.docker @@ -179,10 +179,10 @@ ENV USER codewarrior ENV HOME /home/codewarrior RUN mocha -t 5000 test/runners/ruby_spec.js -#RUN mocha -t 5000 test/runners/sql_spec.js RUN mocha -t 5000 test/runners/shell_spec.js +#RUN mocha -t 5000 test/runners/sql_spec.js RUN sh /runner/lib/cleanup.sh #timeout is a fallback in case an error with node #prevents it from exiting properly -ENTRYPOINT ["timeout", "15", "node"] +ENTRYPOINT ["node"] diff --git a/docker/rust.docker b/docker/rust.docker index 94deacef..850ee9dd 100644 --- a/docker/rust.docker +++ b/docker/rust.docker @@ -26,3 +26,5 @@ RUN ln -s /home/codewarrior /workspace USER codewarrior RUN mocha -t 10000 test/runners/rust_spec.js + +ENTRYPOINT ["node"] diff --git a/docker/swift.docker b/docker/swift.docker index de791e8c..b97c20cf 100644 --- a/docker/swift.docker +++ b/docker/swift.docker @@ -72,4 +72,4 @@ RUN mocha -t 5000 test/runners/swift_spec.js # timeout is a fallback in case an error with node # prevents it from exiting properly -ENTRYPOINT ["timeout", "15", "node"] +ENTRYPOINT ["node"] diff --git a/docker/systems.docker b/docker/systems.docker index 60e9e5be..e86799ba 100644 --- a/docker/systems.docker +++ b/docker/systems.docker @@ -60,4 +60,4 @@ RUN mocha -t 5000 test/runners/{c,cpp}_spec.js #timeout is a fallback in case an error with node #prevents it from exiting properly -ENTRYPOINT ["timeout", "15", "node"] +ENTRYPOINT ["node"] diff --git a/frameworks/javascript/cw-2.js b/frameworks/javascript/cw-2.js index 611f2352..7a49c763 100644 --- a/frameworks/javascript/cw-2.js +++ b/frameworks/javascript/cw-2.js @@ -256,18 +256,18 @@ try { // additional code is injected and line numbers will not match. trace: function(ex) { return (ex.stack || ex.toString() || '') - .toString() - // remove file names (ie: (/cli-runner/...)) - .replace(/\s\(.*\)/g, '') - // remove at [eval] statements - .replace(/(at)*( Object.)*\s*[(]?\[eval\].*(:\d*)*[)]?\n/g, '') - // remove stack trace beyond the Module information - .replace(/at Module[\w\s.:\d\n]*/g, '') - // remove at Object. - .replace(/\t*at Object.<\w*>\n/g, '') - // handleError is used to wrap top level code, so lets remove it so that it doesn't - // confuse users who won't understand why it is there. - .replace('at Object.Test.handleError', ''); + .toString() + // remove file names (ie: (/cli-runner/...)) + .replace(/\s\(.*\)/g, '') + // remove at [eval] statements + .replace(/(at)*( Object.)*\s*[(]?\[eval\].*(:\d*)*[)]?\n/g, '') + // remove stack trace beyond the Module information + .replace(/at Module[\w\s.:\d\n]*/g, '') + // remove at Object. + .replace(/\t*at Object.<\w*>\n/g, '') + // handleError is used to wrap top level code, so lets remove it so that it doesn't + // confuse users who won't understand why it is there. + .replace('at Object.Test.handleError', ''); }, pass: function() { _expect(true); diff --git a/frameworks/javascript/display.js b/frameworks/javascript/display.js index bd44c40f..69f925dc 100644 --- a/frameworks/javascript/display.js +++ b/frameworks/javascript/display.js @@ -134,11 +134,11 @@ module.exports.format = function format(obj, options) { */ module.exports.escapeHtml = function escapeHtml(html) { return String(html) - .replace(/&/g, '&') - .replace(/"/g, '"') - .replace(/'/g, ''') - .replace(//g, '>'); + .replace(/&/g, '&') + .replace(/"/g, '"') + .replace(/'/g, ''') + .replace(//g, '>'); }; /** diff --git a/lib/runners/arm.js b/lib/runners/arm.js index 0b52e81d..06c61ac0 100644 --- a/lib/runners/arm.js +++ b/lib/runners/arm.js @@ -13,7 +13,7 @@ module.exports.run = function run(opts, cb) { solutionFile = util.codeWriteSync('arm', opts.solution + '\n', dir, 'solution.s'), objectFile = solutionFile.replace(/\.[^\.]+$/, '.o'), armCommand = ['arm-linux-gnueabi-as', solutionFile, '-o', objectFile].join(' '), - // Check for whether we need to link against libc + // Check for whether we need to link against libc linker = opts.solution.search(/\.glob[a]?l\W+_start/) == -1 ? "arm-linux-gnueabi-gcc-4.7" : "arm-linux-gnueabi-ld", linkerCommand = [linker, objectFile, '-o', executable].join(' '); util.exec(armCommand, function() { diff --git a/lib/runners/c.js b/lib/runners/c.js index 97f12c4e..28a52865 100644 --- a/lib/runners/c.js +++ b/lib/runners/c.js @@ -36,13 +36,14 @@ module.exports.run = function run(opts, cb) { }, sanitizeStdErr: function(error) { error = error || ''; - return error.replace(/clang.*-std=c[^\s]+/g, '') - .replace(/Error: Command failed:/g, '') - .replace(/\/tmp.*(solution\.c|solution)[:0-9]*/g, '') - .replace('\n', '') - .replace(' ', ' ') - .replace(opts.setup || '', '') - .replace(opts.fixture || '', ''); + return error + .replace(/clang.*-std=c[^\s]+/g, '') + .replace(/Error: Command failed:/g, '') + .replace(/\/tmp.*(solution\.c|solution)[:0-9]*/g, '') + .replace('\n', '') + .replace(' ', ' ') + .replace(opts.setup || '', '') + .replace(opts.fixture || '', ''); } }); }; diff --git a/lib/runners/chapel.js b/lib/runners/chapel.js index 3468d02b..a1d9beb8 100644 --- a/lib/runners/chapel.js +++ b/lib/runners/chapel.js @@ -15,6 +15,7 @@ module.exports.run = function run(opts, cb) { if (opts.setup) handleSetup(opts, dir); const executable = path.join(dir, 'solution'); const solutionFile = util.codeWriteSync('chpl', opts.solution, dir, 'solution.chpl'); + compile([solutionFile, '-o', executable], function(error, stdout, stderr) { if (error) return fail(error, stdout, stderr); opts.publish('stdout', stdout); @@ -30,20 +31,23 @@ module.exports.run = function run(opts, cb) { opts.solution, opts.fixture, ].join('\n'), dir, 'solution.chpl'); + compile([solutionFile, '-o', executable], function(error, stdout, stderr) { if (error) return fail(error, stdout, stderr); opts.publish('stdout', stdout); + runCode({name: executable, args: []}); }); }, sanitizeStdErr: function(error) { error = error || ''; - return error.replace(/\/tmp.*(solution\.chpl|solution)[:0-9]*/g, '') - .replace(/Error: Command failed:/g, '') - .replace(/error: uncaught error/g, '') - .replace('\n', '') - .replace(' ', ' '); + return error + .replace(/\/tmp.*(solution\.chpl|solution)[:0-9]*/g, '') + .replace(/Error: Command failed:/g, '') + .replace(/error: uncaught error/g, '') + .replace('\n', '') + .replace(' ', ' '); } }); }; diff --git a/lib/runners/clojure.js b/lib/runners/clojure.js index 1e73758e..7ad12f63 100644 --- a/lib/runners/clojure.js +++ b/lib/runners/clojure.js @@ -21,9 +21,9 @@ module.exports.run = function run(opts, cb) { // HACK: don't know clojure well enough to fix issue within actual runner, but it is escaping line breaks when it shouldn't sanitizeStdOut: function(stdout) { return stdout - .replace(/\<:LF:\>\/g, '\n') - .replace(/\<:LF:\>\/g, '\n') - .replace(/\<:LF:\>\/g, '\n'); + .replace(/\<:LF:\>\/g, '\n') + .replace(/\<:LF:\>\/g, '\n') + .replace(/\<:LF:\>\/g, '\n'); } }); diff --git a/lib/runners/cpp.js b/lib/runners/cpp.js index 1b2d6101..2f94fd00 100644 --- a/lib/runners/cpp.js +++ b/lib/runners/cpp.js @@ -41,13 +41,14 @@ module.exports.run = function run(opts, cb) { sanitizeStdErr: function(error) { error = error || ''; - return error.replace(/clang.*-std=c[^\s]+/g, '') - .replace(/Error: Command failed:/g, '') - .replace(/\/tmp.*(solution\.cpp|solution)[:0-9]*/g, '') - .replace('\n', '') - .replace(' ', ' ') - .replace(opts.setup || '', '') - .replace(opts.fixture || '', ''); + return error + .replace(/clang.*-std=c[^\s]+/g, '') + .replace(/Error: Command failed:/g, '') + .replace(/\/tmp.*(solution\.cpp|solution)[:0-9]*/g, '') + .replace('\n', '') + .replace(' ', ' ') + .replace(opts.setup || '', '') + .replace(opts.fixture || '', ''); } }); }; diff --git a/lib/runners/fsharp.js b/lib/runners/fsharp.js index 9bc80336..157b0ab2 100644 --- a/lib/runners/fsharp.js +++ b/lib/runners/fsharp.js @@ -5,7 +5,7 @@ var shovel = require('../shovel'), csharpFrameworksPath = path.resolve(__dirname, '..', '..', 'frameworks', 'csharp'), fuchuPath = path.resolve(fsharpFrameworksPath, 'Fuchu', 'lib', 'Fuchu'), - // Fuchu references exception classes from these libs + // Fuchu references exception classes from these libs nunitAssemblies = ['nunit.core.dll', 'nunit.core.interfaces.dll', 'nunit.util.dll', 'nunit.framework.dll', 'Newtonsoft.Json.dll', 'Qualified.dll'], nunitPath = path.resolve(csharpFrameworksPath, 'nunit', 'bin'), gallioPath = path.resolve(fsharpFrameworksPath, 'Gallio', 'lib', 'NET40'), diff --git a/lib/runners/gas.js b/lib/runners/gas.js index da8204de..664cf329 100644 --- a/lib/runners/gas.js +++ b/lib/runners/gas.js @@ -13,7 +13,7 @@ module.exports.run = function(opts, cb) { solutionFile = util.codeWriteSync('gas', opts.solution + '\n', dir, 'solution.s'), objectFile = solutionFile.replace(/\.[^\.]+$/, '.o'), gasCommand = ['gcc', '-c', solutionFile, '-o', objectFile].join(' '), - // Check for whether we need to link against libc + // Check for whether we need to link against libc linker = opts.solution.search(/\.global\W+_start/) == -1 ? "gcc" : "ld", linkerCommand = [linker, objectFile, '-o', executable].join(' '); util.exec(gasCommand, function() { diff --git a/lib/runners/haskell.js b/lib/runners/haskell.js index f124c47b..31b4ad56 100644 --- a/lib/runners/haskell.js +++ b/lib/runners/haskell.js @@ -20,8 +20,9 @@ module.exports.run = function run(opts, cb) { if (opts.setup) codeWriteSync('haskell', opts.setup, haskellCodeDir); var solutionFileName = codeWriteSync('haskell', opts.solution, haskellCodeDir, "Main.hs"), fixtureFileName = solutionFileName.split('/').pop() == "Main.hs" ? - codeWriteSync('haskell', opts.fixture, haskellCodeDir) : - codeWriteSync('haskell', opts.fixture, haskellCodeDir, "Main.hs"); + codeWriteSync('haskell', opts.fixture, haskellCodeDir) : + codeWriteSync('haskell', opts.fixture, haskellCodeDir, "Main.hs"); + process.env["solutionFileName"] = solutionFileName; runCode({ diff --git a/lib/runners/javascript.js b/lib/runners/javascript.js index 0dd9b86a..7825e12d 100644 --- a/lib/runners/javascript.js +++ b/lib/runners/javascript.js @@ -40,12 +40,13 @@ module.exports.run = function run(opts, cb) { }, sanitizeStdErr: function(error) { error = error || ''; - return error.replace(/(\()?\/codewars\/[(\w\/-\d.js:) ;]*/g, '') - .replace(/( Object. )?[\(]?\[eval\][-:\w\d\)]* at/g, '') - .replace(/Module._compile.*/g, '') - .replace('Object.Test.handleError ', '') - .replace(opts.setup || '', '') - .replace(opts.fixture || '', ''); + return error + .replace(/(\()?\/codewars\/[(\w\/-\d.js:) ;]*/g, '') + .replace(/( Object. )?[\(]?\[eval\][-:\w\d\)]* at/g, '') + .replace(/Module._compile.*/g, '') + .replace('Object.Test.handleError ', '') + .replace(opts.setup || '', '') + .replace(opts.fixture || '', ''); }, sanitizeStdOut: function(stdout) { return this.sanitizeStdErr(stdout); diff --git a/lib/runners/lisp.js b/lib/runners/lisp.js index 59b64020..40664a4f 100644 --- a/lib/runners/lisp.js +++ b/lib/runners/lisp.js @@ -7,7 +7,7 @@ module.exports.run = function run(opts, cb) { var lispCodeDir = temp.mkdirSync('lisp'), args = [ '--noinform', // Disable banner - '--disable-ldb', // Disable the low-level debugger + '--disable-ldb', // Disable the low-level debugger '--lose-on-corruption', // Don't try to recover '--non-interactive' // No REPL ]; diff --git a/lib/runners/nasm.js b/lib/runners/nasm.js index 70f600b8..0d1a4150 100644 --- a/lib/runners/nasm.js +++ b/lib/runners/nasm.js @@ -14,7 +14,7 @@ module.exports.run = function run(opts, cb) { solutionFile = util.codeWriteSync('nasm', opts.solution + '\n', dir, 'solution.asm'), nasmCommand = ['nasm', '-felf64', solutionFile].join(' '), objectFile = solutionFile.replace(/\.[^\.]+$/, '.o'), - // Check for whether we need to link against libc + // Check for whether we need to link against libc linker = opts.solution.search(/global\W+_start/) == -1 ? "gcc" : "ld", linkerCommand = [linker, objectFile, '-o', executable].join(' '); util.exec(nasmCommand, function() { diff --git a/lib/runners/python.js b/lib/runners/python.js index 57e219a8..3592dd87 100644 --- a/lib/runners/python.js +++ b/lib/runners/python.js @@ -27,10 +27,10 @@ module.exports.run = function run(opts, cb) { // get rid of some of the noisy content. We remove line numbers since // they don't match up to what the user sees and will only confuse them. return err - .replace(/>\n\n+\n<') - .replace(/File "()?", line \d*,/g, '') - .replace(' (most recent call last)', '') - .replace(' in in ', ' in '); + .replace(/>\n\n+\n<') + .replace(/File "()?", line \d*,/g, '') + .replace(' (most recent call last)', '') + .replace(' in in ', ' in '); } }); }; @@ -100,8 +100,8 @@ function unittestCode(opts) { function pythonExec(opts, file) { file = file || opts.entryPath; return isPython3(opts) ? - `exec(compile(open("${file}", "rb").read(), "${file}", 'exec'))` : - `execfile('${file}')`; + `exec(compile(open("${file}", "rb").read(), "${file}", 'exec'))` : + `execfile('${file}')`; } function defaultImports(opts) { diff --git a/lib/runners/typescript.js b/lib/runners/typescript.js index d9ab44c3..3345992b 100644 --- a/lib/runners/typescript.js +++ b/lib/runners/typescript.js @@ -36,11 +36,12 @@ module.exports.run = function run(opts, cb) { }, sanitizeStdErr: function(error) { error = error || ''; - return error.replace(/(\()?\/codewars\/[(\w\/-\d.js:) ;]*/g, '') - .replace(/( Object. )?[\(]?\[eval\][-:\w\d\)]* at/g, '') - .replace(/Module._compile.*/g, '') - .replace('Object.Test.handleError ', '') - .replace(' ', ' '); + return error + .replace(/(\()?\/codewars\/[(\w\/-\d.js:) ;]*/g, '') + .replace(/( Object. )?[\(]?\[eval\][-:\w\d\)]* at/g, '') + .replace(/Module._compile.*/g, '') + .replace('Object.Test.handleError ', '') + .replace(' ', ' '); }, sanitizeStdOut: function(stdout) { return this.sanitizeStdErr(stdout); diff --git a/run.js b/run.js index 7a82f200..9f8e161a 100644 --- a/run.js +++ b/run.js @@ -1,66 +1,66 @@ var run = require('./lib/runner').run, opts = require("nomnom") - .options({ - code: { - abbr: 'c', - help: 'code to run' - }, - fixture: { - abbr: 'f', - help: 'Test fixture code to test with' - }, - setup: { - abbr: 's', - help: 'Setup code to be used for executing the code' - }, - language: { - abbr: 'l', - help: 'The language to execute the code in' - }, - languageVersion: { - abbr: 'lv', - help: 'The language version that should be used' - }, - testFramework: { - abbr: 't', - full: 'test-framework', - help: 'The language specific framework to run in' - }, - shell: { - abbr: 'sh', - help: 'An optional shell script which will be ran within the sandbox environment before the code is executed' - }, - timeout: { - help: 'The timeout to be used for running the code. If not specified a language specific default will be used' - }, - format: { - help: 'The output format that will be returned. Options are "default" and "json"', - default: 'default', - choices: ['default', 'json'], - abbr: 'fmt' - }, - services: { - abbr: 'srv', - help: 'Enable a set of services, such as redis or mongodb. Multiple options can be specified', - list: true, - choices: ['mongodb', 'redis'] - }, - debug: { - abbr: 'd', - help: 'Print debugging info', - flag: true - }, - version: { - abbr: 'v', - flag: true, - help: 'Print version and exit', - callback: function() { - return require('./lib/config').version; - } + .options({ + code: { + abbr: 'c', + help: 'code to run' + }, + fixture: { + abbr: 'f', + help: 'Test fixture code to test with' + }, + setup: { + abbr: 's', + help: 'Setup code to be used for executing the code' + }, + language: { + abbr: 'l', + help: 'The language to execute the code in' + }, + languageVersion: { + abbr: 'lv', + help: 'The language version that should be used' + }, + testFramework: { + abbr: 't', + full: 'test-framework', + help: 'The language specific framework to run in' + }, + shell: { + abbr: 'sh', + help: 'An optional shell script which will be ran within the sandbox environment before the code is executed' + }, + timeout: { + help: 'The timeout to be used for running the code. If not specified a language specific default will be used' + }, + format: { + help: 'The output format that will be returned. Options are "default" and "json"', + default: 'default', + choices: ['default', 'json'], + abbr: 'fmt' + }, + services: { + abbr: 'srv', + help: 'Enable a set of services, such as redis or mongodb. Multiple options can be specified', + list: true, + choices: ['mongodb', 'redis'] + }, + debug: { + abbr: 'd', + help: 'Print debugging info', + flag: true + }, + version: { + abbr: 'v', + flag: true, + help: 'Print version and exit', + callback: function() { + return require('./lib/config').version; } - }) - .help('This utility will run code in a specified language, using the specified testing suite.') - .parse(); + } + }) + .help('This utility will run code in a specified language, using the specified testing suite.') + .parse(); run(opts);