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

Unified Diff: pkg/testing/lib/src/multitest.dart

Issue 2626003003: Implement multitest expectations. (Closed)
Patch Set: Created 3 years, 11 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 | « pkg/testing/lib/src/log.dart ('k') | pkg/testing/lib/src/test_description.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/testing/lib/src/multitest.dart
diff --git a/pkg/testing/lib/src/multitest.dart b/pkg/testing/lib/src/multitest.dart
index 4679633922f1f2e97e14429022fb4a1d9935df7d..1efbabe71384cc87b2ba3dc715d1ebb2ce5f396a 100644
--- a/pkg/testing/lib/src/multitest.dart
+++ b/pkg/testing/lib/src/multitest.dart
@@ -18,17 +18,29 @@ import 'log.dart' show
import 'test_description.dart' show
TestDescription;
+bool isError(Set<String> expectations) {
+ if (expectations.contains("compile-time error")) return true;
+ if (expectations.contains("runtime error")) return true;
+ if (expectations.contains("dynamic type error")) return true;
karlklose 2017/01/16 07:57:58 Is this annotation intended for strong mode? We di
ahe 2017/01/16 08:37:44 Not sure. I assumed it was for checked mode. Perha
ahe 2017/01/18 11:25:31 Following up in CL 2641833002.
+ return false;
+}
+
+bool isCheckedModeError(Set<String> expectations) {
+ if (expectations.contains("checked mode compile-time error")) return true;
+ return isError(expectations);
+}
+
class MultitestTransformer
implements StreamTransformer<TestDescription, TestDescription> {
static const String multitestMarker = "///";
static const List<String> validOutcomesList = const <String>[
- 'ok',
- 'compile-time error',
- 'runtime error',
- 'static type warning',
- 'dynamic type error',
- 'checked mode compile-time error',
+ "ok",
+ "compile-time error",
+ "runtime error",
+ "static type warning",
+ "dynamic type error",
+ "checked mode compile-time error",
];
static final Set<String> validOutcomes =
@@ -113,6 +125,7 @@ class MultitestTransformer
Uri uri = generated.uri.resolve("${name}_generated.dart");
TestDescription subtest =
new TestDescription(root, new File.fromUri(uri));
+ subtest.multitestExpectations = outcomes[name];
await subtest.file.writeAsString(lines.join(""));
yield subtest;
}
« no previous file with comments | « pkg/testing/lib/src/log.dart ('k') | pkg/testing/lib/src/test_description.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698