This is an archive of the discontinued LLVM Phabricator instance.

[libc++][format] Removes test redundancy.
ClosedPublic

Authored by Mordante on Dec 15 2022, 9:38 AM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Commits
rG49d4fee9940f: [libc++][format] Removes test redundancy.
Summary

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.

Diff Detail

Event Timeline

Mordante created this revision.Dec 15 2022, 9:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 15 2022, 9:38 AM
Mordante requested review of this revision.Dec 15 2022, 9:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 15 2022, 9:38 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne accepted this revision.Dec 21 2022, 12:08 PM
This revision is now accepted and ready to land.Dec 21 2022, 12:08 PM
This revision was landed with ongoing or failed builds.Dec 22 2022, 10:39 AM
This revision was automatically updated to reflect the committed changes.