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

Issue 9415001: Add tests to tools/json_schema_compiler (Closed)

Created:
8 years, 10 months ago by calamity
Modified:
8 years, 10 months ago
CC:
chromium-reviews, pam+watch_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Add tests to tools/json_schema_compiler Add tests for different json cases by compiling test jsons and running C++ tests against them. Also fixed bugs where tests failed, removed a dead flag and refactored for readability. BUG= TEST= Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=122781

Patch Set 1 #

Total comments: 41

Patch Set 2 : rework, add array tests #

Total comments: 2

Patch Set 3 : remove generated files #

Patch Set 4 : reverted extension.json #

Patch Set 5 : upload with emulate_svn_auto_props flag #

Patch Set 6 : try emulate_svn_auto_props again #

Patch Set 7 : try same flag with different svn config #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+1068 lines, -263 lines) Patch
M chrome/chrome_tests.gypi View 1 2 chunks +5 lines, -0 lines 0 comments Download
M tools/json_schema_compiler/cc_generator.py View 1 2 9 chunks +157 lines, -188 lines 0 comments Download
M tools/json_schema_compiler/compiler.py View 3 chunks +5 lines, -8 lines 0 comments Download
M tools/json_schema_compiler/cpp_type_generator.py View 1 chunk +3 lines, -0 lines 0 comments Download
M tools/json_schema_compiler/cpp_util.py View 1 2 2 chunks +29 lines, -50 lines 1 comment Download
M tools/json_schema_compiler/h_generator.py View 1 2 2 chunks +5 lines, -4 lines 0 comments Download
M tools/json_schema_compiler/model.py View 1 4 chunks +17 lines, -7 lines 0 comments Download
A tools/json_schema_compiler/test/array.json View 1 2 3 4 5 6 1 chunk +120 lines, -0 lines 0 comments Download
A tools/json_schema_compiler/test/array_unittest.cc View 1 1 chunk +143 lines, -0 lines 0 comments Download
A tools/json_schema_compiler/test/choices.json View 1 2 3 4 5 6 1 chunk +101 lines, -0 lines 0 comments Download
A tools/json_schema_compiler/test/choices_unittest.cc View 1 1 chunk +135 lines, -0 lines 0 comments Download
A tools/json_schema_compiler/test/crossref.json View 1 2 3 4 5 6 1 chunk +43 lines, -0 lines 0 comments Download
A tools/json_schema_compiler/test/crossref_unittest.cc View 1 1 chunk +55 lines, -0 lines 0 comments Download
A tools/json_schema_compiler/test/json_schema_compiler_tests.gyp View 1 chunk +27 lines, -0 lines 0 comments Download
A tools/json_schema_compiler/test/simple_api.json View 1 2 3 4 5 6 1 chunk +106 lines, -0 lines 0 comments Download
A tools/json_schema_compiler/test/simple_api_unittest.cc View 1 1 chunk +111 lines, -0 lines 1 comment Download
M tools/json_schema_compiler/util_cc_helper.py View 4 chunks +6 lines, -6 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
calamity
Another day, another large patch. Hopefully this patch is relatively straightforward; it's mostly tests.
8 years, 10 months ago (2012-02-16 06:33:08 UTC) #1
not at google - send to devlin
This is really awesome. I've skimmed through the Python and it seems fine, maybe worth ...
8 years, 10 months ago (2012-02-18 03:29:02 UTC) #2
not at google - send to devlin
Did another lightning pass, mostly just so I could say that "don't worry about it" ...
8 years, 10 months ago (2012-02-19 23:19:59 UTC) #3
not at google - send to devlin
Gone over the python now. http://codereview.chromium.org/9415001/diff/1/tools/json_schema_compiler/cc_generator.py File tools/json_schema_compiler/cc_generator.py (right): http://codereview.chromium.org/9415001/diff/1/tools/json_schema_compiler/cc_generator.py#newcode139 tools/json_schema_compiler/cc_generator.py:139: ) I think that ...
8 years, 10 months ago (2012-02-20 03:44:24 UTC) #4
calamity
Added a couple of array tests, reworked. http://codereview.chromium.org/9415001/diff/1/chrome/chrome_tests.gypi File chrome/chrome_tests.gypi (right): http://codereview.chromium.org/9415001/diff/1/chrome/chrome_tests.gypi#newcode2109 chrome/chrome_tests.gypi:2109: '../tools/json_schema_compiler/test/simple_api_test.cc', On ...
8 years, 10 months ago (2012-02-20 05:03:37 UTC) #5
not at google - send to devlin
lgtm http://codereview.chromium.org/9415001/diff/1/chrome/chrome_tests.gypi File chrome/chrome_tests.gypi (right): http://codereview.chromium.org/9415001/diff/1/chrome/chrome_tests.gypi#newcode2109 chrome/chrome_tests.gypi:2109: '../tools/json_schema_compiler/test/simple_api_test.cc', On 2012/02/20 05:03:37, calamity wrote: > On ...
8 years, 10 months ago (2012-02-20 11:59:25 UTC) #6
calamity
Removed generated files. http://codereview.chromium.org/9415001/diff/7002/tools/json_schema_compiler/cpp_util.py File tools/json_schema_compiler/cpp_util.py (right): http://codereview.chromium.org/9415001/diff/7002/tools/json_schema_compiler/cpp_util.py#newcode89 tools/json_schema_compiler/cpp_util.py:89: arg = 'const %(type)s %(name)s' On ...
8 years, 10 months ago (2012-02-20 23:06:25 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/calamity@chromium.org/9415001/8004
8 years, 10 months ago (2012-02-20 23:06:50 UTC) #8
commit-bot: I haz the power
Presubmit check for 9415001-8004 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 10 months ago (2012-02-20 23:06:58 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/calamity@chromium.org/9415001/3007
8 years, 10 months ago (2012-02-20 23:08:45 UTC) #10
commit-bot: I haz the power
Presubmit check for 9415001-3007 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 10 months ago (2012-02-20 23:08:52 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/calamity@chromium.org/9415001/4022
8 years, 10 months ago (2012-02-20 23:55:49 UTC) #12
commit-bot: I haz the power
Presubmit check for 9415001-4022 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 10 months ago (2012-02-20 23:55:56 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/calamity@chromium.org/9415001/4023
8 years, 10 months ago (2012-02-20 23:59:24 UTC) #14
commit-bot: I haz the power
Presubmit check for 9415001-4023 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 10 months ago (2012-02-20 23:59:31 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/calamity@chromium.org/9415001/6011
8 years, 10 months ago (2012-02-21 00:03:15 UTC) #16
commit-bot: I haz the power
Change committed as 122781
8 years, 10 months ago (2012-02-21 01:13:08 UTC) #17
calamity
On 2012/02/21 01:13:08, I haz the power (commit-bot) wrote: > Change committed as 122781 @yoz: ...
8 years, 10 months ago (2012-02-21 04:09:16 UTC) #18
Yoyo Zhou
8 years, 10 months ago (2012-02-22 00:58:47 UTC) #19
I like these tests. The only thing that perhaps could use some coverage are
nested ref types (e.g. window, which contains tab).

I don't have any other comments of importance.

http://codereview.chromium.org/9415001/diff/1/tools/json_schema_compiler/cc_g...
File tools/json_schema_compiler/cc_generator.py (right):

http://codereview.chromium.org/9415001/diff/1/tools/json_schema_compiler/cc_g...
tools/json_schema_compiler/cc_generator.py:54: for type_ in
self._namespace.types.values():
This could be nested in the if.

http://codereview.chromium.org/9415001/diff/1/tools/json_schema_compiler/cc_g...
tools/json_schema_compiler/cc_generator.py:64: for function in
self._namespace.functions.values():
Same here.

http://codereview.chromium.org/9415001/diff/1/tools/json_schema_compiler/test...
File tools/json_schema_compiler/test/array.json (right):

http://codereview.chromium.org/9415001/diff/1/tools/json_schema_compiler/test...
tools/json_schema_compiler/test/array.json:51: "description": "Increments the
given integer.",
?

http://codereview.chromium.org/9415001/diff/6011/tools/json_schema_compiler/c...
File tools/json_schema_compiler/cpp_util.py (right):

http://codereview.chromium.org/9415001/diff/6011/tools/json_schema_compiler/c...
tools/json_schema_compiler/cpp_util.py:82: """Gets a const parameter declaration
of a given model.Property and its C++
Comment still says const.

http://codereview.chromium.org/9415001/diff/6011/tools/json_schema_compiler/t...
File tools/json_schema_compiler/test/simple_api_unittest.cc (right):

http://codereview.chromium.org/9415001/diff/6011/tools/json_schema_compiler/t...
tools/json_schema_compiler/test/simple_api_unittest.cc:99:
value->RemoveWithoutPathExpansion("number", NULL);
You could just use Remove here (you know the key).

Powered by Google App Engine
This is Rietveld 408576698