Giter VIP home page Giter VIP logo

Comments (11)

matepek avatar matepek commented on May 26, 2024

Found and fixed. Will be released soon

from vscode-catch2-test-adapter.

csorvagep avatar csorvagep commented on May 26, 2024

With version 2.4.5 I still have the issue.
Adding this test to the example in the other issue ( #87 ):

TEST(failTest, emptyVector)
{
    std::vector<int> v;
    v.front() = 10;
    SUCCEED();
}

Although one thing changed. Now when I run the test one-by-one, the wrong test resets the tests.

from vscode-catch2-test-adapter.

matepek avatar matepek commented on May 26, 2024

Thats weird. I'm pretty sure I found it and fixed it. Also I couldn't reproduce it with your way anymore.
Maybe we misunderstand each other. Please describe in details.

from vscode-catch2-test-adapter.

csorvagep avatar csorvagep commented on May 26, 2024

Describe the bug (A clear and concise description of what the bug is.)
When I click on the run tests button the tests stay gray. If I run the one by one the first become red as
it should, then on the second both tests become gray. I hope this description helps, and sorry but the log become quite long.

To Reproduce (Steps to reproduce the behavior:)

  1. Test main.cpp:
#include <gtest/gtest.h>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>

TEST(cwdTest, fileReadTest)
{
    std::ifstream file("test.txt");
    ASSERT_TRUE(file.good());
    std::string str;
    getline(file, str);
    EXPECT_EQ(str, "asd");
}

TEST(failTest, wrongIndex)
{
    std::vector<int> v;
    v.front() = 10;
    SUCCEED();
}

int main(int argc, char** argv)
{
    ::testing::InitGoogleTest(&argc, argv);
    return RUN_ALL_TESTS();
}

Desktop (please complete the following information):

  • Extension Version 2.4.5
  • VS Code Version 1.33.1
  • Google Test Version 1.8.1-2
  • OS Type and Version Windows 10 - 1809

Log (Attach log. (optional, Set: catch2TestExplorer.logfile and reproduce the bug.) Warning: Log probably contains file and test names too.)

The log after runing all the tests (The user directory is replaced to %userprofile%)

[2019-04-28 20:06:08.930] [INFO] [at GoogleTestSuiteInfo._runInner (%userprofile%\.vscode\extensions\matepek.vscode-catch2-test-adapter-2.4.5\out\src\AbstractTestSuiteInfo.js:69:26)] proc starting:  cwd_test.exe
[2019-04-28 20:06:08.946] [INFO] [at GoogleTestSuiteInfo._runInner (%userprofile%\.vscode\extensions\matepek.vscode-catch2-test-adapter-2.4.5\out\src\AbstractTestSuiteInfo.js:75:26)] proc started: cwd_test.exe e:\code\cwd_test\build\cwd_test.exe [ '--gtest_color=no' ] { cwd: 'e:\\code\\cwd_test\\build',
  env:
   { C2TESTEXECUTABLEPATH: 'e:\\code\\cwd_test\\build\\cwd_test.exe' } };
[2019-04-28 20:06:08.978] [INFO] [at processChunk (%userprofile%\.vscode\extensions\matepek.vscode-catch2-test-adapter-2.4.5\out\src\GoogleTestSuiteInfo.js:204:46)] Test cwdTest.fileReadTest has started.
[2019-04-28 20:06:08.978] [INFO] [at processChunk (%userprofile%\.vscode\extensions\matepek.vscode-catch2-test-adapter-2.4.5\out\src\GoogleTestSuiteInfo.js:219:46)] Test  cwdTest.fileReadTest has finished.
[2019-04-28 20:06:08.978] [INFO] [at processChunk (%userprofile%\.vscode\extensions\matepek.vscode-catch2-test-adapter-2.4.5\out\src\GoogleTestSuiteInfo.js:204:46)] Test failTest.wrongIndex has started.
[2019-04-28 20:06:08.981] [INFO] [at ChildProcess._runInner.runInfo.process.once.args (%userprofile%\.vscode\extensions\matepek.vscode-catch2-test-adapter-2.4.5\out\src\AbstractTestSuiteInfo.js:85:34)] proc close: cwd_test.exe [ 3221225477, null ]
[2019-04-28 20:06:08.981] [WARN] [at _handleProcess.Promise.catch.then (%userprofile%\.vscode\extensions\matepek.vscode-catch2-test-adapter-2.4.5\out\src\GoogleTestSuiteInfo.js:270:38)] data.currentChild !== undefined:  { buffer: '[ RUN      ] failTest.wrongIndex\r\n',
  currentTestCaseNameFull: 'failTest.wrongIndex',
  currentChild:
   GoogleTestInfo {
     _shared:
      SharedVariables {
        log:
         Log {
           configSection: 'catch2TestExplorer',
           workspaceFolder: [Object],
           outputChannelName: 'Test Explorer: cwd_test',
           inspectOptions: [Object],
           includeLocation: true,
           targets: [Array],
           nextInspectOptions: undefined,
           configChangeSubscription: [Object] },
        workspaceFolder: { uri: [p], name: 'cwd_test', index: 0 },
        testStatesEmitter:
         u {
           _disposed: false,
           _options: undefined,
           _leakageMon: undefined,
           _event: [Function],
           _listeners: [i],
           _deliveryQueue: [] },
        loadWithTaskEmitter:
         u {
           _disposed: false,
           _options: undefined,
           _leakageMon: undefined,
           _event: [Function],
           _listeners: [i],
           _deliveryQueue: [] },
        sendTestEventEmitter:
         u {
           _disposed: false,
           _options: undefined,
           _leakageMon: undefined,
           _event: [Function],
           _listeners: [i] },
        retire:
         u {
           _disposed: false,
           _options: undefined,
           _leakageMon: undefined,
           _event: [Function],
           _listeners: [i] },
        rngSeed: null,
        execWatchTimeout: 10000,
        _execRunningTimeout: null,
        isNoThrow: false,
        enabledTestListCaching: false,
        _execRunningTimeoutChangeEmitter:
         u {
           _disposed: false,
           _options: undefined,
           _leakageMon: undefined,
           _event: [Function],
           _listeners: [i] },
        onDidChangeExecRunningTimeout: [Function] },
     testNameAsId: 'failTest.wrongIndex',
     label: 'wrongIndex',
     skipped: false,
     file: 'E:\\code\\cwd_test\\main.cpp',
     line: 15,
     type: 'test',
     description: '',
     lastRunState: undefined,
     lastRunMilisec: undefined,
     id: '14',
     origLabel: 'wrongIndex',
     tooltip: 'Name: failTest.wrongIndex' },
  group:
   GoogleTestGroupSuiteInfo {
     _shared:
      SharedVariables {
        log:
         Log {
           configSection: 'catch2TestExplorer',
           workspaceFolder: [Object],
           outputChannelName: 'Test Explorer: cwd_test',
           inspectOptions: [Object],
           includeLocation: true,
           targets: [Array],
           nextInspectOptions: undefined,
           configChangeSubscription: [Object] },
        workspaceFolder: { uri: [p], name: 'cwd_test', index: 0 },
        testStatesEmitter:
         u {
           _disposed: false,
           _options: undefined,
           _leakageMon: undefined,
           _event: [Function],
           _listeners: [i],
           _deliveryQueue: [] },
        loadWithTaskEmitter:
         u {
           _disposed: false,
           _options: undefined,
           _leakageMon: undefined,
           _event: [Function],
           _listeners: [i],
           _deliveryQueue: [] },
        sendTestEventEmitter:
         u {
           _disposed: false,
           _options: undefined,
           _leakageMon: undefined,
           _event: [Function],
           _listeners: [i] },
        retire:
         u {
           _disposed: false,
           _options: undefined,
           _leakageMon: undefined,
           _event: [Function],
           _listeners: [i] },
        rngSeed: null,
        execWatchTimeout: 10000,
        _execRunningTimeout: null,
        isNoThrow: false,
        enabledTestListCaching: false,
        _execRunningTimeoutChangeEmitter:
         u {
           _disposed: false,
           _options: undefined,
           _leakageMon: undefined,
           _event: [Function],
           _listeners: [i] },
        onDidChangeExecRunningTimeout: [Function] },
     label: 'failTest',
     description: undefined,
     type: 'suite',
     children:
      [ GoogleTestInfo {
          _shared: [SharedVariables],
          testNameAsId: 'failTest.wrongIndex',
          label: 'wrongIndex',
          skipped: false,
          file: 'E:\\code\\cwd_test\\main.cpp',
          line: 15,
          type: 'test',
          description: '',
          lastRunState: undefined,
          lastRunMilisec: undefined,
          id: '14',
          origLabel: 'wrongIndex',
          tooltip: 'Name: failTest.wrongIndex' } ],
     origLabel: 'failTest',
     id: '13',
     _tooltip: 'Name: failTest',
     file: 'E:\\code\\cwd_test\\main.cpp',
     line: 0 },
  beforeFirstTestCase: false,
  unprocessedTestCases: [],
  processedTestCases:
   [ GoogleTestInfo {
       _shared:
        SharedVariables {
          log: [Log],
          workspaceFolder: [Object],
          testStatesEmitter: [u],
          loadWithTaskEmitter: [u],
          sendTestEventEmitter: [u],
          retire: [u],
          rngSeed: null,
          execWatchTimeout: 10000,
          _execRunningTimeout: null,
          isNoThrow: false,
          enabledTestListCaching: false,
          _execRunningTimeoutChangeEmitter: [u],
          onDidChangeExecRunningTimeout: [Function] },
       testNameAsId: 'cwdTest.fileReadTest',
       label: 'fileReadTest',
       skipped: false,
       file: 'E:\\code\\cwd_test\\main.cpp',
       line: 6,
       type: 'test',
       description: '',
       lastRunState: 'failed',
       lastRunMilisec: 0,
       id: '12',
       origLabel: 'fileReadTest',
       tooltip: 'Name: cwdTest.fileReadTest' } ] }
[2019-04-28 20:06:08.982] [INFO] [at _runInner._handleProcess.catch.then (%userprofile%\.vscode\extensions\matepek.vscode-catch2-test-adapter-2.4.5\out\src\AbstractTestSuiteInfo.js:121:30)] proc finished: e:\code\cwd_test\build\cwd_test.exe
[2019-04-28 20:06:08.982] [INFO] [at GoogleTestSuiteInfo.reloadChildren (%userprofile%\.vscode\extensions\matepek.vscode-catch2-test-adapter-2.4.5\out\src\GoogleTestSuiteInfo.js:26:26)] reloadChildren cwd_test.exe

from vscode-catch2-test-adapter.

matepek avatar matepek commented on May 26, 2024

When I click on the run tests button the tests stay gray.

For me the "failTest" become a red triangle and the cwd_test stays grey? Isn't this the same for you?
Please confirm again.

from vscode-catch2-test-adapter.

matepek avatar matepek commented on May 26, 2024

Szia. írd már le magyarul mi a baj, mert nem biztos hogy értjük egymást :)

from vscode-catch2-test-adapter.

csorvagep avatar csorvagep commented on May 26, 2024

Először is: Lol :D
Igazából nehéz jobban körül írni a dolgot de megpróbálom. Szóval ha az összes tesztet együtt futtatom akkor szürke marad minden. Ha előbb a cwdTest-et futtatom az lefut és a 2.4.6 óta zöld pipa lesz. Utána ha lefuttatom a failTest-et akkor megint minden szürke lesz. Piros háromszöget még nem láttam.

from vscode-catch2-test-adapter.

matepek avatar matepek commented on May 26, 2024

Jól van, így értettem, csak nem tudtam reprodukálni, és gondoltam talán kommunikációs hiba van. Lehet platform specifikus. Majd ha Windows elé jutok, csekkolom.

from vscode-catch2-test-adapter.

matepek avatar matepek commented on May 26, 2024

Yepp, it was a windows specific one.

from vscode-catch2-test-adapter.

csorvagep avatar csorvagep commented on May 26, 2024

Thanks, now it works as expected, although the log became quite long. It's not really an issue, but worth noting.

from vscode-catch2-test-adapter.

matepek avatar matepek commented on May 26, 2024

I suggest to you to disable it. In that case it has no impact on the performance at all.

from vscode-catch2-test-adapter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.