[PATCH 00/15] Unittests framework v4: -fself-test

David Malcolm dmalcolm@redhat.com
Thu Nov 19 16:46:00 GMT 2015


On Mon, 2015-11-16 at 19:17 +0100, Bernd Schmidt wrote:
> So Jeff and I just had a chat, and we came up with some thoughts about 
> how to proceed. I think we both agree that it would be good to have a 
> special testing backend, along with frontends designed to be able to 
> read in gimple or rtl that can be operated on. That's more of a 
> long-term thing.
> 
> 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.
> 
> Thoughts?

I like the idea.

Here's another iteration of the patch kit, which implements it (mostly).

David Malcolm (15):
  Selftest framework (unittests v4)
  Add selftests to bitmap.c
  Add selftests to tree-cfg.c
  Add selftests to et-forest.c
  Add selftests to fold-const.c
  Add function-tests.c
  Fix warning in function-tests.c
  Add selftests to gimple.c
  Add hash-map-tests.c
  Add hash-set-tests.c
  Add selftests to input.c
  Add rtl-tests.c
  Add selftests to tree.c
  Add selftests to vec.c
  RFC: Add ggc-tests.c

 gcc/Makefile.in      |   9 +-
 gcc/bitmap.c         |  92 ++++++++
 gcc/common.opt       |   4 +
 gcc/et-forest.c      |  99 ++++++++
 gcc/fold-const.c     |  66 ++++++
 gcc/function-tests.c | 632 +++++++++++++++++++++++++++++++++++++++++++++++++++
 gcc/ggc-tests.c      | 302 ++++++++++++++++++++++++
 gcc/gimple.c         | 103 +++++++++
 gcc/hash-map-tests.c |  81 +++++++
 gcc/hash-set-tests.c |  57 +++++
 gcc/input.c          | 107 +++++++++
 gcc/rtl-tests.c      |  98 ++++++++
 gcc/selftest.c       | 152 +++++++++++++
 gcc/selftest.h       | 270 ++++++++++++++++++++++
 gcc/toplev.c         |  51 +++++
 gcc/toplev.h         |   2 +
 gcc/tree-cfg.c       | 264 +++++++++++++++++++++
 gcc/tree.c           |  47 ++++
 gcc/vec.c            | 142 ++++++++++++
 19 files changed, 2575 insertions(+), 3 deletions(-)
 create mode 100644 gcc/function-tests.c
 create mode 100644 gcc/ggc-tests.c
 create mode 100644 gcc/hash-map-tests.c
 create mode 100644 gcc/hash-set-tests.c
 create mode 100644 gcc/rtl-tests.c
 create mode 100644 gcc/selftest.c
 create mode 100644 gcc/selftest.h

-- 
1.8.5.3



More information about the Gcc-patches mailing list