Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-18999

Clang Static Analyzer tests fail with qbs projects

    XMLWordPrintable

Details

    Description

      Re-produce with e.g.

       ./qtcreator -test ClangStaticAnalyzer,testProject:simple.qbs
      

      This generates:

      Starting /home/nik/dev/creator/4.5/builds/gcc_qbs/qtc_Qt_5_6_2_gcc_64_Debug/install-root/bin/qtcreator...
      ********* Start testing of ClangStaticAnalyzer::Internal::ClangStaticAnalyzerUnitTests *********
      Config: Using QtTest library 5.6.2, Qt 5.6.2 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 4.9.1 20140922 (Red Hat 4.9.1-10))
      PASS   : ClangStaticAnalyzer::Internal::ClangStaticAnalyzerUnitTests::initTestCase()
      QDEBUG : ClangStaticAnalyzer::Internal::ClangStaticAnalyzerUnitTests::testProject(simple.qbs) SOFT ASSERT: "rc->id() == id" in file /home/nik/dev/creator/4.5/source/src/plugins/projectexplorer/target.cpp, line 603
      FAIL!  : ClangStaticAnalyzer::Internal::ClangStaticAnalyzerUnitTests::testProject(simple.qbs) 'waiter.wait(30000)' returned FALSE. ()
         Loc: [/home/nik/dev/creator/4.5/source/src/plugins/clangstaticanalyzer/clangstaticanalyzerunittests.cpp(92)]
      PASS   : ClangStaticAnalyzer::Internal::ClangStaticAnalyzerUnitTests::cleanupTestCase()
      Totals: 2 passed, 1 failed, 0 skipped, 0 blacklisted
      ********* Finished testing of ClangStaticAnalyzer::Internal::ClangStaticAnalyzerUnitTests *********
      /home/nik/dev/creator/4.5/builds/gcc_qbs/qtc_Qt_5_6_2_gcc_64_Debug/install-root/bin/qtcreator exited with code 1
      

      This most probably happens since https://codereview.qt-project.org/#/c/201161/ , which triggers an second parse operation. The plugin test waits for the first finished parse and then triggers a build - at this point an early return in QbsBuildStep::init is hit due to second parse operation going on.

      Removing the trigger for the second parse make the test run again:

      --- src/plugins/qbsprojectmanager/qbsproject.cpp
      +++ src/plugins/qbsprojectmanager/qbsproject.cpp
      @@ -142,15 +142,15 @@ QbsProject::QbsProject(const FileName &fileName) :
           connect(this, &Project::removedTarget, this, &QbsProject::targetWasRemoved);
           subscribeSignal(&BuildConfiguration::environmentChanged, this, [this]() {
               if (static_cast<BuildConfiguration *>(sender())->isActive())
                   delayParsing();
           });
      -    connect(this, &Project::activeProjectConfigurationChanged,
      -            this, [this](ProjectConfiguration *pc) {
      -        if (pc && pc->isActive())
      -            delayParsing();
      -    });
      +//    connect(this, &Project::activeProjectConfigurationChanged,
      +//            this, [this](ProjectConfiguration *pc) {
      +//        if (pc && pc->isActive())
      +//            delayParsing();
      +//    });
       
           connect(&m_parsingDelay, &QTimer::timeout, this, &QbsProject::startParsing);
       
           connect(m_cppCodeModelUpdater, &CppTools::CppProjectUpdater::projectInfoUpdated, this,
                   [this](const CppTools::ProjectInfo &projectInfo){
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            hunger Tobias Hunger
            kosjar Nikolai Kosjar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes