[libcxx-commits] [PATCH] D137110: [libc++] Option to specify a different compiler for testing

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 9 01:15:25 PST 2022


mstorsjo added a comment.

I'm not entirely sure what the best way would be to set things up to run the testsuite on its own, but I've been doing that manually, for running individual tests with third party C++ library implementations.

So far, I've made it by first taking a regular build+test setup, then making a copy of the lit site configs and llvm-lit scripts and modifying them to suit my use case. In my case, I test with the default C++ library shipped with a compiler, so I can mostly rip out most of what's set in `%{compile_flags}` and `%{link_flags}` (which serves to make the compiler use the just-built libc++ instead of the default one shipped with the compiler), but if you want to test specifically the just-built libc++ with a different compiler, you probably need fewer changes.

Anyway, my setup, for running libc++ tests against MSVC STL, looks like this:
A frontend shell script:

  #!/bin/sh
  # export PATH=/path/to/my/external/compiler:$PATH
  export LIBCXX_SITE_CONFIG=$(cd $(dirname $0) && pwd)/msvc-lit.site.cfg
  python3 $(dirname $0)/custom-lit "$@"

A custom copy of the `llvm-lit`  script, named `custom-lit`: https://martin.st/temp/custom-lit
A handwritten site config, `msvc-lit.site.cfg`: https://martin.st/temp/msvc-lit.site.cfg
(The latter is mostly a hand-merged/set up version of `cmake-bridge.cfg.in` and one of the regular config files.)

Similarly I've got a set up for running tests against libstdc++.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137110



More information about the libcxx-commits mailing list