This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 00/16] Unit tests framework (v3)



For some of the simpler infrastructure tests such as the ones in this
patch kit (bitmap, vec or wide-int functionality testing and such), we
had the idea of putting these into every ENABLE_CHECKING compiler, and
run them after building stage1, controlled by a -fself-test flag. It's
better to detect such basic failures early rather than complete a full
bootstrap and test cycle. It also keeps the tests alongside the rest of
the implementation, which I consider desirable for such relatively
simple data structures.

Would it be reasonable to run them at each stage?  My hope is that they
will be fast.

Depends on how fast, I guess. I don't think testing them more than once gains very much; if there's a suspicion that stage3 was miscompiled one could still run -fself-test manually.

If we're building the tests into the compiler itself, guarded by
   #if ENABLE_CHECKING
then presumably it makes sense to put the tests directly into the
pertinent source files? (rather than in a "foo-tests.c" file).  Possibly
even to interleave them, to be next to the code in question.

Yes, I was thinking same source file for the most part. I don't think there has to be any kind of rule, we just do whatever makes sense.

Given that this patch kit has seen a fair amount of discussion, and
parts of it are already approved, and that it's designed to improve our
test coverage, is it reasonable to continue pursuing this within stage
3?  (I hope so)  Should I attempt a patch for the above? (once I've
fixed the AIX bootstrap issue, of course)

As far as I'm concerned this can still proceed given that it was submitted well in advance of stage 3 (unless someone objects).

Any thoughts on embedded gtest vs external gtest vs building our own?

I think for -fself-test we can mostly operate with gcc_assert, IMO there's no need to use an elaborate framework. We can revisit this issue when we get to more extensive tests that require multiple compiler invocations.


Bernd


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]