vscode-cmake-tools
vscode-cmake-tools copied to clipboard
Possible Line Ending issue in test output
Brief Issue Summary
I am using CMake 3.22.2 in a podman container en connected using the VSCode Dev Container with CMake Tools v1.14.33
As a testing framework i am using GUnit which is an extension on top of Google Test.
When i run a test the test succeeds and fails when it should, this is correctly viewed on the test explorer.
I issue get apparent when i open the Test Result .
CMake Tools
My test results are formatted by the test explorer like this:
Running main() from /workspaces/hello-world-app-docker/out/build/Linux-gcc/_deps/gunit-src/libs/googletest/googletest/src/gtest_main.cc
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from Example
[ RUN ] Example.Showing off
Set Up
File: /workspaces/hello-world-app-docker/GUnit_HelloWorld/test/GSteps.feature
Feature: Example
Scenario: Showing off
Step:
Tear Down
File: /workspaces/hello-world-app-docker/GUnit_HelloWorld/test/GSteps.feature
Feature: Example
Scenario: Showing off
Step: The following steps should be shown on the screen
[ Given ] I create steps # GSteps.feature:7
[ Given ] I add step a # GSteps.feature:8
[ Given ] I add step b # GSteps.feature:9
[ When ] I run the scenario # GSteps.feature:10
Runni...
The rest of the test output was removed since it exceeds the threshold of 1024 bytes.
(VSCode) Terminal
While in my terminal the test is correctly formatted like:
1: Running main() from /workspaces/hello-world-app-docker/out/build/Linux-gcc/_deps/gunit-src/libs/googletest/googletest/src/gtest_main.cc
1: [==========] Running 1 test from 1 test suite.
1: [----------] Global test environment set-up.
1: [----------] 1 test from Example
1: [ RUN ] Example.Showing off
1: Set Up
1: File: /workspaces/hello-world-app-docker/GUnit_HelloWorld/test/GSteps.feature
1: Feature: Example
1: Scenario: Showing off
1: Step:
1:
1: Tear Down
1: File: /workspaces/hello-world-app-docker/GUnit_HelloWorld/test/GSteps.feature
1: Feature: Example
1: Scenario: Showing off
1: Step: The following steps should be shown on the screen
1:
1: [ Given ] I create steps # GSteps.feature:7
1: [ Given ] I add step a # GSteps.feature:8
1: [ Given ] I add step b # GSteps.feature:9
1: [ When ] I run the scenario # GSteps.feature:10
1: Running...
1: [ Then ] The following steps should be shown on the screen # GSteps.feature:11
1:
1: [ OK ] Example.Showing off (0 ms)
1: [----------] 1 test from Example (0 ms total)
1:
1: [----------] Global test environment tear-down
1: [==========] 1 test from 1 test suite ran. (0 ms total)
1: [ PASSED ] 1 test.
1/1 Test #1: hello_test ....................... Passed 0.03 sec
100% tests passed, 0 tests failed out of 1
Total Test time (real) = 0.15 sec
CMake Test Explorer
And when i use another extension for the test explorer CMake Test Explorer the result looks like this:
Start 1: hello_test
1: Test command: /workspaces/hello-world-app-docker/out/build/Linux-gcc/GUnit_HelloWorld/test/hello_test
1: Environment variables:
1: SCENARIO=/workspaces/hello-world-app-docker/GUnit_HelloWorld/test/GSteps.feature
1: Test timeout computed to be: 10000000
1: Running main() from /workspaces/hello-world-app-docker/out/build/Linux-gcc/_deps/gunit-src/libs/googletest/googletest/src/gtest_main.cc
1: [==========] Running 1 test from 1 test suite.
1: [----------] Global test environment set-up.
1: [----------] 1 test from Example
1: [ RUN ] Example.Showing off
1: Set Up
1: File: /workspaces/hello-world-app-docker/GUnit_HelloWorld/test/GSteps.feature
1: Feature: Example
1: Scenario: Showing off
1: Step:
1:
1: Tear Down
1: File: /workspaces/hello-world-app-docker/GUnit_HelloWorld/test/GSteps.feature
1: Feature: Example
1: Scenario: Showing off
1: Step: The following steps should be shown on the screen
1:
1: [ Given ] I create steps # GSteps.feature:7
1: [ Given ] I add step a # GSteps.feature:8
1: [ Given ] I add step b # GSteps.feature:9
1: [ When ] I run the scenario # GSteps.feature:10
1: Running...
1: [ Then ] The following steps should be shown on the screen # GSteps.feature:11
1:
1: [ OK ] Example.Showing off (0 ms)
1: [----------] 1 test from Example (0 ms total)
1:
1: [----------] Global test environment tear-down
1: [==========] 1 test from 1 test suite ran. (0 ms total)
1: [ PASSED ] 1 test.
1/1 Test #1: hello_test ....................... Passed 0.03 sec
Since CMake Test Explorer also uses the native test explorer and all the while does output in the desired format I think it's fair to make the assumption that the issue lies within (my usage of) CMake Tools. Is there anything that can be done for this issue
CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
Running in dev container using docker and windows 10
@TheKayneGame Thanks for notifying us of this issue! I suspect that you are correct regarding it possibly being a line ending issue. We will investigate and work to get a fix in our 1.16 release.
Me too. I'm looking forward for this issue to be solved.
@yhgu2000 @TheKayneGame Is there any way that you could provide a minimal repro project so that we can investigate?
@yhgu2000 @TheKayneGame Is there any way that you could provide a minimal repro project so that we can investigate?
Here you go: 3274.tar.gz
@yhgu2000 I'm using the program you provided but I don't seem to be reproducing the problem, hopefully you can give me some advice!
Here are my test results:
Test results:
(VSCode) Terminal:
@v-frankwang I think I know where the problem is: it happens only when one ssh to Linux machines from Windows, and the missed \r in Linux output caused this issue. I'm afraid that there might be problem for macOS too.
I reproduced your experience in my computer too. The picture below is my observation. The VSCode on the left is using VSCode on the local Windows machine. The right is using VSCode on a remote linux machine by Remote SSH.
In case of there's something wrong with the CMake version. The cmake on my Windows is version 3.26.3, and the cmake on my Linux is version 3.22.1.
@gcampbell-msft @yhgu2000 Following the steps given by the user, this issue we can reproduce on top of the latest VSCode and you can get some information below:
ENV: VS Code: 1.88.1 CMake tools: 1.18.29 C/C++:1.20.2
Repro steps recording:
- Download the project:3274.tar.gz and open it in vscode.
- Run the CMake:config command.
- Click on the Testing icon in the left navigation bar.
- Click the Run Test icon.
- Observe the test results window.
Actual results:
OS: Linux
CMake version: 3.29.2
OS: Mac
CMake version: 3.29.2
@gcampbell-msft i think this issue is probably solved with #3752
@hippo91 This pull requests:https://github.com/microsoft/vscode-cmake-tools/pull/3752 hasn't been merged yet, I'll wait until it is and then I'll verify that this issue has been resolved.
We verified the issue on the latest version and it is not reproducing, so close it.
ENV: VS Code: 1.90.2 CMake tools: 1.19.13(pre-release) C/C++:1.21.0(pre-release)
Actual results: