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

Unified Diff: test/codegen_test.dart

Issue 2079373002: Verify status of statically failing tests (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Address comments Created 4 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 | « test/browser/language_tests.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen_test.dart
diff --git a/test/codegen_test.dart b/test/codegen_test.dart
index c7f1486d1ef40b4fd7fec2e35ad5f874d2cd4988..90b1e70765b0b91ef976af9e7f473a2240c2a413 100644
--- a/test/codegen_test.dart
+++ b/test/codegen_test.dart
@@ -164,7 +164,23 @@ void _writeModule(String outPath, JSModuleFile result) {
}
} else {
// Also write the errors to a '.err' file for easy counting.
- errorFile.writeAsStringSync(errors);
+ var moduleName = result.name;
+ var libraryName = path.split(moduleName).last;
+ var count = "[error]".allMatches(errors).length;
+ var text = '''
+dart_library.library('$moduleName', null, [
+ 'dart_sdk',
+ 'expect'
+], function(exports, dart_sdk, expect) {
+ const message = `DDC Compilation Error: $moduleName has $count errors`;
+ const error = new Error(message);
+ exports.$libraryName = Object.create(null);
+ exports.$libraryName.main = function() {
+ throw error;
+ }
+});
+ ''';
+ errorFile.writeAsStringSync(text);
// There are errors, so delete any stale ".js" file.
if (jsFile.existsSync()) {
« no previous file with comments | « test/browser/language_tests.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698