ccls icon indicating copy to clipboard operation
ccls copied to clipboard

running -test-index failed with clang version mismatch

Open mlite opened this issue 6 years ago • 4 comments

ccls can only be built with llvm>=7.0, but the test-index seem still require llvm-6.00 Reproducing steps:

  1. build ccls with llvm-7.0
  2. run the following comand
./ccls -test-index
Index tests must be run using clang version 6.0.0, ccls is running with 7.1.0

System information

  • ccls version (git describe --tags --long): Head
  • clang version: 7.0
  • OS: Debian

mlite avatar Jul 02 '19 22:07 mlite

There is a version check. I haven't updated the tests for a while. I'll do one when clang 9.0.0 comes out.

// src/test.cc
  static const char kRequiredClangVersion[] = "6.0.0";
  if (version != kRequiredClangVersion &&
      version.find("svn") == std::string::npos) {
    fprintf(stderr,
            "Index tests must be run using clang version %s, ccls is running "
            "with %s\n",
            kRequiredClangVersion, version.c_str());
    return false;
  }

MaskRay avatar Jul 03 '19 02:07 MaskRay

I know it is not an important issue, but what about making the tests optional at build time? Or slightly better: moving them from ccls to a second executable (like ccls-index-tests)?

rherilier avatar Nov 29 '24 14:11 rherilier

I know it is not an important issue, but what about making the tests optional at build time? Or slightly better: moving them from ccls to a second executable (like ccls-index-tests)?

Agreed. A second executable, not built by the default all target, seems better...

MaskRay avatar Nov 30 '24 04:11 MaskRay

As I'm not used to your project, what is your preference:

  • a main.cc in a dedicated directory "tests";
  • rename main.cc to main_server.cc for the "ccls" executable and create a main_test_index.cc for the "test-index" executable;
  • other?

best regards

rherilier avatar Dec 06 '24 14:12 rherilier