[libcxx-commits] [PATCH] D116198: [libc++] [test] [NFC] Flatten the directory structure a bit

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Dec 29 06:47:17 PST 2021


Quuxplusone added a comment.

In D116198#3212553 <https://reviews.llvm.org/D116198#3212553>, @ldionne wrote:

> Can someone summarize the discussion? Previously the test paths were mirroring section names in the standard. I'd like to understand what the proposed naming scheme is.

The new test paths mirror the section names in the standard: everything that is specified under http://eel.is/c++draft/range.access is now located under `libcxx/test/*/ranges/range.access/`.

  $ ls ../libcxx/test/*/ranges/range.access/
  ../libcxx/test/libcxx/ranges/range.access/:
  begin.incomplete_type.sh.cpp	end.incomplete_type.pass.cpp
  
  ../libcxx/test/std/ranges/range.access/:
  begin.pass.cpp	data.pass.cpp	empty.pass.cpp	end.pass.cpp	size.pass.cpp	ssize.pass.cpp

The old test paths were kind of wonky, because they included subdirectory components that didn't mirror the standard's stablenames. E.g. `data`, `size`, and `ssize` were previously tested under the subdirectory `libcxx/test/std/ranges/range.access/range.prim/`, but there is no https://eel.is/c++draft/range.prim in the standard.

@Mordante suggested that it might be better to name the test files after the corresponding stablenames, instead of the corresponding library identifiers:

  begin.pass.cpp => range.access.begin.pass.cpp
  end.pass.cpp => range.access.end.pass.cpp
  data.pass.cpp => range.prim.data.pass.cpp
  empty.pass.cpp => range.prim.empty.pass.cpp
  size.pass.cpp => range.prim.size.pass.cpp
  ssize.pass.cpp => range.prim.ssize.pass.cpp

I'm only like 80% opposed to that idea. :) The current names are shorter/easier to decode (e.g. `empty` is tested in `empty.pass.cpp`, not something with the word `empty` buried in the middle of the name). The short names are also slightly better at hiding the contradiction that `cbegin` is tested in the same file as `begin`: it seems pretty defensible that `begin.pass.cpp` tests `cbegin` too, whereas if we call it `range.access.begin.pass.cpp` then we have to explain the absence of `range.access.cbegin.pass.cpp`. (This applies to end/cend, rbegin/crbegin, rend/crend, and data/cdata. It should probably also apply to size/ssize, but we haven't gotten around to rewriting that pair of test files into a single file yet. I suspect a lot of test coverage is missing for `ssize`.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116198/new/

https://reviews.llvm.org/D116198



More information about the libcxx-commits mailing list