From eb4eb383bcdd255e33cd1f9b563776d9c4b7f151 Mon Sep 17 00:00:00 2001 From: gstamac Date: Fri, 23 Aug 2013 20:52:29 +0200 Subject: [PATCH] added possibility to provide extra TSC params in test runner (see Backgrid) --- _infrastructure/tests/runner.js | 8 ++++++-- _infrastructure/tests/runner.ts | 8 ++++++-- backgrid/backgrid-tests.ts.tscparams | 1 + 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 backgrid/backgrid-tests.ts.tscparams diff --git a/_infrastructure/tests/runner.js b/_infrastructure/tests/runner.js index 190285474a..2999c057ff 100644 --- a/_infrastructure/tests/runner.js +++ b/_infrastructure/tests/runner.js @@ -583,7 +583,11 @@ var DefinitelyTyped; function Tsc() { } Tsc.run = function (tsfile, callback) { - Exec.exec('node ./_infrastructure/tests/typescript/tsc.js --module commonjs ', [tsfile], function (ExecResult) { + var command = 'node ./_infrastructure/tests/typescript/tsc.js --module commonjs '; + if (IO.fileExists(tsfile + '.tscparams')) { + command += '@' + tsfile + '.tscparams'; + } + Exec.exec(command, [tsfile], function (ExecResult) { callback(ExecResult); }); }; @@ -846,7 +850,7 @@ var DefinitelyTyped; SyntaxChecking.prototype.run = function (it, file, len, maxLen, callback) { var _this = this; - if (!endsWith(file.toUpperCase(), '-TESTS.TS') && file.indexOf('../_infrastructure') < 0) { + if (!endsWith(file.toUpperCase(), '-TESTS.TS') && endsWith(file.toUpperCase(), '.TS') && file.indexOf('../_infrastructure') < 0) { new Test(file).run(function (o) { var failed = false; diff --git a/_infrastructure/tests/runner.ts b/_infrastructure/tests/runner.ts index 3c8f162108..e7bf929265 100644 --- a/_infrastructure/tests/runner.ts +++ b/_infrastructure/tests/runner.ts @@ -28,7 +28,11 @@ module DefinitelyTyped { class Tsc { public static run(tsfile: string, callback: Function) { - Exec.exec('node ./_infrastructure/tests/typescript/tsc.js --module commonjs ', [tsfile], (ExecResult) => { + var command = 'node ./_infrastructure/tests/typescript/tsc.js --module commonjs '; + if (IO.fileExists(tsfile + '.tscparams')) { + command += '@' + tsfile + '.tscparams'; + } + Exec.exec(command, [tsfile], (ExecResult) => { callback(ExecResult); }); } @@ -292,7 +296,7 @@ module DefinitelyTyped { } private run(it, file, len, maxLen, callback: Function) { - if (!endsWith(file.toUpperCase(), '-TESTS.TS') && file.indexOf('../_infrastructure') < 0) { + if (!endsWith(file.toUpperCase(), '-TESTS.TS') && endsWith(file.toUpperCase(), '.TS') && file.indexOf('../_infrastructure') < 0) { new Test(file).run((o) => { var failed = false; diff --git a/backgrid/backgrid-tests.ts.tscparams b/backgrid/backgrid-tests.ts.tscparams new file mode 100644 index 0000000000..e85b4ac55c --- /dev/null +++ b/backgrid/backgrid-tests.ts.tscparams @@ -0,0 +1 @@ +--target ES5 \ No newline at end of file