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

Unified Diff: pkg/dev_compiler/test/multitest.dart

Issue 2930203002: fix test runner to understand mutlitests that expect an error (Closed)
Patch Set: Created 3 years, 6 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/dev_compiler/test/browser/language_tests.js ('k') | pkg/dev_compiler/tool/run.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/test/multitest.dart
diff --git a/pkg/dev_compiler/test/multitest.dart b/pkg/dev_compiler/test/multitest.dart
index 7451bfb05c4481e3271e1d6fb0659e22816f8966..95b856e0b56eb5b5d490811554d8dddc63a8ede2 100644
--- a/pkg/dev_compiler/test/multitest.dart
+++ b/pkg/dev_compiler/test/multitest.dart
@@ -15,6 +15,11 @@ final validMultitestOutcomes = new Set<String>.from([
'checked mode compile-time error'
]);
+final runtimeErrorOutcomes = [
+ 'runtime error',
+ 'dynamic type error',
+];
+
// Require at least one non-space character before '//#'
// Handle both //# and the legacy /// multitest regexp patterns.
final _multiTestRegExp = new RegExp(r"\S *//[#/] \w+:(.*)");
@@ -122,7 +127,12 @@ void extractTestsFromMultitest(String filePath, String contents,
// joining the lines.
var marker = '// Test created from multitest named $filePath.'
'$line_separator';
- for (var test in testsAsLines.values) test.add(marker);
+ testsAsLines.forEach((key, test) {
+ if (runtimeErrorOutcomes.any(outcomes[key].contains)) {
+ test.add('final _expectRuntimeError = true;');
+ }
+ test.add(marker);
+ });
var keysToDelete = [];
// Check that every key (other than the none case) has at least one outcome
« no previous file with comments | « pkg/dev_compiler/test/browser/language_tests.js ('k') | pkg/dev_compiler/tool/run.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698