|
| 1 | +#!/usr/bin/env node |
| 2 | + |
| 3 | +var glob = require('glob').sync; |
| 4 | +var spawn = require('child_process').spawn; |
| 5 | + |
| 6 | +var scripts = [ |
| 7 | + 'lib/cli.js spec/basicConf.js', |
| 8 | + 'lib/cli.js spec/multiConf.js', |
| 9 | + 'lib/cli.js spec/altRootConf.js', |
| 10 | + 'lib/cli.js spec/onPrepareConf.js', |
| 11 | + 'lib/cli.js spec/mochaConf.js', |
| 12 | + 'lib/cli.js spec/cucumberConf.js', |
| 13 | + 'node lib/cli.js spec/withLoginConf.js', |
| 14 | + 'node lib/cli.js spec/suitesConf.js --suite okmany', |
| 15 | + 'node lib/cli.js spec/suitesConf.js' |
| 16 | +]; |
| 17 | + |
| 18 | +scripts.push( |
| 19 | + 'node node_modules/.bin/minijasminenode jasminewd/spec/adapterSpec.js ' + |
| 20 | + glob('spec/unit/*.js').join(' ') + ' ' + |
| 21 | + glob('docs/spec/*.js').join(' ')); |
| 22 | + |
| 23 | +var failed = false; |
| 24 | + |
| 25 | +(function runTests(i) { |
| 26 | + if (i < scripts.length) { |
| 27 | + console.log('node ' + scripts[i]); |
| 28 | + var args = scripts[i].split(/\s/); |
| 29 | + |
| 30 | + var test = spawn(args[0], args.slice(1), {stdio: 'inherit'}); |
| 31 | + test.on('error', function(err) { |
| 32 | + throw err; |
| 33 | + }); |
| 34 | + test.on('exit', function(code) { |
| 35 | + if (code != 0) { |
| 36 | + failed = true; |
| 37 | + } |
| 38 | + runTests(i + 1); |
| 39 | + }); |
| 40 | + } else { |
| 41 | + process.exit(failed ? 1 : 0); |
| 42 | + } |
| 43 | +}(0)); |
0 commit comments