diff --git a/pkg/dev_compiler/lib/src/compiler/command.dart b/pkg/dev_compiler/lib/src/compiler/command.dart index 13ab330a267..d2e8d8c118c 100644 --- a/pkg/dev_compiler/lib/src/compiler/command.dart +++ b/pkg/dev_compiler/lib/src/compiler/command.dart @@ -11,8 +11,7 @@ import 'package:args/command_runner.dart' show UsageException; import 'package:path/path.dart' as path; import '../analyzer/context.dart' show AnalyzerOptions; -import 'compiler.dart' - show BuildUnit, CompilerOptions, JSModuleFile, ModuleCompiler; +import 'compiler.dart' show BuildUnit, CompilerOptions, ModuleCompiler; import 'module_builder.dart'; final ArgParser _argParser = () { diff --git a/pkg/dev_compiler/test-main.js b/pkg/dev_compiler/test-main.js index 9ac99212082..fe330b785d4 100644 --- a/pkg/dev_compiler/test-main.js +++ b/pkg/dev_compiler/test-main.js @@ -6,7 +6,7 @@ var pathToModule = function(path) { }; var testsToSkip = [ - // syntax error: + // syntax error in DDC's generated code: '/base/gen/codegen_output/language/execute_finally6_test.js', '/base/gen/codegen_output/language/switch_label2_test.js', '/base/gen/codegen_output/language/infinite_switch_label_test.js', @@ -14,12 +14,19 @@ var testsToSkip = [ '/base/gen/codegen_output/language/nested_switch_label_test.js', '/base/gen/codegen_output/language/switch_try_catch_test.js', - // module code execution error: + // module code execution error in DDC's generated code: '/base/gen/codegen_output/language/f_bounded_quantification3_test.js', '/base/gen/codegen_output/language/regress_16640_test.js', '/base/gen/codegen_output/language/regress_22666_test.js', + '/base/gen/codegen_output/language/cyclic_type_test_00_multi.js', + '/base/gen/codegen_output/language/cyclic_type_test_01_multi.js', + '/base/gen/codegen_output/language/cyclic_type_test_02_multi.js', + '/base/gen/codegen_output/language/cyclic_type_test_03_multi.js', + '/base/gen/codegen_output/language/cyclic_type_test_04_multi.js', + '/base/gen/codegen_output/language/cyclic_type_test_none_multi.js', '/base/gen/codegen_output/language/cyclic_type2_test.js', '/base/gen/codegen_output/language/mixin_regress_13688_test.js', + '/base/gen/codegen_output/language/least_upper_bound_expansive_test_none_multi.js' ]; Object.keys(window.__karma__.files).forEach(function(file) { @@ -33,9 +40,12 @@ allTestFiles.push('test/browser/language_tests'); allTestFiles.push('test/browser/runtime_tests'); require.config({ - // Karma serves files under /base, which is the basePath from your config file + // Karma serves files under /base. baseUrl: '/base', + // Travis bots take a bit longer to load all ~2k test files. + waitSeconds: 30, + paths: { dart_sdk: 'lib/js/amd/dart_sdk', async_helper: 'gen/codegen_output/pkg/async_helper', @@ -47,9 +57,9 @@ require.config({ unittest: 'gen/codegen_output/pkg/unittest', }, - // dynamically load all test files + // Require all test files before starting tests. deps: allTestFiles, - // we have to kickoff jasmine, as it is asynchronous + // We have to kickoff jasmine, as it is asynchronous callback: window.__karma__.start }); diff --git a/pkg/dev_compiler/test/browser/language_tests.js b/pkg/dev_compiler/test/browser/language_tests.js index ea74c813982..ada5014d7c4 100644 --- a/pkg/dev_compiler/test/browser/language_tests.js +++ b/pkg/dev_compiler/test/browser/language_tests.js @@ -378,6 +378,10 @@ define(['dart_sdk', 'async_helper', 'unittest', 'require'], 'set_test': fail, // runtime strong mode reject }, + 'corelib/regexp': { + 'default_arguments_test': fail + }, + 'lib/convert': { 'encoding_test': skip_timeout, @@ -732,6 +736,9 @@ define(['dart_sdk', 'async_helper', 'unittest', 'require'], let matches = text.match(regex); return matches ? matches.length : 0; } + function libraryName(name) { + return name.replace(/-/g, '$45'); + } let unittest_tests = []; @@ -740,11 +747,10 @@ define(['dart_sdk', 'async_helper', 'unittest', 'require'], html_config.useHtmlConfiguration(); // We need to let Dart unittest control when tests are run not mocha. // mocha.allowUncaught(true); - let dartUnittestsLeft = 0; for (let testFile of allTestFiles) { let match = languageTestPattern.exec(testFile); if (match != null) { - let status_group = match[1] + let status_group = match[1]; let name = match[2]; let module = match[0]; @@ -774,7 +780,7 @@ define(['dart_sdk', 'async_helper', 'unittest', 'require'], if (has('unittest')) { unittest_tests.push(() => { console.log('Running unittest test ' + testFile); - require(module)[name].main(); + require(module)[libraryName(name)].main(); }); continue; } @@ -792,7 +798,7 @@ define(['dart_sdk', 'async_helper', 'unittest', 'require'], async_helper.asyncTestInitialize(done); console.debug('Running test: ' + name); - let mainLibrary = require(module)[name]; + let mainLibrary = require(module)[libraryName(name)]; let negative = /negative_test/.test(name); if (has('slow')) this.timeout(10000); if (has('fail')) { @@ -821,6 +827,10 @@ define(['dart_sdk', 'async_helper', 'unittest', 'require'], } } + // TODO(jmesserly): unitttest tests are currently broken + // https://github.com/dart-lang/dev_compiler/issues/631 + return; + let mochaOnError; // We run these tests in a mocha test wrapper to avoid the confusing failure // case of dart unittests being interleaved with mocha tests.