mirror of
https://github.com/dart-lang/sdk
synced 2024-10-06 15:09:45 +00:00
Fast versions of legacy and strong tests.
These versions don't run the VM on the generated .dill files. These tests are still "Slow" in status-file lingo, as they run for about 30 seconds on a fast machine. Change-Id: I7bd326a14c8f1f1905d4c6b4d5f850a95b135325 Reviewed-on: https://dart-review.googlesource.com/c/88967 Reviewed-by: Aske Simon Christensen <askesc@google.com>
This commit is contained in:
parent
e3d6709289
commit
f3cee0147c
22
pkg/front_end/test/fasta/fast_legacy_test.dart
Normal file
22
pkg/front_end/test/fasta/fast_legacy_test.dart
Normal file
|
@ -0,0 +1,22 @@
|
|||
// Copyright (c) 2019, 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.md file.
|
||||
|
||||
library fasta.test.fast_legacy_test;
|
||||
|
||||
import 'dart:async' show Future;
|
||||
|
||||
import 'dart:io' show Platform;
|
||||
|
||||
import 'testing/suite.dart';
|
||||
|
||||
Future<FastaContext> createContext(
|
||||
Chain suite, Map<String, String> environment) {
|
||||
environment[ENABLE_FULL_COMPILE] = "";
|
||||
environment[LEGACY_MODE] = "";
|
||||
environment["skipVm"] = "true";
|
||||
return FastaContext.create(suite, environment);
|
||||
}
|
||||
|
||||
main([List<String> arguments = const []]) => runMe(arguments, createContext,
|
||||
"../../testing.json", Platform.script.resolve("legacy_test.dart"));
|
21
pkg/front_end/test/fasta/fast_strong_test.dart
Normal file
21
pkg/front_end/test/fasta/fast_strong_test.dart
Normal file
|
@ -0,0 +1,21 @@
|
|||
// Copyright (c) 2019, 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.md file.
|
||||
|
||||
library fasta.test.fast_strong_test;
|
||||
|
||||
import 'dart:async' show Future;
|
||||
|
||||
import 'dart:io' show Platform;
|
||||
|
||||
import 'testing/suite.dart';
|
||||
|
||||
Future<FastaContext> createContext(
|
||||
Chain suite, Map<String, String> environment) {
|
||||
environment[ENABLE_FULL_COMPILE] = "";
|
||||
environment["skipVm"] = "true";
|
||||
return FastaContext.create(suite, environment);
|
||||
}
|
||||
|
||||
main([List<String> arguments = const []]) => runMe(arguments, createContext,
|
||||
"../../testing.json", Platform.script.resolve("strong_test.dart"));
|
|
@ -111,6 +111,8 @@ const String EXPECTATIONS = '''
|
|||
|
||||
const String KERNEL_TEXT_SERIALIZATION = " kernel text serialization ";
|
||||
|
||||
final Expectation runtimeError = ExpectationSet.Default["RuntimeError"];
|
||||
|
||||
String generateExpectationName(bool legacyMode) {
|
||||
return legacyMode ? "legacy" : "strong";
|
||||
}
|
||||
|
@ -122,6 +124,7 @@ class FastaContext extends ChainContext {
|
|||
final bool legacyMode;
|
||||
final bool onlyCrashes;
|
||||
final bool enableSetLiterals;
|
||||
final bool skipVm;
|
||||
final Map<Component, KernelTarget> componentToTarget =
|
||||
<Component, KernelTarget>{};
|
||||
final Map<Component, StringBuffer> componentToDiagnostics =
|
||||
|
@ -143,7 +146,7 @@ class FastaContext extends ChainContext {
|
|||
bool ignoreExpectations,
|
||||
bool updateExpectations,
|
||||
bool updateComments,
|
||||
bool skipVm,
|
||||
this.skipVm,
|
||||
bool kernelTextSerialization,
|
||||
this.uriTranslator,
|
||||
bool fullCompile)
|
||||
|
@ -167,7 +170,7 @@ class FastaContext extends ChainContext {
|
|||
if (kernelTextSerialization) {
|
||||
steps.add(const KernelTextSerialization());
|
||||
}
|
||||
if (fullCompile && !skipVm) {
|
||||
if (fullCompile) {
|
||||
steps.add(const Transform());
|
||||
if (!ignoreExpectations) {
|
||||
steps.add(new MatchExpectation(
|
||||
|
@ -177,8 +180,10 @@ class FastaContext extends ChainContext {
|
|||
updateExpectations: updateExpectations));
|
||||
}
|
||||
steps.add(const EnsureNoErrors());
|
||||
steps.add(const WriteDill());
|
||||
steps.add(const Run());
|
||||
if (!skipVm) {
|
||||
steps.add(const WriteDill());
|
||||
steps.add(const Run());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -211,6 +216,15 @@ class FastaContext extends ChainContext {
|
|||
return super.processTestResult(description, result, last);
|
||||
}
|
||||
|
||||
@override
|
||||
Set<Expectation> processExpectedOutcomes(Set<Expectation> outcomes) {
|
||||
if (skipVm && outcomes.length == 1 && outcomes.single == runtimeError) {
|
||||
return new Set<Expectation>.from([Expectation.Pass]);
|
||||
} else {
|
||||
return outcomes;
|
||||
}
|
||||
}
|
||||
|
||||
static Future<FastaContext> create(
|
||||
Chain suite, Map<String, String> environment) async {
|
||||
Uri sdk = Uri.base.resolve("sdk/");
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
library test;
|
||||
import self as self;
|
||||
import "dart:async" as asy;
|
||||
import "dart:core" as core;
|
||||
|
||||
static method m1() → dynamic {
|
||||
asy::Future<core::int> f;
|
||||
dynamic x = f.then<asy::Future<core::List<core::int>>>((dynamic x) → dynamic => <dynamic>[]);
|
||||
asy::Future<core::List<core::int>> y = x;
|
||||
}
|
||||
static method m2() → dynamic {
|
||||
asy::Future<core::int> f;
|
||||
dynamic x = f.then<core::List<core::int>>((dynamic x) → dynamic => <dynamic>[]);
|
||||
asy::Future<core::List<core::int>> y = x;
|
||||
}
|
|
@ -19,7 +19,7 @@ incomplete_field_formal_parameter: Fail # Fasta doesn't recover well
|
|||
inference/bug31436: RuntimeError # Test exercises Dart 2.0 semantics
|
||||
inference/constructors_too_many_positional_arguments: Fail
|
||||
inference/downwards_inference_annotations_locals: Fail # Issue #30031
|
||||
inference/future_then_explicit_future: Fail
|
||||
inference/future_then_explicit_future: RuntimeError
|
||||
inference/generic_methods_infer_js_builtin: RuntimeError # Test attempts to access platform-private library leading to NSM.
|
||||
inference/infer_assign_to_index: Fail
|
||||
inference/infer_assign_to_property: Fail
|
||||
|
@ -49,7 +49,7 @@ rasta/bad_unicode: Fail
|
|||
rasta/breaking_bad: Fail
|
||||
rasta/class_hierarchy: Fail
|
||||
rasta/class_member: Fail
|
||||
rasta/constant_get_and_invoke: Fail
|
||||
rasta/constant_get_and_invoke: RuntimeError
|
||||
rasta/deferred_lib: Fail
|
||||
rasta/deferred_load: Fail
|
||||
rasta/duplicated_mixin: RuntimeError # Expected, this file has no main method.
|
||||
|
@ -69,7 +69,7 @@ rasta/issue_000042: Fail
|
|||
rasta/issue_000043: Fail
|
||||
rasta/issue_000044: Fail
|
||||
rasta/issue_000045: Fail
|
||||
rasta/issue_000046: Fail
|
||||
rasta/issue_000046: RuntimeError
|
||||
rasta/issue_000047: Fail
|
||||
rasta/issue_000081: Fail
|
||||
rasta/malformed_const_constructor: Fail
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
library;
|
||||
import self as self;
|
||||
|
||||
static const field dynamic c = 1;
|
||||
static method main() → dynamic {
|
||||
self::c;
|
||||
self::c.call();
|
||||
}
|
|
@ -1,40 +1,23 @@
|
|||
// Formatted problems:
|
||||
//
|
||||
// pkg/front_end/testcases/rasta/issue_000046.dart:6:13: Error: Expected '(' after this.
|
||||
// C c = new Object)();
|
||||
// ^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/rasta/issue_000046.dart:6:19: Error: Expected ';' after this.
|
||||
// C c = new Object)();
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/rasta/issue_000046.dart:6:19: Error: Expected a class member, but got ')'.
|
||||
// C c = new Object)();
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/rasta/issue_000046.dart:6:20: Error: Expected an identifier, but got '('.
|
||||
// C c = new Object)();
|
||||
// ^
|
||||
|
||||
// Unhandled errors:
|
||||
//
|
||||
// pkg/front_end/testcases/rasta/issue_000046.dart:6:13: Error: Expected '(' after this.
|
||||
// C c = new Object)();
|
||||
// ^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/rasta/issue_000046.dart:6:19: Error: Expected ';' after this.
|
||||
// C c = new Object)();
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/rasta/issue_000046.dart:6:19: Error: Expected a class member, but got ')'.
|
||||
// C c = new Object)();
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/rasta/issue_000046.dart:6:20: Error: Expected an identifier, but got '('.
|
||||
// C c = new Object)();
|
||||
// ^
|
||||
|
||||
library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/rasta/issue_000046.dart:6:13: Error: Expected '(' after this.
|
||||
// C c = new Object)();
|
||||
// ^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/rasta/issue_000046.dart:6:19: Error: Expected ';' after this.
|
||||
// C c = new Object)();
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/rasta/issue_000046.dart:6:19: Error: Expected a class member, but got ')'.
|
||||
// C c = new Object)();
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/rasta/issue_000046.dart:6:20: Error: Expected an identifier, but got '('.
|
||||
// C c = new Object)();
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// Unhandled errors:
|
||||
library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/rasta/issue_000046.dart:6:13: Error: Expected '(' after this.
|
||||
// C c = new Object)();
|
||||
|
@ -15,8 +17,7 @@
|
|||
// pkg/front_end/testcases/rasta/issue_000046.dart:6:20: Error: Expected an identifier, but got '('.
|
||||
// C c = new Object)();
|
||||
// ^
|
||||
|
||||
library;
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
|
|
|
@ -31,6 +31,8 @@ dev_compiler/test/worker/*: Skip # test needs fixes
|
|||
front_end/test/fasta/analyze_test: Pass, Slow
|
||||
front_end/test/fasta/ast_builder_test: Pass, Slow
|
||||
front_end/test/fasta/bootstrap_test: Pass, Slow
|
||||
front_end/test/fasta/fast_legacy_test: Pass, Slow
|
||||
front_end/test/fasta/fast_strong_test: Pass, Slow
|
||||
front_end/test/fasta/legacy_test: Pass, ExtraSlow
|
||||
front_end/test/fasta/outline_test: Pass, Slow
|
||||
front_end/test/fasta/rasta/*: SkipByDesign # Anything in rasta is input to fasta unit tests and shouldn't be run as tests.
|
||||
|
|
|
@ -138,8 +138,8 @@ abstract class ChainContext {
|
|||
!partialSelectors.any((s) => selector.startsWith(s))) {
|
||||
continue;
|
||||
}
|
||||
final Set<Expectation> expectedOutcomes =
|
||||
expectations.expectations(description.shortName);
|
||||
final Set<Expectation> expectedOutcomes = processExpectedOutcomes(
|
||||
expectations.expectations(description.shortName));
|
||||
final StringBuffer sb = new StringBuffer();
|
||||
final Step lastStep = steps.isNotEmpty ? steps.last : null;
|
||||
final Iterator<Step> iterator = steps.iterator;
|
||||
|
@ -255,6 +255,10 @@ abstract class ChainContext {
|
|||
}
|
||||
}
|
||||
|
||||
Set<Expectation> processExpectedOutcomes(Set<Expectation> outcomes) {
|
||||
return outcomes;
|
||||
}
|
||||
|
||||
Result processTestResult(
|
||||
TestDescription description, Result result, bool last) {
|
||||
if (description is FileBasedTestDescription &&
|
||||
|
|
|
@ -53,16 +53,16 @@ Future<TestRoot> computeTestRoot(String configurationPath, Uri base) {
|
|||
///
|
||||
/// The optional argument [configurationPath] should be used when
|
||||
/// `testing.json` isn't located in the current working directory and is a path
|
||||
/// relative to `Platform.script`.
|
||||
/// relative to [me] which defaults to `Platform.script`.
|
||||
Future<Null> runMe(List<String> arguments, CreateContext f,
|
||||
[String configurationPath]) {
|
||||
[String configurationPath, Uri me]) {
|
||||
me ??= Platform.script;
|
||||
return withErrorHandling(() async {
|
||||
TestRoot testRoot =
|
||||
await computeTestRoot(configurationPath, Platform.script);
|
||||
TestRoot testRoot = await computeTestRoot(configurationPath, me);
|
||||
CommandLine cl = CommandLine.parse(arguments);
|
||||
if (cl.verbose) enableVerboseOutput();
|
||||
for (Chain suite in testRoot.toolChains) {
|
||||
if (Platform.script == suite.source) {
|
||||
if (me == suite.source) {
|
||||
print("Running suite ${suite.name}...");
|
||||
ChainContext context = await f(suite, cl.environment);
|
||||
await context.run(suite, new Set<String>.from(cl.selectors));
|
||||
|
|
Loading…
Reference in a new issue