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

Issue 687813003: CodeGen: refactor unit tests using parameterized tests (Closed)

Created:
6 years, 1 month ago by mdempsky
Modified:
6 years, 1 month ago
CC:
chromium-reviews, jln+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

CodeGen: refactor unit tests using parameterized tests CodeGen doesn't do anything fancy like fork() or ptrace(), so it's safe to test using just plain gtest. That also allows us to convert the tests to use parameterized tests, so we can easily run each test independently. While here, also invert the structure a bit because I expect once I rewrite and simplify CodeGen, a lot of the ProgramTestFuncs to go away. Lastly, for simplicity I'm leaving a lot of statements as ASSERT_TRUE even if they could use ASSERT_EQ, etc. Again, I'm expecting some of those to go away, so I'll worry about cleaning them up once the unneeded asserts are gone. BUG=414363 Committed: https://crrev.com/531a117bc26a709a89dd1316ebacaf8bb5467e07 Cr-Commit-Position: refs/heads/master@{#302482}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Respond to rickyz@ feedback #

Patch Set 3 : Mark gen_ as private #

Total comments: 4

Patch Set 4 : Respond to jln@ feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+152 lines, -173 lines) Patch
M sandbox/linux/seccomp-bpf/codegen_unittest.cc View 1 2 3 16 chunks +152 lines, -173 lines 0 comments Download

Messages

Total messages: 11 (2 generated)
mdempsky
rickyz: PTAL
6 years, 1 month ago (2014-10-31 22:58:04 UTC) #2
rickyz (no longer on Chrome)
Two small comments, but lgtm, nice catch on the ability to just use gtest here ...
6 years, 1 month ago (2014-11-01 00:22:05 UTC) #3
mdempsky
rickyz: Thanks, updated. PTAL! https://codereview.chromium.org/687813003/diff/1/sandbox/linux/seccomp-bpf/codegen_unittest.cc File sandbox/linux/seccomp-bpf/codegen_unittest.cc (right): https://codereview.chromium.org/687813003/diff/1/sandbox/linux/seccomp-bpf/codegen_unittest.cc#newcode24 sandbox/linux/seccomp-bpf/codegen_unittest.cc:24: using CodeGen::CutGraphIntoBasicBlocks; On 2014/11/01 00:22:05, ...
6 years, 1 month ago (2014-11-01 00:59:54 UTC) #4
mdempsky
jln: Should be ready for you to review too.
6 years, 1 month ago (2014-11-03 18:03:55 UTC) #5
jln (very slow on Chromium)
This lgtm if you prefer to go this route (which seems reasonable), but we wary ...
6 years, 1 month ago (2014-11-03 20:19:56 UTC) #6
mdempsky
> but we wary of GTest. Acknowledged. https://codereview.chromium.org/687813003/diff/40001/sandbox/linux/seccomp-bpf/codegen_unittest.cc File sandbox/linux/seccomp-bpf/codegen_unittest.cc (right): https://codereview.chromium.org/687813003/diff/40001/sandbox/linux/seccomp-bpf/codegen_unittest.cc#newcode52 sandbox/linux/seccomp-bpf/codegen_unittest.cc:52: EXPECT_TRUE(ret); On ...
6 years, 1 month ago (2014-11-03 20:43:00 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/687813003/60001
6 years, 1 month ago (2014-11-03 20:44:14 UTC) #9
commit-bot: I haz the power
Committed patchset #4 (id:60001)
6 years, 1 month ago (2014-11-03 21:26:55 UTC) #10
commit-bot: I haz the power
6 years, 1 month ago (2014-11-03 21:27:34 UTC) #11
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/531a117bc26a709a89dd1316ebacaf8bb5467e07
Cr-Commit-Position: refs/heads/master@{#302482}

Powered by Google App Engine
This is Rietveld 408576698