Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Unified Diff: tools/testing/dart/test_runner.dart

Issue 150223002: Add 'static type error' tags to multitests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rename 'static type error' to 'checked mode compile-time error'. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/testing/dart/test_progress.dart ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_runner.dart
diff --git a/tools/testing/dart/test_runner.dart b/tools/testing/dart/test_runner.dart
index b5eb6f8ea9f686e9c8320580b7fb5372374d2e7a..da880bd6af4806978c7871719b19869dbe4f1247 100644
--- a/tools/testing/dart/test_runner.dart
+++ b/tools/testing/dart/test_runner.dart
@@ -726,6 +726,14 @@ class TestCase extends UniqueObject {
}
}
+ /// Returns `true` if this test case should result in a compile-time error,
+ /// either unconditionally or if the configuration is 'checked'.
+ bool get expectCompileError {
+ if (info == null) return false;
+ return info.hasCompileError ||
+ (configuration['checked'] && info.hasCompileErrorIfChecked);
+ }
+
bool get unexpectedOutput {
var outcome = lastCommandOutput.result(this);
return !expectedOutcomes.any((expectation) {
@@ -1396,6 +1404,8 @@ class AnalysisCommandOutputImpl extends CommandOutputImpl {
// Handle errors / missing errors
if (testCase.info.hasCompileError) {
+ // Don't use [TestCase.expectCompileError] since the analyzer does not
+ // (currently) report checked-mode only compile time errors.
if (errors.length > 0) {
return Expectation.PASS;
}
@@ -1482,7 +1492,7 @@ class VmCommandOutputImpl extends CommandOutputImpl
// Multitests are handled specially
if (testCase.info != null) {
- if (testCase.info.hasCompileError) {
+ if (testCase.expectCompileError) {
if (exitCode == DART_VM_EXITCODE_COMPILE_TIME_ERROR) {
return Expectation.PASS;
}
@@ -1539,7 +1549,7 @@ class CompilationCommandOutputImpl extends CommandOutputImpl {
// Multitests are handled specially
if (testCase.info != null) {
- if (testCase.info.hasCompileError) {
+ if (testCase.expectCompileError) {
// Nonzero exit code of the compiler means compilation failed
// TODO(kustermann): Do we have a special exit code in that case???
if (exitCode != 0) {
« no previous file with comments | « tools/testing/dart/test_progress.dart ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698