Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(142)

Issue 3773042: RFC: include value in XML output for value-parameterized tests

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years ago by joeyoravec
Modified:
11 years, 1 month ago
Reviewers:
wan, vladl
Base URL:
http://googletest.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Please consider this change which improves gtest's XML output to include the value for value-parameterized tests. Value-parameterized tests have somewhat opaque names like: InstantiationName/FooTest.DoesBlah/0 for "meeny" InstantiationName/FooTest.DoesBlah/1 for "miny" InstantiationName/FooTest.DoesBlah/2 for "moe" The existing pretty result printer prints the value, using operator<<, for any failed test like: [ FAILED ] InstantiationName/FooTest.DoesBlah/0, where GetParam() = meeny This proposal prints the same information in the XML output. The value is printed as an attribute "param" of the testcase like: <testcase name="DoesBlah/0" status="run" time="x.xxx" classname="InstantiationName/FooTest" param="GetParam() = meeny" /> There's another TestInfo member test_case_comment(). It's unclear if that member ever contains useful information. It's also unclear if that would be associated with the <testsuite /> or something else.

Patch Set 1 : Modifies both XML output and pretty result printer #

Patch Set 2 : Deletes test_case_comment() and comment() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -56 lines) Patch
include/gtest/gtest.h View 1 7 chunks +21 lines, -14 lines 0 comments Download
include/gtest/internal/gtest-internal.h View 1 4 chunks +10 lines, -8 lines 0 comments Download
include/gtest/internal/gtest-param-util.h View 1 1 chunk +2 lines, -3 lines 0 comments Download
src/gtest.cc View 1 12 chunks +48 lines, -29 lines 0 comments Download
src/gtest-internal-inl.h View 1 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 20
joeyoravec
15 years ago (2010-12-27 20:49:28 UTC) #1
wan
Hi Joey, Thanks for contributing. Do you know if this works with popular continuous build ...
15 years ago (2010-12-28 19:13:22 UTC) #2
joeyoravec
No idea since I've never used Hudson. I wouldn't expect trouble since gtest already has ...
15 years ago (2010-12-28 20:47:25 UTC) #3
wan
2010/12/28 Joey Oravec <joeyoravec@gmail.com>: > No idea since I've never used Hudson. I wouldn't expect ...
15 years ago (2010-12-28 21:47:48 UTC) #4
wan
I would like to distinguish between value- and type- parameterized tests. For the former, I ...
15 years ago (2011-01-10 19:14:05 UTC) #5
wan
2011/1/10 Zhanyong Wan (λx.x x) <wan@google.com>: > I would like to distinguish between value- and ...
15 years ago (2011-01-10 19:16:22 UTC) #6
joeyoravec
Sure, I agree it would be way more useful to print that way. I can ...
15 years ago (2011-01-11 16:02:22 UTC) #7
wan
2011/1/11 Joey Oravec <joeyoravec@gmail.com>: > Sure, I agree it would be way more useful to ...
15 years ago (2011-01-13 08:39:50 UTC) #8
joeyoravec
Modifies XML output to print value_param="" or type_param=""
14 years, 12 months ago (2011-01-18 15:56:23 UTC) #9
wan
Nice! Thanks for working on this. I'm particularly busy this week, so it may be ...
14 years, 12 months ago (2011-01-19 01:16:42 UTC) #10
vladl_google.com
I have taken a look. Rietveld is for some reason unable to show side-by-side diffs, ...
14 years, 12 months ago (2011-01-19 16:36:08 UTC) #11
joeyoravec
2011/1/19 Vlad Losev <vladl@google.com> > I have taken a look. Rietveld is for some reason ...
14 years, 12 months ago (2011-01-19 19:29:15 UTC) #12
vladl_google.com
2011/1/19 Joey Oravec <joeyoravec@gmail.com> > 2011/1/19 Vlad Losev <vladl@google.com> > > I have taken a ...
14 years, 12 months ago (2011-01-20 03:19:25 UTC) #13
wan
2011/1/19 Vlad Losev <vladl@google.com>: > > > 2011/1/19 Joey Oravec <joeyoravec@gmail.com> >> >> 2011/1/19 Vlad ...
14 years, 12 months ago (2011-01-20 05:59:12 UTC) #14
wan
2011/1/19 Vlad Losev <vladl@google.com>: > Also, a note not related to the patch itself. Currently, ...
14 years, 12 months ago (2011-01-20 06:07:02 UTC) #15
vladl_google.com
2011/1/20 Zhanyong Wan (λx.x x) <wan@google.com> > 2011/1/19 Vlad Losev <vladl@google.com>: > > > > ...
14 years, 12 months ago (2011-01-20 19:43:42 UTC) #16
wan
2011/1/20 Vlad Losev <vladl@google.com>: > > > 2011/1/20 Zhanyong Wan (λx.x x) <wan@google.com> >> >> ...
14 years, 12 months ago (2011-01-20 22:18:36 UTC) #17
joeyoravec
2011/1/20 Zhanyong Wan (λx.x x) <wan@google.com> > >> >>> I have taken a look. Rietveld ...
14 years, 11 months ago (2011-01-27 21:21:30 UTC) #18
wan
Thanks, Joey. The patch looks good overall. It has to be updated to meet our ...
14 years, 11 months ago (2011-01-29 08:33:46 UTC) #19
vladl_google.com
14 years, 11 months ago (2011-02-02 03:29:24 UTC) #20
Joey,

This has been added in SVN revision 537. Enjoy!

2011/1/29 Zhanyong Wan (λx.x x) <wan@google.com>

> Thanks, Joey.
>
> The patch looks good overall.  It has to be updated to meet our coding
> style requirements though.  Also, I prefer to remove the *comment()
> fields in the same patch.  While it's cleaner to do it in a separate
> step, we don't want to leave gtest in a (even though temporary) state
> whether a TestInfo gains more fields than necessary -- internally we
> use gtest at head so any change in the memory footprint has the risk
> of breaking some existing tests.
>
> Since I'm short in time, I'll just clean up your patch myself and
> commit it sometime next week, instead of pointing out all the places
> it needs to be tweaked.  (The former is easier for me.)  Thanks,
>
> 2011/1/27 Joey Oravec <joeyoravec@gmail.com>:
> > 2011/1/20 Zhanyong Wan (λx.x x) <wan@google.com>
> >>
> >> >> >>> I have taken a look. Rietveld is for some reason unable to show
> >> >> >>> side-by-side diffs, so I will comment here.
> >
> >
> > Fixed. I'm only able to use the rietveld web upload form, and I think I
> had
> > set the base URL incorrectly.
> >
> >
> >>
> >> Joey, I'm not concerned with the memory overhead of an additional
> >> bool.  It's the case where the bool is false (no param) but the param
> >> field is not empty that bothers me.  Ideally, we should eliminate such
> >> invalid construct by design.  Are you OK with const std::string*?
> >
> >
> > Sure. This revision eliminates the "bool has_value_param" parameter in
> favor
> > of a single parameter which either points to a C-string if the test is
> > value-parameterized, or is equal to NULL if the test is not
> > value-parameterized. The object still uses a private bool member
> internally;
> > you wanted a simpler interface, but I didn't see any reason to change
> that
> > member variable from a simple value-type to dynamic allocation.
> >
> >
> >>
> >> >> Your plan sounds good!  I'll review it when you are ready.
> >
> >
> >
> > Ok, I've gotten the hang of Rietveld so please review the two new patches
> at
> > http://codereview.appspot.com/3773042/
> >
> > Patch1:
> >  - Tracks the value-parameter or type-parameter as a string
> >  - Adds value_param="xx" and type_param="yy" to the XML output
> >  - Modifies pretty result printer to print in the same way (note,
> function
> > renamed)
> >
> > Patch2 (check delta from patch 1):
> >  - Deletes test_case_comment() and comment() which are now unused
> >
> > Same as before: use sample1 (normal), sample6 (type-parameterized), and
> > sample7 (value-parameterized) to verify this works. You'll need to add a
> > FAIL() to exercise pretty result printer, because it prints nothing for
> > successful tests.
> >
> > -joey
>
>
>
> --
> Zhanyong
>

Regards,
Vlad
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b