[all-commits] [llvm/llvm-project] 49d4fe: [libc++][format] Removes test redundancy.

Mark de Wever via All-commits all-commits at lists.llvm.org
Thu Dec 22 10:39:41 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 49d4fee9940f5e1273cc0ae30da82df9c1437706
      https://github.com/llvm/llvm-project/commit/49d4fee9940f5e1273cc0ae30da82df9c1437706
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2022-12-22 (Thu, 22 Dec 2022)

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

  Log Message:
  -----------
  [libc++][format] Removes test redundancy.

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.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D140115




More information about the All-commits mailing list