OLD | NEW |
(Empty) | |
| 1 "use strict"; |
| 2 |
| 3 var TestDiscovery = require("./helper/test-discovery"); |
| 4 var TestCase = require("./helper/test-case"); |
| 5 var path = require("path"); |
| 6 var argv = require("yargs").argv; |
| 7 |
| 8 var testSuite; |
| 9 if (argv.language) { |
| 10 testSuite = TestDiscovery.loadSomeTests(__dirname + "/languages", argv.l
anguage); |
| 11 } else { |
| 12 // load complete test suite |
| 13 testSuite = TestDiscovery.loadAllTests(__dirname + "/languages"); |
| 14 } |
| 15 |
| 16 // define tests for all tests in all languages in the test suite |
| 17 for (var language in testSuite) { |
| 18 if (!testSuite.hasOwnProperty(language)) { |
| 19 continue; |
| 20 } |
| 21 |
| 22 (function (language, testFiles) { |
| 23 describe("Testing language '" + language + "'", function () { |
| 24 testFiles.forEach( |
| 25 function (filePath) { |
| 26 var fileName = path.basename(filePath, p
ath.extname(filePath)); |
| 27 |
| 28 it("– should pass test case '" + fileNam
e + "'", |
| 29 function () { |
| 30 TestCase.runTestCase(lan
guage, filePath); |
| 31 } |
| 32 ); |
| 33 } |
| 34 ); |
| 35 }); |
| 36 })(language, testSuite[language]); |
| 37 } |
OLD | NEW |