|
|
Created:
6 years, 4 months ago by Rodolph Perfetta (ARM) Modified:
6 years, 4 months ago CC:
v8-dev Project:
v8 Visibility:
Public. |
DescriptionARM64: Refactor instruction selection unit tests.
BUG=
R=bmeurer@chromium.org
Committed: https://code.google.com/p/v8/source/detail?r=23188
Patch Set 1 #
Total comments: 5
Patch Set 2 : Renamed tests #Patch Set 3 : Shorter tests name #Patch Set 4 : reverting back to long names #Messages
Total messages: 12 (0 generated)
https://codereview.chromium.org/475823002/diff/1/test/compiler-unittests/arm6... File test/compiler-unittests/arm64/instruction-selector-arm64-unittest.cc (right): https://codereview.chromium.org/475823002/diff/1/test/compiler-unittests/arm6... test/compiler-unittests/arm64/instruction-selector-arm64-unittest.cc:82: typedef InstructionSelectorTestWithParam<DPI> LogicalTest; s/LogicalTest/InstructionSelectorLogicalTest/ See below for an explanation. https://codereview.chromium.org/475823002/diff/1/test/compiler-unittests/arm6... test/compiler-unittests/arm64/instruction-selector-arm64-unittest.cc:85: TEST_P(LogicalTest, Parameter) { Test names must be globally unique, so please always add the InstructionSelector prefix to the test case name, i.e. InstructionSelectorLogicalTest. This has the additional advantage that one can run all InstructionSelector tests by using --gtest_filter=InstructionSelector* with the compiler-unittests binary.
https://codereview.chromium.org/475823002/diff/1/test/compiler-unittests/arm6... File test/compiler-unittests/arm64/instruction-selector-arm64-unittest.cc (right): https://codereview.chromium.org/475823002/diff/1/test/compiler-unittests/arm6... test/compiler-unittests/arm64/instruction-selector-arm64-unittest.cc:85: TEST_P(LogicalTest, Parameter) { My understanding was that the name will be concatenated with the first parameter of INSTANTIATE_TEST_CASE_P, so here InstructionSelectorTest. If I run compiler-unittest, those tests are currently listed as InstructionSelectorTest/LogicalTest.Parameter and using --gtest_filter='InstructionSelector*' will find them. Have I misunderstood?
> https://codereview.chromium.org/475823002/diff/1/test/compiler-unittests/arm6... > test/compiler-unittests/arm64/instruction-selector-arm64-unittest.cc:85: TEST_P(LogicalTest, Parameter) { > My understanding was that the name will be concatenated with the first parameter of INSTANTIATE_TEST_CASE_P, so here InstructionSelectorTest. If I run compiler-unittest, those tests are currently listed as InstructionSelectorTest/LogicalTest.Parameter and using --gtest_filter='InstructionSelector*' will find them. > > Have I misunderstood? Ah right, of course. Sorry, I confused myself :-) LGTM
On 2014/08/14 at 18:31:07, Benedikt Meurer wrote: > > https://codereview.chromium.org/475823002/diff/1/test/compiler-unittests/arm6... > > test/compiler-unittests/arm64/instruction-selector-arm64-unittest.cc:85: TEST_P(LogicalTest, Parameter) { > > My understanding was that the name will be concatenated with the first parameter of INSTANTIATE_TEST_CASE_P, so here InstructionSelectorTest. If I run compiler-unittest, those tests are currently listed as InstructionSelectorTest/LogicalTest.Parameter and using --gtest_filter='InstructionSelector*' will find them. > > > > Have I misunderstood? > > Ah right, of course. Sorry, I confused myself :-) Ahem, still my first statement was correct. The class name will be composed of LogicalTest and Parameter, which may not be unique among all tests in compiler-unittests. So better add the InstructionSelector prefix here as well.
https://codereview.chromium.org/475823002/diff/1/test/compiler-unittests/arm6... File test/compiler-unittests/arm64/instruction-selector-arm64-unittest.cc (right): https://codereview.chromium.org/475823002/diff/1/test/compiler-unittests/arm6... test/compiler-unittests/arm64/instruction-selector-arm64-unittest.cc:82: typedef InstructionSelectorTestWithParam<DPI> LogicalTest; On 2014/08/14 17:58:31, Benedikt Meurer wrote: > s/LogicalTest/InstructionSelectorLogicalTest/ > > See below for an explanation. Done. https://codereview.chromium.org/475823002/diff/1/test/compiler-unittests/arm6... test/compiler-unittests/arm64/instruction-selector-arm64-unittest.cc:85: TEST_P(LogicalTest, Parameter) { On 2014/08/14 17:58:31, Benedikt Meurer wrote: > Test names must be globally unique, so please always add the InstructionSelector > prefix to the test case name, i.e. InstructionSelectorLogicalTest. > > This has the additional advantage that one can run all InstructionSelector tests > by using --gtest_filter=InstructionSelector* with the compiler-unittests binary. Acknowledged.
LGTM You can land TF changes even while the tree is throttled.
Ok, I've looked into this again, and I think you are right. We can avoid the possible name collision using an anonymous namespace, i.e. namespace { class MyTest : public InstructionSelectorTestWithParam<ParamType> {}; TEST_P(MyTest, A) {...} TEST_P(MyTest, B) {...} } INSTANTIATE_TEST_CASE_P(InstructionSelectorTest, MyTest, ::testing::Values(...)); I really like this solution (shortens the test names), and I'll apply that to the ARM instruction selector unittest.
On 2014/08/18 06:38:20, Benedikt Meurer wrote: > Ok, I've looked into this again, and I think you are right. We can avoid the > possible name collision using an anonymous namespace, i.e. > > > namespace { > > class MyTest : public InstructionSelectorTestWithParam<ParamType> {}; > > TEST_P(MyTest, A) {...} > TEST_P(MyTest, B) {...} > > } > > INSTANTIATE_TEST_CASE_P(InstructionSelectorTest, MyTest, > ::testing::Values(...)); > > > I really like this solution (shortens the test names), and I'll apply that to > the ARM instruction selector unittest. Done for arm64.
re-refactored ;-)
lgtm
Message was sent while issue was closed.
Committed patchset #4 manually as 23188 (presubmit successful). |