DavidSchuldenfrei / gtest-adapter

Other
18 stars 9 forks source link

WARNING: unrecognized output format "json" ignored #38

Open vk-coder opened 5 years ago

vk-coder commented 5 years ago

System: CentOS Linux release 7.4.1708 (Core) vscode: 1.33.0 Google Test: gtest-1.6.0 g++: 4.8.5

launch.json

{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "(gdb) Launch", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/build/unittest/test", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": true, "MIMode": "gdb", "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true } ] } ] }

After creating above launch.json file when I go to extension and refresh i get this error. another strange issue is, when I run the tests 5-6 tests fails. But if I run the test program from outside of vscode everything passes.

i have also tried by removing the comment lines from launch.json file but it fails the same way.

DavidSchuldenfrei commented 5 years ago

@vk-coder Hi, the warning you get is because you are using a previous version of GoogleTest (1.6) and should disappear if you upgrade to the latest version (1.8.1). This will also give you additional features in the adapter. If you cannot upgrade GoogleTest, you can safely ignore this warning as it shouldn't have any impact. Am I correct?

Regarding tests failing from the adapter. This is indeed weird. Does this happen when running all test/some tests. Do the same tests fail repeatedly? What happens when you debug them?

vk-coder commented 5 years ago

only some specific tests are failing. but same test binary if run from outside of vscode works just fine (meaning all the tests passing). Unfortunately i am not able to setup debugging under vscode.

DavidSchuldenfrei commented 5 years ago

@vk-coder I am trying to understand the reason for this discrepancy. What is the failure you are getting? You should see this in the Output Window. Do these tests fail when running as a single test or when running all tests? Can you try running from the terminal with argument --gtest_filter=* (runs all tests), or --gtest_filter=[Specific test filter]. You can see the exact filter I pass to GTest as the first line in the output window.

vk-coder commented 5 years ago

both --gtest_filter=* (runs all tests), or --gtest_filter=[Specific test filter] work perfectly if run on a terminal (external to vscode).

but few tests always fail inside plugin. the failure is not in the running but the actual test case validations fail.

exactly 4 tests (out of 22) always fails irrespective of selectively running or running all. those 4 tests are always fixed. but as mentioned earlier all 22 always pass if run from terminal out side again selective or run all.

raeperd commented 4 years ago

@vk-coder Hi, the warning you get is because you are using a previous version of GoogleTest (1.6) and should disappear if you upgrade to the latest version (1.8.1). This will also give you additional features in the adapter. If you cannot upgrade GoogleTest, you can safely ignore this warning as it shouldn't have any impact. Am I correct?

Regarding tests failing from the adapter. This is indeed weird. Does this happen when running all test/some tests. Do the same tests fail repeatedly? What happens when you debug them?

Version upgrade to 1.8.1 worked for me! Thanks. you saved me.