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

Issue 22228002: Add optional schema compiler error messages (Closed)

Created:
7 years, 4 months ago by dhnishi (use Chromium)
Modified:
7 years, 4 months ago
Reviewers:
dhnishi, not at google - send to devlin
CC:
chromium-reviews
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Add optional schema compiler error messages and unit tests. Provides the ability to generate error messages within schema-compiled code for ease of debugging. Error messages may be disabled by adding a 'generate_error_messages' property to json schema, e.g. "generate_error_messages": false Error generation mostly written by Aaron Jacobs (https://codereview.chromium.org/16462004/). BUG=234834 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=217118

Patch Set 1 #

Patch Set 2 : Manual diff. #

Patch Set 3 : Removed reference to removed name. #

Patch Set 4 : Fix a typo that broke the build process and enabled error checking. #

Patch Set 5 : Unit tests! #

Total comments: 20

Patch Set 6 : Addressing Kalman's comments in #2. #

Patch Set 7 : Code clean up, fixed tests, improved errors. #

Total comments: 6

Patch Set 8 : Addressing Kalman. #

Patch Set 9 : Templates. #

Total comments: 1

Patch Set 10 : Expected value now comes first. #

Patch Set 11 : Removed unneeded whitespace. #

Patch Set 12 : Fixed failing unit test, added new unit test. #

Patch Set 13 : Synced up to latest master. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+515 lines, -60 lines) Patch
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M tools/json_schema_compiler/cc_generator.py View 1 2 3 4 5 6 7 8 9 10 11 14 chunks +141 lines, -50 lines 0 comments Download
M tools/json_schema_compiler/code.py View 1 chunk +2 lines, -2 lines 0 comments Download
M tools/json_schema_compiler/h_generator.py View 1 2 4 5 4 chunks +15 lines, -5 lines 0 comments Download
M tools/json_schema_compiler/model.py View 2 chunks +3 lines, -3 lines 0 comments Download
A tools/json_schema_compiler/test/error_generation.json View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +118 lines, -0 lines 0 comments Download
A tools/json_schema_compiler/test/error_generation_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +203 lines, -0 lines 0 comments Download
M tools/json_schema_compiler/test/json_schema_compiler_tests.gyp View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M tools/json_schema_compiler/util.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M tools/json_schema_compiler/util.cc View 1 2 3 4 1 chunk +23 lines, -0 lines 0 comments Download
M tools/json_schema_compiler/util_cc_helper.py View 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (0 generated)
dhnishi (use Chromium)
@kalman Got the unit tests built! It's currently passing all of the JSON Schema Compiler ...
7 years, 4 months ago (2013-08-08 21:31:05 UTC) #1
not at google - send to devlin
On 2013/08/08 21:31:05, Daniel Nishi wrote: > @kalman > > Got the unit tests built! ...
7 years, 4 months ago (2013-08-08 23:12:07 UTC) #2
dhnishi (use Chromium)
Removed the error generation for the expected list test. Replaced with a DCHECK. Flipped the ...
7 years, 4 months ago (2013-08-08 23:30:34 UTC) #3
not at google - send to devlin
awesome. just reviewing the tests mostly here because it finally lets me see these error ...
7 years, 4 months ago (2013-08-09 00:08:49 UTC) #4
dhnishi (use Chromium)
https://codereview.chromium.org/22228002/diff/20001/tools/json_schema_compiler/test/error_generation_unittest.cc File tools/json_schema_compiler/test/error_generation_unittest.cc (right): https://codereview.chromium.org/22228002/diff/20001/tools/json_schema_compiler/test/error_generation_unittest.cc#newcode17 tools/json_schema_compiler/test/error_generation_unittest.cc:17: value->SetWithoutPathExpansion("string", Value::CreateStringValue("bling")); On 2013/08/09 00:08:49, kalman wrote: > there ...
7 years, 4 months ago (2013-08-09 17:59:50 UTC) #5
not at google - send to devlin
lgtm https://codereview.chromium.org/22228002/diff/49001/tools/json_schema_compiler/cc_generator.py File tools/json_schema_compiler/cc_generator.py (right): https://codereview.chromium.org/22228002/diff/49001/tools/json_schema_compiler/cc_generator.py#newcode205 tools/json_schema_compiler/cc_generator.py:205: ', got " + ' + use %s ...
7 years, 4 months ago (2013-08-09 18:20:58 UTC) #6
dhnishi (use Chromium)
https://codereview.chromium.org/22228002/diff/49001/tools/json_schema_compiler/test/error_generation_unittest.cc File tools/json_schema_compiler/test/error_generation_unittest.cc (right): https://codereview.chromium.org/22228002/diff/49001/tools/json_schema_compiler/test/error_generation_unittest.cc#newcode27 tools/json_schema_compiler/test/error_generation_unittest.cc:27: EXPECT_FALSE(TestType::Populate(*value, new TestType(), &error)); On 2013/08/09 18:20:58, kalman wrote: ...
7 years, 4 months ago (2013-08-09 20:50:48 UTC) #7
dhnishi (use Chromium)
Templates are live. Valgrind isn't complaining about any leakde memory anymore. Woo!
7 years, 4 months ago (2013-08-09 21:12:17 UTC) #8
not at google - send to devlin
Meant to send this out before. https://codereview.chromium.org/22228002/diff/49001/tools/json_schema_compiler/test/error_generation_unittest.cc File tools/json_schema_compiler/test/error_generation_unittest.cc (right): https://codereview.chromium.org/22228002/diff/49001/tools/json_schema_compiler/test/error_generation_unittest.cc#newcode112 tools/json_schema_compiler/test/error_generation_unittest.cc:112: EXPECT_EQ(error, "'string': expected ...
7 years, 4 months ago (2013-08-09 21:13:01 UTC) #9
not at google - send to devlin
https://codereview.chromium.org/22228002/diff/58001/tools/json_schema_compiler/test/error_generation_unittest.cc File tools/json_schema_compiler/test/error_generation_unittest.cc (right): https://codereview.chromium.org/22228002/diff/58001/tools/json_schema_compiler/test/error_generation_unittest.cc#newcode35 tools/json_schema_compiler/test/error_generation_unittest.cc:35: "expected dictionary, got binary"); the usual idiom is to ...
7 years, 4 months ago (2013-08-09 21:14:02 UTC) #10
not at google - send to devlin
lgtm
7 years, 4 months ago (2013-08-09 21:14:11 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/DHNishi@gmail.com/22228002/65001
7 years, 4 months ago (2013-08-09 21:23:33 UTC) #12
commit-bot: I haz the power
Failed to trigger a try job on chromium_presubmit HTTP Error 400: Bad Request
7 years, 4 months ago (2013-08-09 21:23:44 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/DHNishi@gmail.com/22228002/61002
7 years, 4 months ago (2013-08-09 21:27:06 UTC) #14
commit-bot: I haz the power
Retried try job too often on linux_aura for step(s) unit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_aura&number=67983
7 years, 4 months ago (2013-08-09 22:56:52 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/DHNishi@gmail.com/22228002/40002
7 years, 4 months ago (2013-08-09 23:14:00 UTC) #16
commit-bot: I haz the power
Step "update" is always a major failure. Look at the try server FAQ for more ...
7 years, 4 months ago (2013-08-09 23:38:12 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/DHNishi@gmail.com/22228002/87001
7 years, 4 months ago (2013-08-09 23:43:22 UTC) #18
commit-bot: I haz the power
Step "update" is always a major failure. Look at the try server FAQ for more ...
7 years, 4 months ago (2013-08-10 00:10:43 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/DHNishi@gmail.com/22228002/87001
7 years, 4 months ago (2013-08-10 00:35:26 UTC) #20
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=186171
7 years, 4 months ago (2013-08-10 08:04:36 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/DHNishi@gmail.com/22228002/87001
7 years, 4 months ago (2013-08-10 17:11:53 UTC) #22
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=186234
7 years, 4 months ago (2013-08-10 21:26:00 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/DHNishi@gmail.com/22228002/87001
7 years, 4 months ago (2013-08-12 14:13:22 UTC) #24
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=186527
7 years, 4 months ago (2013-08-12 19:25:14 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/DHNishi@gmail.com/22228002/87001
7 years, 4 months ago (2013-08-12 22:02:52 UTC) #26
commit-bot: I haz the power
7 years, 4 months ago (2013-08-12 23:45:43 UTC) #27
Message was sent while issue was closed.
Change committed as 217118

Powered by Google App Engine
This is Rietveld 408576698