[PATCH] D151156: [WIP][libc++] Support on-the-fly generated tests

Louis Dionne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 22 14:34:20 PDT 2023


ldionne created this revision.
Herald added subscribers: delcypher, arichardson.
Herald added a project: All.
ldionne requested review of this revision.
Herald added projects: libc++, LLVM.
Herald added subscribers: llvm-commits, libcxx-commits.
Herald added a reviewer: libc++.

A recurring problem recently has been that libc++ has several generated
tests which all need to be re-generated before committing a change. This
creates noise during code reviews and friction for contributors.

Furthermore, the way we generated most of these tests resulted in
extremely bad compilation times when using modules, because we defined
a macro before compiling each file.

This commit introduces a new kind of test called a '.gen' test. These
tests are normal shell tests, however the Lit test format will run the
test to discover the actual Lit tests it should run. This basically
allows generating a Lit test suite on the fly using arbitrary code.
We use this new capability to generate one test for each header that
ensures that headers define __verbose_abort. Other generated tests can
be moved to this new approach in the future.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151156

Files:
  libcxx/test/libcxx/assertions/headers_declare_verbose_abort.gen.py
  libcxx/test/libcxx/assertions/headers_declare_verbose_abort.sh.cpp
  libcxx/test/libcxx/lit.local.cfg
  libcxx/utils/generate_header_tests.py
  libcxx/utils/libcxx/test/dsl.py
  libcxx/utils/libcxx/test/format.py
  llvm/utils/lit/lit/Test.py
  llvm/utils/lit/lit/TestRunner.py
  llvm/utils/lit/lit/formats/base.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151156.524493.patch
Type: text/x-patch
Size: 41011 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230522/ca9efe53/attachment-0001.bin>


More information about the llvm-commits mailing list