[libcxx-commits] [PATCH] D140115: [libc++][format] Removes test redundancy.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Dec 15 09:38:04 PST 2022


Mordante created this revision.
Herald added a project: All.
Mordante requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

The format function test serve two purposes:

- Test whether all format functions work in general.
- Test whether all formatting rules are implemented correctly.

At the moment the *pass.cpp tests do both. These tests are quite slow,
while testing all rules for all functions doesn't add much coverage.

There are two execution modi of the format functions:

- run-time validation in the vformat functions.
- compile-time validation in the other function.

So instead of running all tests for all functions, they are only used for
format.pass.cpp and vformat.pass.cpp still do all tests.

The other tests do a smaller set of test, just to make sure they work in the
basics.

Running the format tests using one thread:

- before 00:04:16
- after  00:02:14

The slow tests were also reported in
https::llvm.org/PR58141

Also split a generic part of the test to a generic support header. This
allows these parts to be reused in the range-based formatter tests.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140115

Files:
  libcxx/test/std/utilities/format/format.functions/format.locale.pass.cpp
  libcxx/test/std/utilities/format/format.functions/format.pass.cpp
  libcxx/test/std/utilities/format/format.functions/format_tests.h
  libcxx/test/std/utilities/format/format.functions/format_to.locale.pass.cpp
  libcxx/test/std/utilities/format/format.functions/format_to.pass.cpp
  libcxx/test/std/utilities/format/format.functions/format_to_n.locale.pass.cpp
  libcxx/test/std/utilities/format/format.functions/format_to_n.pass.cpp
  libcxx/test/std/utilities/format/format.functions/formatted_size.locale.pass.cpp
  libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp
  libcxx/test/std/utilities/format/format.functions/vformat.locale.pass.cpp
  libcxx/test/std/utilities/format/format.functions/vformat.pass.cpp
  libcxx/test/std/utilities/format/format.functions/vformat_to.locale.pass.cpp
  libcxx/test/std/utilities/format/format.functions/vformat_to.pass.cpp
  libcxx/test/support/format.functions.common.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140115.483217.patch
Type: text/x-patch
Size: 19818 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20221215/3df1e7d7/attachment-0001.bin>


More information about the libcxx-commits mailing list