[libcxx-commits] [libcxx] [libc++] Make libcxx/selftest a top-level test directory (PR #144852)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Jun 20 23:51:56 PDT 2025
philnik777 wrote:
> > `test/libcxx/selftest/modules` moved to `test/libcxx/modules`, since the assumptions these tests check are libc++-specific
>
> This is tricky -- these tests are really testing the Lit testing format in itself. They are testing the `MODULE_DEPENDENCIES:` directive.
>
> I believe it makes more sense to keep them under `libcxx/test/selftest/` even though they don't currently work with other implementations. In theory, these tests could also be used to test other implementations since we're all supposed to be providing a similar mechanism for using C++20 modules (which is what the build systems will rely on).
>
> WDYT?
I have a few problems with this:
(1) Every other test _does_ actually work with other implementations AFAICT, so we'd be breaking "this directory can be portably tested" for a theoretical "should be possible to do portable" that we haven't achieved.
(2) At least some of them definitely test libc++-specific things. E.g `no-modules.sh.cpp` tests that the normal build doesn't use modules. I don't see how this could ever be non-libc++-specific. Implementations are absolutely allowed to use modules as an implementation detail.
(3) IMO these tests are inherently implementation-specific, since they test for compiler flags. We can move them to something like "GCC/Clang-style implementation", but I don't think we can generalize further.
https://github.com/llvm/llvm-project/pull/144852
More information about the libcxx-commits
mailing list