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

Qt Creator can't parse Googletest output if GTEST_COLOR environment variable is set

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: Qt Creator 4.7.0
    • Fix Version/s: Qt Creator 4.8.0-beta1
    • Component/s: Test Integration
    • Labels:
      None
    • Environment:
      Ubuntu 16.04
    • Platform/s:
      Linux/Other display system
    • Commits:
      d058dcc326beee59b59e786d6448d9207eedd00e

      Description

      Scenario: Running GTest unit tests within Qt Creator, from the Tests pane.

       

      Issue: If the environment variable GTEST_COLOR is set to 1, Qt Creator cannot parse the output, and fails with the following error:

      FATAL: Test for project "the-project-name" failed to produce any expected output."
      

      Steps to reproduce:

      1. Create an Autotest project, selecting Googletest as the test framework.
      2. In Projects -> Build Environment, add a variable named GTEST_COLOR with a value of 1.
      3. Run the single default test from the Tests pane.

      Description:

      GTEST_COLOR is an environment variable you can set so that test output in a shell is coloured according to the test result.

      When GTEST_COLOR is not set, Qt Creator sees and processes test output like this (in this case, in GTestOutputReader::processOutput():

      outputLine = "[==========] Running 1 test from 1 test case."

      If, however, GTEST_COLOR=1 is set, Qt Creator sees the colour formatting, which it can't parse:

      outputLine = "\x1B[m\x1B[0;32m[==========] \x1B[mRunning 1 test from 1 test case."

      The attached screenshots show the working and non-working case for the default test created when using the Autotest project creation wizard with Googletest.

      It'd be nice if Qt Creator could parse this, as there are cases where Qt Creator needs to be run from a shell where it's handy to also be able to run the unit tests standalone (for example, a cross-compilation environment with Yocto, where the compiler is detected according to the environment variables).

        Attachments

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

          Activity

            People

            Assignee:
            cstenger Christian Stenger
            Reporter:
            garryjj Garry Jeromson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes