[llvm-dev] Running clang tests

Alexandre Ganea via llvm-dev llvm-dev at lists.llvm.org
Fri Apr 10 13:34:33 PDT 2020


LLVM requires Visual Studio 2017 or 2019: https://llvm.org/docs/GettingStartedVS.html#software – you could use Community 2019.

I don’t recommend building LLVM inside Visual Studio. However you can generate or update the VS solution once in a while:

  *   mkdir buildVS && cd buildVS
  *   cmake {your_llvm_root}/llvm -G"Visual Studio 16 2019" -Thost=x64 -DLLVM_ENABLE_PROJECTS=clang;llvm -DLLVM_OPTIMIZED_TABLEGEN=ON

Use Ninja instead for building: https://ninja-build.org/ it’s a lot faster - keep Visual Studio only for debugging.
Ensure ninja.exe is in %PATH%.

From a Visual Studio shell (“x64 Native Tools Command Prompt for VS 2019” in the Start menu) run the following:

  *   mkdir buildNinjaRel && cd buildNinjaRel
  *   cmake {your_llvm_root}/llvm -G"Ninja" -DLLVM_ENABLE_PROJECTS=clang;llvm -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_OPTIMIZED_TABLEGEN=ON
  *   ninja check-all

You can then debug the test in VS: {your_llvm_root}\buildNinjaRel\tools\clang\unittests\ASTMatchers\ASTMatchersTests.exe

Then re-run “ninja check-clang-unit” or just “ninja” if you want to iterate on code changes.


De : llvm-dev <llvm-dev-bounces at lists.llvm.org> De la part de Sudhindra kulkarni via llvm-dev
Envoyé : April 10, 2020 6:42 AM
À : llvm-dev at lists.llvm.org
Objet : [llvm-dev] Running clang tests

Hi Team,
                 I have checked out the clang and llvm source code and built the executables using the visual studio 2015 community edition. I am using Windows as my platform.

However I  see that there are some test cases under the clang test folder in the LLVM.sln. Eg AstMatcherTest,ASTTests etc. I see that these tests make use of the Google test framework.

In my visual studio I have installed Google Test Adapter extension for running the Google tests.

But the tests under AstMatcherTest,ASTTests projects won't show up in the Test Explorer view in visual studio even after building these projects.So I wanted to know the reason for the same.

So can you please let me know if it possible to run these tests in visual studio. If not how to run them.

Thanks in advance.

Thanks and Regards
Sudhindra Kulkarni

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200410/58bb41d0/attachment.html>

More information about the llvm-dev mailing list