Sorry I missed this before I checked in the changes I had. That might make
sense if files consistently used _ in their names, but unfortunately they
don't. I also think it's a little cleaner to have a separate namespace
entirely for things rather than avoiding conflicts by being careful,
although practically sometimes that's easier said than done or makes things
overly cumbersome.

Gabe

On Thu, Nov 29, 2018 at 3:40 AM Ciro Santilli <ciro.santi...@arm.com> wrote:

> I would recommend using _test.cc, and then just prevent any other class
> from being named as _test.cc.
>
> This is also the recommendation of the Google C++ style guide:
> https://google.github.io/styleguide/cppguide.html#File_Names
>
> Conceptually, it feels nice as we don't change the simple .cc style we
> have right now of [a-z_]*.cc for all files, although I can't see any major
> breakages besides linters complaining.
>
> ________________________________
> From: gem5-dev <gem5-dev-boun...@gem5.org> on behalf of Gabe Black <
> gabebl...@google.com>
> Sent: Thursday, November 29, 2018 12:54:21 AM
> To: gem5 Developer List
> Subject: [gem5-dev] Unit test naming convention
>
> Hi folks. We have a few unit tests now, and they are mostly consistently
> named by adding test to the file name. For instance the tests for foo.cc
> would be in footest.cc.
>
> There are two minor downsides to that. First, that's a bit ugly to read,
> and it may look weird if files, for instance, use _ to separate words
> instead of squishing everything together, ie foo_bar.cc -> foo_bartest.cc.
> Second, if there already is a footest.cc which is not for unit tests (not
> super likely, but definitely possible), then the naming gets a little
> ambiguous.
>
> Would it make sense to mark tests with .test, so foo.cc -> foo.test.cc?
> That's clear to read, more universally consistent, easily grepped for, and
> will probably not be ambiguous.
>
> Gabe
> _______________________________________________
> gem5-dev mailing list
> gem5-dev@gem5.org
> http://m5sim.org/mailman/listinfo/gem5-dev
> _______________________________________________
> gem5-dev mailing list
> gem5-dev@gem5.org
> http://m5sim.org/mailman/listinfo/gem5-dev
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to