From d7f85b5df89a024065c950fd349461bb86ff8075 Mon Sep 17 00:00:00 2001 From: Bart van der Schoor Date: Mon, 7 Apr 2014 01:52:46 +0200 Subject: [PATCH] quick fix for runner, added npm script to recompile runner use less cores (24 vs 32) use bundled compiler to rebuild added '$ npm run tsc_runner' --- _infrastructure/tests/runner.js | 11 +++++++---- _infrastructure/tests/runner.ts | 12 +++++++++++- package.json | 3 ++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/_infrastructure/tests/runner.js b/_infrastructure/tests/runner.js index 9a3647abdd..171efe87dd 100644 --- a/_infrastructure/tests/runner.js +++ b/_infrastructure/tests/runner.js @@ -1290,13 +1290,19 @@ var DT; if (argv.help) { optimist.showHelp(); + var pkg = require('../../package.json'); + console.log('Scripts:'); + console.log(''); + Lazy(pkg.scripts).keys().each(function (key) { + console.log(' $ npm run ' + key); + }); process.exit(0); } var testFull = process.env['TRAVIS_BRANCH'] ? /\w\/full$/.test(process.env['TRAVIS_BRANCH']) : false; new TestRunner(dtPath, { - concurrent: argv['single-thread'] ? 1 : Math.max(cpuCores, 2), + concurrent: argv['single-thread'] ? 1 : Math.max(Math.min(24, cpuCores), 2), tscVersion: argv['tsc-version'], testChanges: testFull ? false : argv['test-changes'], skipTests: argv['skip-tests'], @@ -1312,7 +1318,4 @@ var DT; process.exit(2); }); })(DT || (DT = {})); -//grunt-start -/// -//grunt-end //# sourceMappingURL=runner.js.map diff --git a/_infrastructure/tests/runner.ts b/_infrastructure/tests/runner.ts index 5d4f42815b..1f75aca7a8 100644 --- a/_infrastructure/tests/runner.ts +++ b/_infrastructure/tests/runner.ts @@ -34,6 +34,10 @@ module DT { export var DEFAULT_TSC_VERSION = '0.9.7'; + interface PackageJSON { + scripts: {[key:string]: string}; + } + ///////////////////////////////// // Single test ///////////////////////////////// @@ -333,13 +337,19 @@ module DT { if (argv.help) { optimist.showHelp(); + var pkg: PackageJSON = require('../../package.json'); + console.log('Scripts:'); + console.log(''); + Lazy(pkg.scripts).keys().each((key) => { + console.log(' $ npm run ' + key); + }); process.exit(0); } var testFull = process.env['TRAVIS_BRANCH'] ? /\w\/full$/.test(process.env['TRAVIS_BRANCH']) : false; new TestRunner(dtPath, { - concurrent: argv['single-thread'] ? 1 : Math.max(cpuCores, 2), + concurrent: argv['single-thread'] ? 1 : Math.max(Math.min(24, cpuCores), 2), tscVersion: argv['tsc-version'], testChanges: testFull ? false : argv['test-changes'], // allow magic branch skipTests: argv['skip-tests'], diff --git a/package.json b/package.json index 2002f0b19b..c45823b827 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,8 @@ "all": "node ./_infrastructure/tests/runner.js --tsc-version 1.0.0", "dry": "node ./_infrastructure/tests/runner.js --tsc-version 1.0.0 --skip-tests --test-changes", "list": "node ./_infrastructure/tests/runner.js --tsc-version 1.0.0 --skip-tests --print-files --print-refmap", - "help": "node ./_infrastructure/tests/runner.js -h" + "help": "node ./_infrastructure/tests/runner.js -h", + "tsc_runner": "node ./_infrastructure/tests/typescript/1.0.0/tsc ./_infrastructure/tests/runner.ts --target ES5 --out ./_infrastructure/tests/runner.js --module commonjs --sourcemap" }, "dependencies": { "source-map-support": "~0.2.5",