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

Side by Side Diff: tests/standalone/io/code_collection_test.dart

Issue 1952063004: - Add more information for failing test. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Dart test program testing code GC. 5 // Dart test program testing code GC.
6 6
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 import "dart:async"; 8 import "dart:async";
9 import "dart:io"; 9 import "dart:io";
10 10
(...skipping 30 matching lines...) Expand all
41 }); 41 });
42 } 42 }
43 43
44 44
45 main(List<String> arguments) { 45 main(List<String> arguments) {
46 if (arguments.contains("--run")) { 46 if (arguments.contains("--run")) {
47 doTest(); 47 doTest();
48 } else { 48 } else {
49 // Run the test and capture stdout. 49 // Run the test and capture stdout.
50 var pr = Process.runSync(Platform.executable, 50 var pr = Process.runSync(Platform.executable,
51 ["--collect-code", 51 ["--verbose-gc",
52 "--collect-code",
52 "--code-collection-interval-in-us=0", 53 "--code-collection-interval-in-us=0",
53 "--old_gen_growth_rate=10", 54 "--old_gen_growth_rate=10",
54 "--log-code-drop", 55 "--log-code-drop",
55 "--optimization-counter-threshold=-1", 56 "--optimization-counter-threshold=-1",
56 "--package-root=${Platform.packageRoot}", 57 "--package-root=${Platform.packageRoot}",
57 Platform.script.toFilePath(), 58 Platform.script.toFilePath(),
58 "--run"]); 59 "--run"]);
59 60
60 Expect.equals(0, pr.exitCode); 61 Expect.equals(0, pr.exitCode);
61 62
62 // Code drops are logged with --log-code-drop. Look through stdout for the 63 // Code drops are logged with --log-code-drop. Look through stdout for the
63 // message that foo's code was dropped. 64 // message that foo's code was dropped.
65 print(pr.stdout);
64 var count = 0; 66 var count = 0;
65 pr.stdout.split("\n").forEach((line) { 67 pr.stdout.split("\n").forEach((line) {
66 if (line.contains("foo=2")) { 68 if (line.contains("foo=2")) {
67 Expect.equals(0, count); 69 Expect.equals(0, count);
68 count++; 70 count++;
69 } 71 }
70 if (line.contains("Detaching code") && line.contains("foo")) { 72 if (line.contains("Detaching code") && line.contains("foo")) {
71 Expect.equals(1, count); 73 Expect.equals(1, count);
72 count++; 74 count++;
73 } 75 }
74 if (line.contains("foo=3")) { 76 if (line.contains("foo=3")) {
75 Expect.equals(2, count); 77 Expect.equals(2, count);
76 count++; 78 count++;
77 } 79 }
78 }); 80 });
79 Expect.equals(3, count); 81 Expect.equals(3, count);
80 } 82 }
81 } 83 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698