Split js_backend_cps_ir tests into multiple test units.

When testing everything from a single entry point, the time
budget does not increase as we add more test cases. So that
approach did not scale.

BUG=

Review URL: https://codereview.chromium.org//810183003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42804 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
asgerf@google.com
2015-01-13 12:50:37 +00:00
parent ca69477f4e
commit ea46dc63ce
7 changed files with 41 additions and 24 deletions
@@ -1,7 +1,6 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// 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.
// VMOptions=-DUSE_CPS_IR=true
// Test that the CPS IR code generator compiles programs and produces the
// the expected output.
@@ -14,23 +13,8 @@ import 'memory_compiler.dart';
import 'package:compiler/src/js/js.dart' as js;
import 'package:compiler/src/common.dart' show Element;
import 'js_backend_cps_ir_basic.dart' as basic;
import 'js_backend_cps_ir_literals.dart' as literals;
import 'js_backend_cps_ir_operators.dart' as operators;
import 'js_backend_cps_ir_control_flow.dart' as control_flow;
import 'js_backend_cps_ir_interceptors.dart' as interceptors;
import 'js_backend_cps_ir_closures.dart' as closures;
const String TEST_MAIN_FILE = 'test.dart';
List<TestEntry> tests = <TestEntry>[]
..addAll(basic.tests)
..addAll(literals.tests)
..addAll(control_flow.tests)
..addAll(operators.tests)
..addAll(interceptors.tests)
..addAll(closures.tests);
class TestEntry {
final String source;
final String expectation;
@@ -47,7 +31,8 @@ String getCodeForMain(Compiler compiler) {
return js.prettyPrint(ast, compiler).getText();
}
main() {
runTests(List<TestEntry> tests) {
Expect.isTrue(const bool.fromEnvironment("USE_CPS_IR"));
for (TestEntry test in tests) {
@@ -1,12 +1,13 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// 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.
// VMOptions=-DUSE_CPS_IR=true
// Tests for basic functionality.
library basic_tests;
import 'js_backend_cps_ir_test.dart';
import 'js_backend_cps_ir.dart';
const List<TestEntry> tests = const [
const TestEntry("""
@@ -101,3 +102,8 @@ function() {
return null;
}"""),
];
void main() {
runTests(tests);
}
@@ -1,12 +1,13 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// 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.
// VMOptions=-DUSE_CPS_IR=true
// Tests of interceptors.
// Tests of closures.
library closures_test;
import 'js_backend_cps_ir_test.dart';
import 'js_backend_cps_ir.dart';
const List<TestEntry> tests = const [
const TestEntry("""
@@ -123,3 +124,7 @@ function() {
}
}"""),
];
void main() {
runTests(tests);
}
@@ -1,12 +1,13 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// 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.
// VMOptions=-DUSE_CPS_IR=true
// Tests of control flow statements.
library control_flow_tests;
import 'js_backend_cps_ir_test.dart';
import 'js_backend_cps_ir.dart';
const List<TestEntry> tests = const [
const TestEntry("""
@@ -138,3 +139,7 @@ function() {
return null;
}"""),
];
void main() {
runTests(tests);
}
@@ -1,12 +1,13 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// 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.
// VMOptions=-DUSE_CPS_IR=true
// Tests of interceptors.
library interceptors_tests;
import 'js_backend_cps_ir_test.dart';
import 'js_backend_cps_ir.dart';
const List<TestEntry> tests = const [
const TestEntry("""
@@ -25,3 +26,8 @@ function() {
return null;
}"""),
];
void main() {
runTests(tests);
}
@@ -1,12 +1,13 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// 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.
// VMOptions=-DUSE_CPS_IR=true
// Tests of literals.
library literals_tests;
import 'js_backend_cps_ir_test.dart';
import 'js_backend_cps_ir.dart';
const List<TestEntry> tests = const [
const TestEntry("""
@@ -32,3 +33,7 @@ function() {
return null;
}"""),
];
void main() {
runTests(tests);
}
@@ -1,12 +1,13 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// 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.
// VMOptions=-DUSE_CPS_IR=true
// Tests of operators.
library operators_tests;
import 'js_backend_cps_ir_test.dart';
import 'js_backend_cps_ir.dart';
const List<TestEntry> tests = const [
const TestEntry("main() { return true ? 42 : 'foo'; }"),
@@ -43,3 +44,7 @@ main() { print(foo || foo); }""",
return null;
}"""),
];
void main() {
runTests(tests);
}