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

Issue 8905021: Dartest CL - Please review (Closed)

Created:
9 years ago by shauvik
Modified:
9 years ago
CC:
reviews_dartlang.org, pdr
Visibility:
Public.

Description

Code for Dartest which consists of two parts: 1. Test runner library located in client/testing/ 2. Instrumentation code for adding coverage probes Added some fixes to the AST Writer and changes to highlight instrumented nodes. Committed: https://code.google.com/p/dart/source/detail?r=2549

Patch Set 1 : '' #

Total comments: 131

Patch Set 2 : '' #

Total comments: 23

Patch Set 3 : '' #

Total comments: 17

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2080 lines, -489 lines) Patch
M client/samples/total/src/Total.dart View 1 chunk +0 lines, -28 lines 0 comments Download
M client/samples/total/src/TotalLib.dart View 1 chunk +28 lines, -0 lines 0 comments Download
A client/testing/dartest/README.txt View 1 chunk +22 lines, -0 lines 0 comments Download
A client/testing/dartest/css.dart View 1 2 1 chunk +306 lines, -0 lines 0 comments Download
A client/testing/dartest/dartest.dart View 1 2 3 1 chunk +527 lines, -0 lines 0 comments Download
A client/testing/dartest/resources/close.png View Binary file 0 comments Download
A client/testing/dartest/resources/expand.png View Binary file 0 comments Download
A client/testing/dartest/resources/img2base64.py View 1 chunk +19 lines, -0 lines 0 comments Download
A client/testing/dartest/resources/max.png View Binary file 0 comments Download
A client/testing/dartest/resources/min.png View Binary file 0 comments Download
M client/testing/unittest/shared.dart View 1 5 chunks +15 lines, -4 lines 0 comments Download
M client/testing/unittest/unittest.dart View 1 chunk +1 line, -1 line 0 comments Download
A client/testing/unittest/unittest_dartest.dart View 1 1 chunk +91 lines, -0 lines 0 comments Download
M client/tests/client/samples/total/total_tests.dart View 1 1 chunk +2 lines, -440 lines 0 comments Download
M compiler/java/com/google/dart/compiler/CommandLineOptions.java View 1 2 3 2 chunks +9 lines, -8 lines 0 comments Download
M compiler/java/com/google/dart/compiler/DartCompiler.java View 2 chunks +5 lines, -0 lines 0 comments Download
A compiler/java/com/google/dart/compiler/ast/CoverageInstrumenter.java View 1 2 3 1 chunk +807 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/ast/DartNode.java View 2 chunks +13 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/ast/viz/BaseASTWriter.java View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M compiler/java/com/google/dart/compiler/ast/viz/ConsoleWriter.java View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M compiler/java/com/google/dart/compiler/ast/viz/DotWriter.java View 1 2 3 2 chunks +17 lines, -6 lines 0 comments Download
M compiler/lib/corelib.dart View 1 chunk +1 line, -0 lines 0 comments Download
A compiler/lib/coverage.dart View 1 2 1 chunk +213 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
shauvik
Hi, This is the work behind my internship. I'll be sending out a demo video ...
9 years ago (2011-12-13 21:46:31 UTC) #1
Bob Nystrom
Just reviewed the changes under client/testing/unittest. http://codereview.chromium.org/8905021/diff/6001/client/testing/unittest/shared.dart File client/testing/unittest/shared.dart (right): http://codereview.chromium.org/8905021/diff/6001/client/testing/unittest/shared.dart#newcode14 client/testing/unittest/shared.dart:14: /** Test Runner ...
9 years ago (2011-12-14 00:15:30 UTC) #2
pdr
General comments (many are the same as Bob's). http://codereview.chromium.org/8905021/diff/6001/client/testing/dartest/css.dart File client/testing/dartest/css.dart (right): http://codereview.chromium.org/8905021/diff/6001/client/testing/dartest/css.dart#newcode3 client/testing/dartest/css.dart:3: // ...
9 years ago (2011-12-14 21:02:36 UTC) #3
Kelly Norton
I stacked up quite a few comments in a couple of files. Some of the ...
9 years ago (2011-12-15 18:35:31 UTC) #4
shauvik
Hi All, Thanks for all your comments and support! I have tried to address them ...
9 years ago (2011-12-16 07:19:27 UTC) #5
pdr
http://codereview.chromium.org/8905021/diff/17001/client/testing/dartest/dartest.dart File client/testing/dartest/dartest.dart (right): http://codereview.chromium.org/8905021/diff/17001/client/testing/dartest/dartest.dart#newcode100 client/testing/dartest/dartest.dart:100: Extra space http://codereview.chromium.org/8905021/diff/17001/client/testing/dartest/dartest.dart#newcode211 client/testing/dartest/dartest.dart:211: headDiv.innerHTML = '<b>DARTest: In-App View</b>'; ...
9 years ago (2011-12-16 17:00:49 UTC) #6
shauvik
Hi, I have fixed the issues raised by Philip. Please let me know if it ...
9 years ago (2011-12-16 17:57:05 UTC) #7
Bob Nystrom
The stuff under client/testing/unittest LGTM!
9 years ago (2011-12-16 19:22:08 UTC) #8
Kelly Norton
Still looking at the review, but I think this is one thing you want to ...
9 years ago (2011-12-16 19:48:12 UTC) #9
Kelly Norton
besides the map issue and a few little nits, this lgtm. Can you bug one ...
9 years ago (2011-12-16 20:01:17 UTC) #10
zundel
9 years ago (2011-12-16 20:49:05 UTC) #11
lgtm, there is nothing I feel strongly about here

http://codereview.chromium.org/8905021/diff/23026/compiler/java/com/google/da...
File compiler/java/com/google/dart/compiler/CommandLineOptions.java (right):

http://codereview.chromium.org/8905021/diff/23026/compiler/java/com/google/da...
compiler/java/com/google/dart/compiler/CommandLineOptions.java:81: usage = "Add
instrumentation probes for collecting coverage. Supported types include
function, statement and branch")
line > 100 chars

http://codereview.chromium.org/8905021/diff/23026/compiler/java/com/google/da...
File compiler/java/com/google/dart/compiler/DartCompiler.java (right):

http://codereview.chromium.org/8905021/diff/23026/compiler/java/com/google/da...
compiler/java/com/google/dart/compiler/DartCompiler.java:689:
coverageInstrumenter.process(libraries);
nit.  you have an internal loop that duplicates the nested for loops below.  You
could move process() into the for loop and have it accept a unit as input.

Or you could make the instrumenter a part of the Normalizer.

http://codereview.chromium.org/8905021/diff/23026/compiler/java/com/google/da...
File compiler/java/com/google/dart/compiler/ast/CoverageInstrumenter.java
(right):

http://codereview.chromium.org/8905021/diff/23026/compiler/java/com/google/da...
compiler/java/com/google/dart/compiler/ast/CoverageInstrumenter.java:87:
System.out.println("Instrumenting " + unit.getSourceName() + ", lib:"
this looks like debugging...  for a real dart program you going to get a lot of
output here.

http://codereview.chromium.org/8905021/diff/23026/compiler/java/com/google/da...
compiler/java/com/google/dart/compiler/ast/CoverageInstrumenter.java:138: if
("all".equals(covType)) {
instead of inlined strings, I'd make constants out of these values.

http://codereview.chromium.org/8905021/diff/23026/compiler/java/com/google/da...
compiler/java/com/google/dart/compiler/ast/CoverageInstrumenter.java:144:
instrumenters.add(new StatementInstrumenter());
is it going to cause problems if you add the same instrumenter more than once? 
Maybe instrumenters should be a Set?

http://codereview.chromium.org/8905021/diff/23026/compiler/java/com/google/da...
compiler/java/com/google/dart/compiler/ast/CoverageInstrumenter.java:160:
private static class BaseInstrumenter extends DartModVisitor {
FYI, we've been trying to replace instances of DartModVisitor with
DartNodeTraverser.  You probably don't have time to fix it, add a TODO

http://codereview.chromium.org/8905021/diff/23026/compiler/java/com/google/da...
compiler/java/com/google/dart/compiler/ast/CoverageInstrumenter.java:165: new
HashMap<String, Integer>(),
style nit: don't use the comma for followon declarations like this, use a
separate statement for each one.

http://codereview.chromium.org/8905021/diff/23026/compiler/java/com/google/da...
compiler/java/com/google/dart/compiler/ast/CoverageInstrumenter.java:302: *
myFunction(){ coverFunction('unit.dart', 'myFunction'); stmts; ... }
You aren't covering closures here. Is that intentional?  I would think they
might be useful. You might create a name out of the unit name and line number
since naming closure expressions is optional.

http://codereview.chromium.org/8905021/diff/23026/compiler/java/com/google/da...
compiler/java/com/google/dart/compiler/ast/CoverageInstrumenter.java:369: public
boolean visit(DartBlock x, DartContext ctx) {
it would be nice to add a big fat comment like you did for visitDartFunction
above about what gets added to the statement.

http://codereview.chromium.org/8905021/diff/23026/compiler/java/com/google/da...
compiler/java/com/google/dart/compiler/ast/CoverageInstrumenter.java:416: public
void endVisit(DartIfStatement x, DartContext ctx) {
same comment as above - I'd appreciate seeing how the statmement is
instrumented.

http://codereview.chromium.org/8905021/diff/23026/compiler/java/com/google/da...
compiler/java/com/google/dart/compiler/ast/CoverageInstrumenter.java:477: *  
case 'b': do1(); break;
I didn't think you needed a break stmt in dart.

http://codereview.chromium.org/8905021/diff/23026/compiler/java/com/google/da...
File compiler/java/com/google/dart/compiler/ast/viz/BaseASTWriter.java (right):

http://codereview.chromium.org/8905021/diff/23026/compiler/java/com/google/da...
compiler/java/com/google/dart/compiler/ast/viz/BaseASTWriter.java:89:
"observable", "layout.dart", "unittest", "dartest"};
use spaces instead of tabs

http://codereview.chromium.org/8905021/diff/23026/compiler/java/com/google/da...
File compiler/java/com/google/dart/compiler/ast/viz/DotWriter.java (right):

http://codereview.chromium.org/8905021/diff/23026/compiler/java/com/google/da...
compiler/java/com/google/dart/compiler/ast/viz/DotWriter.java:96: data =
data.replaceAll("\"", "'");
odd indentation

http://codereview.chromium.org/8905021/diff/23026/compiler/java/com/google/da...
compiler/java/com/google/dart/compiler/ast/viz/DotWriter.java:98: data =
data.replaceAll("\r", "\\r");
this is a bit optimisitc.  If you already have a statement \\r or \\n I don't
think this is going to work the way you want it to.

you could use a regular expression something like: s/[^\]?\n/\\n/

http://codereview.chromium.org/8905021/diff/23026/compiler/lib/coverage.dart
File compiler/lib/coverage.dart (right):

http://codereview.chromium.org/8905021/diff/23026/compiler/lib/coverage.dart#...
compiler/lib/coverage.dart:5: //#library("coverage");
Why the comment? does this line need to be removed?

Powered by Google App Engine
This is Rietveld 408576698