Skip to content

Commit

Permalink
fix language_tests.js to use strict mode
Browse files Browse the repository at this point in the history
we weren't running a bunch of tests on the bots :|
amazingly, none were broken yet
this also fixes karma.conf log level, and disables some spammy prints from one of the tests

[email protected]

Review URL: https://codereview.chromium.org/1257233008 .
  • Loading branch information
John Messerly committed Aug 3, 2015
1 parent 98c5c65 commit 8422d7a
Show file tree
Hide file tree
Showing 6 changed files with 188 additions and 182 deletions.
9 changes: 5 additions & 4 deletions pkg/dev_compiler/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module.exports = function(config) {

// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_DEBUG,
logLevel: config.LOG_INFO,

// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
Expand All @@ -72,17 +72,17 @@ module.exports = function(config) {
// and remove the custom launchers.
customLaunchers: {
chrome_harmony: {
base: 'Chrome',
base: 'Chrome',
flags: [ harmony_flags ],
},

chrome_canary_harmony: {
base: 'ChromeCanary',
base: 'ChromeCanary',
flags: [ harmony_flags ],
},

chrome_canary_travis: {
base: 'ChromeCanary',
base: 'ChromeCanary',
flags: [ '--no-sandbox', harmony_flags ]
},
},
Expand All @@ -96,6 +96,7 @@ module.exports = function(config) {
if (process.env.TRAVIS) {
configuration.browsers = ['chrome_canary_travis'];
configuration.autoWatch = false;
configuration.logLevel = config.LOG_DEBUG;
}

config.set(configuration);
Expand Down
113 changes: 58 additions & 55 deletions pkg/dev_compiler/test/browser/language_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,70 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

var _isolate_helper = dart_library.import('dart/_isolate_helper');
_isolate_helper.startRootIsolate(function() {}, []);
(function() {
'use strict';

function dartLanguageTests(tests) {
for (const name of tests) {
test(name, () => {
dart_library.import('language/' + name).main();
})
let _isolate_helper = dart_library.import('dart/_isolate_helper');
_isolate_helper.startRootIsolate(function() {}, []);

function dartLanguageTests(tests) {
for (const name of tests) {
test(name, () => {
console.debug('Running language test: ' + name);
dart_library.import('language/' + name).main();
});
}
}
}

suite('sync*', () => {
"use strict";
suite('sync*', () => {
test('syncstar_syntax', () => {
dart_library.import('syncstar_syntax').main();
});

test('syncstar_syntax', () => {
dart_library.import('syncstar_syntax').main();
dartLanguageTests([
'syncstar_yield_test',
'syncstar_yieldstar_test'
]);
});

dartLanguageTests([
'syncstar_yield_test',
'syncstar_yieldstart_test'
]);
});

dart_library.import('language/async_await_test').main();
dart_library.import('language/async_await_test').main();

suite('async', () => {
dartLanguageTests([
'async_and_or_test',
'async_await_catch_regression_test',
// TODO(jmesserly): fix errors
// 'async_backwards_compatibility_1_test',
'async_backwards_compatibility_2_test',
'async_break_in_finally_test',
// TODO(jmesserly): https://github.com/dart-lang/dev_compiler/issues/263
// 'async_continue_label_test',
'async_control_structures_test',
'async_finally_rethrow_test',
// TODO(jmesserly): fix errors
// 'async_or_generator_return_type_stacktrace_test',
'async_regression_23058_test',
'async_rethrow_test',
// TODO(jmesserly): fix errors
// 'async_return_types_test',
'async_switch_test',
'async_test',
'async_this_bound_test',
'async_throw_in_catch_test'
]);
})
suite('async', () => {
dartLanguageTests([
'async_and_or_test',
'async_await_catch_regression_test',
// TODO(jmesserly): fix errors
// 'async_backwards_compatibility_1_test',
'async_backwards_compatibility_2_test',
'async_break_in_finally_test',
// TODO(jmesserly): https://github.com/dart-lang/dev_compiler/issues/263
// 'async_continue_label_test',
'async_control_structures_test',
'async_finally_rethrow_test',
// TODO(jmesserly): fix errors
// 'async_or_generator_return_type_stacktrace_test',
'async_regression_23058_test',
'async_rethrow_test',
// TODO(jmesserly): fix errors
// 'async_return_types_test',
'async_switch_test',
'async_test',
'async_this_bound_test',
'async_throw_in_catch_test'
]);
});

dart_library.import('language/async_star_test').main();
dart_library.import('language/async_star_test').main();

suite('async*', () => {
dartLanguageTests([
// TODO(jmesserly): figure out why this test is hanging.
//'async_star_cancel_and_throw_in_finally_test',
'async_star_regression_23116_test',
'asyncstar_concat_test',
'asyncstar_throw_in_catch_test',
'asyncstar_yield_test',
'asyncstar_yieldstar_test'
]);
});
suite('async*', () => {
dartLanguageTests([
// TODO(jmesserly): figure out why this test is hanging.
//'async_star_cancel_and_throw_in_finally_test',
'async_star_regression_23116_test',
'asyncstar_concat_test',
'asyncstar_throw_in_catch_test',
'asyncstar_yield_test',
'asyncstar_yieldstar_test'
]);
});
})();
Loading

0 comments on commit 8422d7a

Please sign in to comment.