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

Unified Diff: test/kernel/kernel_test.dart

Issue 2070143002: Track void context. (Closed) Base URL: git@github.com:dart-lang/rasta.git@visit_for_value
Patch Set: Merged with ad52721ca12cbb5c47e968ae2070408e1fef7017 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 | « lib/kernel_visitor.dart ('k') | test/kernel/regression/for_loop.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/kernel/kernel_test.dart
diff --git a/test/kernel/kernel_test.dart b/test/kernel/kernel_test.dart
index 86f64d80f7087e26cc78947c9dfd56ecf430fc40..abce89896f2e500d9ff835877810c5672521a2c6 100644
--- a/test/kernel/kernel_test.dart
+++ b/test/kernel/kernel_test.dart
@@ -29,9 +29,6 @@ import 'package:rasta/testing.dart' show
import 'package:rasta/src/rastask.dart' show
openWrite;
-import 'package:expect/expect.dart' show
- Expect;
-
import '../../bin/rastak.dart' as rastak show main;
const bool generateExpectations =
@@ -59,6 +56,7 @@ Future<Null> main() async {
await addRegressions(tests, temp);
List<Uri> generated = <Uri>[];
+ Map<Uri, Uri> mismatches = <Uri, Uri>{};
for (Uri source in tests.keys) {
print("Rastarizing $source");
@@ -67,7 +65,7 @@ Future<Null> main() async {
await output.parent.create(recursive: true);
ir.TreeNode node = await rastak.main(<String>["$source", "$bart"], null);
- await checkAgainstExpectations(node, generated);
+ await checkAgainstExpectations(node, generated, mismatches);
Uri textOutput = bart.resolve("${bart.path}.txt");
print("Kernelizing $bart to $textOutput");
@@ -91,9 +89,19 @@ Future<Null> main() async {
throw "The following files were generated, "
"please check them and re-run this test: ${generated}";
}
+ if (mismatches.isNotEmpty) {
+ StringBuffer sb = new StringBuffer();
+ mismatches.forEach((Uri test, Uri expectation) {
+ sb.writeln("Output from '$test' doesn't match '$expectation'.");
+ });
+ throw "$sb";
+ }
}
-Future<Null> checkAgainstExpectations(ir.Node node, List<Uri> generated) async {
+Future<Null> checkAgainstExpectations(
+ ir.Node node,
+ List<Uri> generated,
+ Map<Uri, Uri> mismatches) async {
ir.Library library = (node is ir.Program) ? node.mainMethod.parent : node;
Uri uri = library.importUri;
@@ -105,7 +113,10 @@ Future<Null> checkAgainstExpectations(ir.Node node, List<Uri> generated) async {
File expectedFile = new File("${uri.toFilePath()}.txt");
if (await expectedFile.exists()) {
String expected = await expectedFile.readAsString();
- Expect.stringEquals(expected.trim(), "$buffer".trim());
+ if (expected.trim() != "$buffer".trim()) {
+ print("$uri doesn't match ${expectedFile.uri}");
+ mismatches[uri] = expectedFile.uri;
+ }
} else if (generateExpectations) {
await openWrite(expectedFile.uri, (IOSink sink) {
sink.write("$buffer".trim());
« no previous file with comments | « lib/kernel_visitor.dart ('k') | test/kernel/regression/for_loop.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698