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

Issue 694703005: When running DM, write test failures to json. (Closed)

Created:
6 years, 1 month ago by scroggo
Modified:
6 years, 1 month ago
Reviewers:
jcgregorio, mtklein
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Project:
skia
Visibility:
Public.

Description

When running DM, write test failures to json. Add skiatest::Failure to keep track of data about a test failure. Reporter::reportFailed and ::onReportFailed now take Failure as a parameter. This allows the implementation to treat the failure as it wishes. Provide a helper to format the failure the same as prior to the change. Update the macros for calling reportFailed (REPORTER_ASSERT etc) to create a Failure object. Convert a direct call to reportFailed to the macro ERRORF. Write Failures to Json. Sample output when running dm on the dummy test crrev.com/705723004: { "test_results" : { "failures" : [ { "condition" : "0 > 3", "file_name" : "../../tests/DummyTest.cpp", "line_no" : 10, "message" : "" }, { "condition" : "false", "file_name" : "../../tests/DummyTest.cpp", "line_no" : 4, "message" : "" }, { "condition" : "1 == 3", "file_name" : "../../tests/DummyTest.cpp", "line_no" : 5, "message" : "I can too count!" }, { "condition" : "", "file_name" : "../../tests/DummyTest.cpp", "line_no" : 6, "message" : "seven is 7" }, { "condition" : "1 == 3", "file_name" : "../../tests/DummyTest.cpp", "line_no" : 14, "message" : "I can too count!" } ] } } Report all of the failures from one test. Previously, if one test had multiple failures, only one was reportered. e.g: Failures: test Dummy: ../../tests/DummyTest.cpp:6 seven is 7 test Dummy2: ../../tests/DummyTest.cpp:10 0 > 3 test Dummy3: ../../tests/DummyTest.cpp:14 I can too count!: 1 == 3 3 failures. Now, we get all the messages: Failures: test Dummy: ../../tests/DummyTest.cpp:4 false ../../tests/DummyTest.cpp:5 I can too count!: 1 == 3 ../../tests/DummyTest.cpp:6 seven is 7 test Dummy2: ../../tests/DummyTest.cpp:10 0 > 3 test Dummy3: ../../tests/DummyTest.cpp:14 I can too count!: 1 == 3 3 failures. (Note that we still state "3 failures" because 3 DM::Tasks failed.) BUG=skia:3082 BUG=skia:2454 Committed: https://skia.googlesource.com/skia/+/0ee2627026370bbb25e4efda490e14e468ac86fb

Patch Set 1 #

Total comments: 15

Patch Set 2 : Respond to comments. #

Patch Set 3 : Fix null pointer crash. #

Total comments: 2

Patch Set 4 : Use "" instead of NULL #

Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -33 lines) Patch
M dm/DMJsonWriter.h View 2 chunks +6 lines, -0 lines 0 comments Download
M dm/DMJsonWriter.cpp View 1 3 2 chunks +21 lines, -0 lines 0 comments Download
M dm/DMTestTask.h View 1 2 chunks +11 lines, -2 lines 0 comments Download
M tests/GrTRecorderTest.cpp View 1 chunk +1 line, -1 line 0 comments Download
M tests/Test.h View 1 2 3 4 chunks +57 lines, -23 lines 0 comments Download
M tests/Test.cpp View 3 chunks +6 lines, -6 lines 0 comments Download
M tests/skia_test.cpp View 1 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 13 (3 generated)
scroggo
Joe, I am including you because it is my understanding that you're the one who ...
6 years, 1 month ago (2014-11-05 20:40:18 UTC) #2
mtklein
I have a bunch of nits, but this looks great. Very excited to see it ...
6 years, 1 month ago (2014-11-06 15:24:05 UTC) #3
jcgregorio
On 2014/11/05 20:40:18, scroggo wrote: > Joe, I am including you because it is my ...
6 years, 1 month ago (2014-11-06 15:45:12 UTC) #4
mtklein
> The format looks good, but I would want to add similar information that we ...
6 years, 1 month ago (2014-11-06 15:53:17 UTC) #5
jcgregorio
On 2014/11/06 15:53:17, mtklein wrote: > > The format looks good, but I would want ...
6 years, 1 month ago (2014-11-06 15:57:35 UTC) #6
scroggo
On 2014/11/06 15:53:17, mtklein wrote: > Correct me if I'm wrong, but this is going ...
6 years, 1 month ago (2014-11-06 16:52:33 UTC) #8
mtklein
lgtm https://codereview.chromium.org/694703005/diff/60001/tests/Test.h File tests/Test.h (right): https://codereview.chromium.org/694703005/diff/60001/tests/Test.h#newcode173 tests/Test.h:173: NULL, SkString(desc) }; \ Consider "" instead of ...
6 years, 1 month ago (2014-11-06 17:46:54 UTC) #9
scroggo
https://codereview.chromium.org/694703005/diff/60001/tests/Test.h File tests/Test.h (right): https://codereview.chromium.org/694703005/diff/60001/tests/Test.h#newcode173 tests/Test.h:173: NULL, SkString(desc) }; \ On 2014/11/06 17:46:54, mtklein wrote: ...
6 years, 1 month ago (2014-11-06 20:29:32 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/694703005/80001
6 years, 1 month ago (2014-11-06 20:30:04 UTC) #12
commit-bot: I haz the power
6 years, 1 month ago (2014-11-07 14:07:38 UTC) #13
Message was sent while issue was closed.
Committed patchset #4 (id:80001) as 0ee2627026370bbb25e4efda490e14e468ac86fb

Powered by Google App Engine
This is Rietveld 408576698