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

Issue 2123013: Split tests into individual files. Got rid of globals by converting them to classes. (Closed)

Created:
10 years, 7 months ago by Alexey Marinichev
Modified:
9 years, 7 months ago
Reviewers:
piman
CC:
chromium-os-reviews_chromium.org, sosa+cc_chromium.org, seano, ericli, petkov+cc_chromium.org
Base URL:
ssh://git@chromiumos-git//autotest.git
Visibility:
Public.

Description

Split tests into individual files. Got rid of globals by converting them to classes.

Patch Set 1 #

Patch Set 2 : Added standard includes to fix autotest build. #

Total comments: 30

Patch Set 3 : addressed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1706 lines, -1363 lines) Patch
M client/deps/glbench/src/Makefile View 1 2 1 chunk +4 lines, -1 line 0 comments Download
A client/deps/glbench/src/all_tests.h View 1 chunk +20 lines, -0 lines 0 comments Download
A client/deps/glbench/src/attributefetchtest.cc View 1 2 1 chunk +148 lines, -0 lines 0 comments Download
M client/deps/glbench/src/bench.cc View 3 chunks +6 lines, -5 lines 0 comments Download
A client/deps/glbench/src/cleartest.cc View 1 2 1 chunk +62 lines, -0 lines 0 comments Download
A client/deps/glbench/src/fillratetest.cc View 1 2 1 chunk +105 lines, -0 lines 0 comments Download
M client/deps/glbench/src/main.h View 1 2 1 chunk +0 lines, -18 lines 0 comments Download
M client/deps/glbench/src/main.cc View 1 2 2 chunks +23 lines, -839 lines 0 comments Download
A client/deps/glbench/src/readpixeltest.cc View 1 2 1 chunk +64 lines, -0 lines 0 comments Download
D client/deps/glbench/src/shaders.h View 1 chunk +0 lines, -29 lines 0 comments Download
D client/deps/glbench/src/shaders.cc View 1 chunk +0 lines, -468 lines 0 comments Download
A client/deps/glbench/src/swaptest.cc View 1 2 1 chunk +42 lines, -0 lines 0 comments Download
M client/deps/glbench/src/teartest.cc View 1 chunk +1 line, -1 line 0 comments Download
A client/deps/glbench/src/testbase.h View 1 2 1 chunk +83 lines, -0 lines 0 comments Download
A client/deps/glbench/src/testbase.cc View 1 chunk +141 lines, -0 lines 0 comments Download
A client/deps/glbench/src/trianglesetuptest.cc View 1 2 1 chunk +85 lines, -0 lines 0 comments Download
M client/deps/glbench/src/utils.h View 1 2 1 chunk +13 lines, -0 lines 0 comments Download
M client/deps/glbench/src/utils.cc View 1 2 3 chunks +99 lines, -1 line 0 comments Download
A client/deps/glbench/src/varyingsandddxytest.cc View 1 2 1 chunk +249 lines, -0 lines 0 comments Download
A client/deps/glbench/src/windowmanagercompositingtest.cc View 1 2 1 chunk +420 lines, -0 lines 0 comments Download
M client/deps/glbench/src/windowmanagertest.cc View 1 chunk +1 line, -1 line 0 comments Download
A client/deps/glbench/src/yuvtest.cc View 1 2 1 chunk +140 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Alexey Marinichev
10 years, 7 months ago (2010-05-20 21:58:30 UTC) #1
Alexey Marinichev
10 years, 7 months ago (2010-05-20 22:14:00 UTC) #2
piman
OO-design wise, I think it works. I could see separating TestFunc into a separate class ...
10 years, 7 months ago (2010-05-20 23:00:39 UTC) #3
Alexey Marinichev
http://codereview.chromium.org/2123013/diff/3001/4002 File client/deps/glbench/src/attributefetchtest.cc (right): http://codereview.chromium.org/2123013/diff/3001/4002#newcode148 client/deps/glbench/src/attributefetchtest.cc:148: } On 2010/05/20 23:00:39, piman wrote: > add a ...
10 years, 7 months ago (2010-05-21 02:17:34 UTC) #4
piman
LGTM
10 years, 7 months ago (2010-05-21 02:29:03 UTC) #5
piman
10 years, 7 months ago (2010-05-21 02:34:29 UTC) #6
On Thu, May 20, 2010 at 7:17 PM, <amarinichev@chromium.org> wrote:

>
> http://codereview.chromium.org/2123013/diff/3001/4002
> File client/deps/glbench/src/attributefetchtest.cc (right):
>
> http://codereview.chromium.org/2123013/diff/3001/4002#newcode148
> client/deps/glbench/src/attributefetchtest.cc:148: }
> On 2010/05/20 23:00:39, piman wrote:
>
>> add a // namespace glbench after closing } (here and all the other
>>
> files)
>
> Done.
>
>
> http://codereview.chromium.org/2123013/diff/3001/4003
> File client/deps/glbench/src/bench.cc (right):
>
> http://codereview.chromium.org/2123013/diff/3001/4003#newcode7
> client/deps/glbench/src/bench.cc:7:
> On 2010/05/20 23:00:39, piman wrote:
>
>> I would consider moving these 2 functions, as well as RunTest into
>>
> testbase.cc
>
>> (and their prototypes into testbase.h)
>> It helps having all the test infrastructure at the same place to
>>
> understand the
>
>> relationship between TestBase::TestFunc, TestBase::Run, RunTest and
>>
> Bench
>
> I was thinking I'd separate data processing from the actual tests -- in
> theory we might different kinds of regressions for different tests.  But
> that doesn't buy us much at the moment and we can always split them
> again later.



I think that'd make more sense with a separate interface that has TestFunc.
Base interface: run a test. More refined interface: the test has a notion of
iteration and we want to find the linear response part.


>
>
> http://codereview.chromium.org/2123013/diff/3001/4005
> File client/deps/glbench/src/drawfunc.cc (right):
>
> http://codereview.chromium.org/2123013/diff/3001/4005#newcode1
> client/deps/glbench/src/drawfunc.cc:1: // Copyright (c) 2010 The
> Chromium OS Authors. All rights reserved.
> On 2010/05/20 23:00:39, piman wrote:
>
>> This file should be testbase.cc, or alternatively the class definition
>>
> should be
>
>> in drawfunc.h
>>
> I was thinking there could be more of these mixin-like functions in the
> future, they might not necessarily belong to testbase.


I don't mind either way, but the idea is to match the .h with the .cc for
easier navigation.


>
>
> http://codereview.chromium.org/2123013/diff/3001/4007
> File client/deps/glbench/src/main.cc (right):
>
> http://codereview.chromium.org/2123013/diff/3001/4007#newcode123
> client/deps/glbench/src/main.cc:123: }
> On 2010/05/20 23:00:39, piman wrote:
>
>> delete all tests ?
>>
> It felt strange -- I don't call new, but I call delete. Maybe that's OK
> though, all those Get* functions are effectively virtual constructors.


They're essentially factories. The other possibility is to use scoped_ptr.


>
> http://codereview.chromium.org/2123013/diff/3001/4008
> File client/deps/glbench/src/main.h (right):
>
> http://codereview.chromium.org/2123013/diff/3001/4008#newcode90
> client/deps/glbench/src/main.h:90: const char *name, float coefficient,
> bool inverse);
> On 2010/05/20 23:00:39, piman wrote:
>
>> shouldn't these 2 go into the glbench namespace as well ?
>>
>
> This was an unfinished thought about separating tests and collecting
> their results.  Will move everything to testbase.h.
>
>
> http://codereview.chromium.org/2123013/diff/3001/4014
> File client/deps/glbench/src/testbase.h (right):
>
> http://codereview.chromium.org/2123013/diff/3001/4014#newcode18
> client/deps/glbench/src/testbase.h:18: virtual bool TestFunc(int) = 0;
> On 2010/05/20 23:00:39, piman wrote:
>
>> you should name the parameter, and it would be good to add some
>>
> documentation
>
>> here. Why 2 functions TestFunc and Run ? Which one calls the other one
>>
> ?
>
> Done.
>
>
> http://codereview.chromium.org/2123013/diff/3001/4014#newcode27
> client/deps/glbench/src/testbase.h:27: void FillRateTestNormal(const
> char* name, float coeff=1.f);
> On 2010/05/20 23:00:39, piman wrote:
>
>> default values for arguments are disallowed by the style guide.
>>
>
> Done.
>
>
> http://codereview.chromium.org/2123013/diff/3001/4014#newcode40
> client/deps/glbench/src/testbase.h:40: GLsizei count_;
> On 2010/05/20 23:00:39, piman wrote:
>
>> What is count ? (add doc)
>>
>
> Done.
>
>
> http://codereview.chromium.org/2123013/diff/3001/4014#newcode51
> client/deps/glbench/src/testbase.h:51: TestBase*
> GetWindowManagerCompositingTest(bool scissor);
> On 2010/05/20 23:00:39, piman wrote:
>
>> I think it would be cleaner to move these to a separate "all_tests.h"
>>
> or
>
>> something.
>>
>
> Done.
>
>
> http://codereview.chromium.org/2123013/diff/3001/4016
> File client/deps/glbench/src/utils.cc (right):
>
> http://codereview.chromium.org/2123013/diff/3001/4016#newcode192
> client/deps/glbench/src/utils.cc:192: }
> On 2010/05/20 23:00:39, piman wrote:
>
>> add a  // namespace glbench
>>
>
> Done.
>
>
> http://codereview.chromium.org/2123013/diff/3001/4019
> File client/deps/glbench/src/windowmanagercompositingtest.cc (right):
>
> http://codereview.chromium.org/2123013/diff/3001/4019#newcode14
> client/deps/glbench/src/windowmanagercompositingtest.cc:14: const float
> screen_scale_factor = 1e6f * (WINDOW_WIDTH * WINDOW_HEIGHT) /
> On 2010/05/20 23:00:39, piman wrote:
>
>> screen_scale_factor -> kScreenScaleFactor
>>
>
> Done.
>
>
> http://codereview.chromium.org/2123013/diff/3001/4019#newcode34
> client/deps/glbench/src/windowmanagercompositingtest.cc:34:
> DISALLOW_COPY_AND_ASSIGN(WindowManagerCompositingTest);
> On 2010/05/20 23:00:39, piman wrote:
>
>> should be last in the class
>>
>
> Done.
>
>
> http://codereview.chromium.org/2123013/diff/3001/4019#newcode137
> client/deps/glbench/src/windowmanagercompositingtest.cc:137: const char
> *basic_texture_vertex_shader =
> On 2010/05/20 23:00:39, piman wrote:
>
>> All these strings should be kBasicTextureVertexShader etc.
>> Also, start-on-the-left
>>
>
> Done.
>
>
> http://codereview.chromium.org/2123013/diff/3001/4019#newcode154
> client/deps/glbench/src/windowmanagercompositingtest.cc:154: GLuint
> texture_buffer) {
> On 2010/05/20 23:00:39, piman wrote:
>
>> indentation (could collapse on 1 line)
>>
>
> Done.
>
>
> http://codereview.chromium.org/2123013/diff/3001/4019#newcode156
> client/deps/glbench/src/windowmanagercompositingtest.cc:156:
> InitShaderProgram(basic_texture_vertex_shader,
> On 2010/05/20 23:00:39, piman wrote:
>
>> indentation (should be +4 spaces), or collapse on 1 line
>>
>
> Done.
>
>
> http://codereview.chromium.org/2123013/show
>

Powered by Google App Engine
This is Rietveld 408576698