This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Make the libc++ test-suite standalone
AbandonedPublic

Authored by Jake-Egan on Jan 9 2023, 10:50 AM.

Details

Reviewers
hubert.reinterpretcast
daltenty
francii
Group Reviewers
Restricted Project
Restricted Project
Restricted Project
Summary

This patch enables the use of the libc++ test-suite on its own (without needing to build the runtime). To do this, use the option LIBCXX_TEST_ONLY. The header and library location of an existing runtime needs to be specified with LIBCXX_EXTERNAL_HEADER_DIR and LIBCXX_EXTERNAL_LIBRARY_DIR. Example for configuring and running the test-suite:

$ cmake -G Ninja -DCMAKE_CXX_COMPILER=/some/c++ -DLLVM_ENABLE_RUNTIMES=libcxx -DLIBCXX_TEST_CONFIG=ibm-libc++-shared.cfg.in -DLIBCXX_TEST_ONLY=ON -DLIBCXX_EXTERNAL_HEADER_DIR=/path/to/build/include/c++/v1 -DLIBCXX_EXTERNAL_LIBRARY_DIR=/path/to/build/lib
$ ninja check-cxx

Benefits of this change include:

  • Allows for a different compiler (different from the compiler used to build the runtime) to be specified for testing (with CMAKE_CXX_COMPILER)
  • Allows platforms to run only the test-suite (if they don’t care about building the runtime).

Diff Detail

Event Timeline

Jake-Egan created this revision.Jan 9 2023, 10:50 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 9 2023, 10:50 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Jake-Egan requested review of this revision.Jan 9 2023, 10:50 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 9 2023, 10:50 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Herald added a reviewer: Restricted Project. · View Herald Transcript
Jake-Egan edited the summary of this revision. (Show Details)Jan 9 2023, 10:52 AM
Jake-Egan edited the summary of this revision. (Show Details)Jan 9 2023, 10:55 AM
EricWF added a subscriber: EricWF.Jan 13 2023, 2:07 PM

I'm not convinced this is something that we want to add the complexity for.

There was a lot of work done to remove similar functionality from the test suite in recent years in order to simplify the test harness and make it more maintainable.

Are we sure we want to re-add this?
Is there a way we can add this functionality out-of-band? It seems to me passing LIT the additional configuration lines as part of its invocation should serve your purpose, no? Is there really a need to make this a CMake configurable option if you can just point LIT at the tests?

Jake-Egan abandoned this revision.Jan 23 2023, 10:14 AM

Looking into an out-of-band solution.