Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ctest prints [object Object] after return code #3591

Closed
benmcmorran opened this issue Feb 14, 2024 · 2 comments
Closed

Ctest prints [object Object] after return code #3591

benmcmorran opened this issue Feb 14, 2024 · 2 comments
Assignees
Labels
bug a bug in the product Feature: ctest
Milestone

Comments

@benmcmorran
Copy link
Member

Brief Issue Summary

After running a CTest suite, the line [ctest] [object Object] appears in the CMake/Build output pane. Something probably isn't getting deserialized correctly.

  1. Create a folder with these files:

CMakeLists.txt

project(ctest_issue)
include(CTest)
add_executable(main main.cpp)

main.cpp

int main() {}
  1. Open the folder in VS Code and run the CMake: Configure command.
  2. Run the CMake: Run Tests command.
  3. Check the content of the CMake/Build output pane.

CMake Tools Diagnostics

{
  "os": "win32",
  "vscodeVersion": "1.86.1",
  "cmtVersion": "1.17.15",
  "configurations": [
    {
      "folder": "c:\\Users\\bemcmorr\\source\\repos\\ctest_issue",
      "cmakeVersion": "3.28.0",
      "configured": true,
      "generator": "Visual Studio 17 2022",
      "usesPresets": false,
      "compilers": {}
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": true,
    "activeBuildType": "Debug",
    "buildTypesSeen": [
      "Debug",
      "Release",
      "MinSizeRel",
      "RelWithDebInfo"
    ],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 7,
    "executablesCount": 1,
    "librariesCount": 0,
    "targets": [
      {
        "name": "ALL_BUILD",
        "type": "UTILITY"
      },
      {
        "name": "Continuous",
        "type": "UTILITY"
      },
      {
        "name": "Experimental",
        "type": "UTILITY"
      },
      {
        "name": "Nightly",
        "type": "UTILITY"
      },
      {
        "name": "NightlyMemoryCheck",
        "type": "UTILITY"
      },
      {
        "name": "ZERO_CHECK",
        "type": "UTILITY"
      },
      {
        "name": "main",
        "type": "EXECUTABLE"
      }
    ]
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": null
    }
  ]
}

Debug Log

[main] Building folder: ctest_issue 
[build] Starting build
[proc] Executing command: "C:\Program Files\Microsoft Visual Studio\2022\Main\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" --build c:/Users/bemcmorr/source/repos/ctest_issue/build --config Debug --target ALL_BUILD -j 18 --
[build] MSBuild version 17.10.0-preview-24073-01+f0936bf4b for .NET Framework
[build] 
[build]   1>Checking Build System
[build]   Building Custom Rule C:/Users/bemcmorr/source/repos/ctest_issue/CMakeLists.txt
[build]   main.cpp
[build]   main.vcxproj -> C:\Users\bemcmorr\source\repos\ctest_issue\build\Debug\main.exe
[build]   Building Custom Rule C:/Users/bemcmorr/source/repos/ctest_issue/CMakeLists.txt
[driver] Build completed: 00:00:01.310
[build] Build finished with exit code 0
[proc] Executing command: "C:\Program Files\Microsoft Visual Studio\2022\Main\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\ctest.exe" -j18 -C Debug -T test --output-on-failure -R ^c\:\/users\/bemcmorr\/source\/repos\/ctest_issue$
[ctest]    Site: REDACTED
[ctest]    Build name: Win32-MSBuild
[ctest] Test project C:/Users/bemcmorr/source/repos/ctest_issue/build
[ctest] No tests were found!!!
[ctest] CTest finished with return code 0
[ctest] [object Object]

Additional Information

No response

@github-project-automation github-project-automation bot moved this to Triage Needed in CMake Tools Feb 14, 2024
@gcampbell-msft gcampbell-msft added bug a bug in the product Feature: ctest regression used to work and no longer does. Regressions are typically high priority and removed triage labels Feb 15, 2024
@gcampbell-msft gcampbell-msft self-assigned this Feb 15, 2024
@gcampbell-msft gcampbell-msft moved this from Triage Needed to To Do in CMake Tools Feb 15, 2024
@gcampbell-msft gcampbell-msft added this to the 1.17 milestone Feb 15, 2024
@benmcmorran
Copy link
Member Author

The problem is here. The vscode.TestMessage is directly logged in ctestFailed(), but it's not a string.

@gcampbell-msft gcampbell-msft modified the milestones: 1.17, On Deck Feb 15, 2024
@gcampbell-msft gcampbell-msft removed the regression used to work and no longer does. Regressions are typically high priority label Feb 15, 2024
@gcampbell-msft
Copy link
Collaborator

Thanks @benmcmorran, I've confirmed that this isn't a regression. However, I can confirm that this only repros if the cmake.ctest.allowParallelJobs setting is disabled. I've put the bug in to 1.18.

@gcampbell-msft gcampbell-msft removed their assignment Feb 15, 2024
@gcampbell-msft gcampbell-msft modified the milestones: On Deck, 1.18 Feb 15, 2024
@gcampbell-msft gcampbell-msft moved this from To Do to Ready to be Assigned in CMake Tools Feb 15, 2024
@gcampbell-msft gcampbell-msft self-assigned this Mar 1, 2024
@gcampbell-msft gcampbell-msft moved this from Ready to be Assigned to In Progress in CMake Tools Mar 1, 2024
@gcampbell-msft gcampbell-msft moved this from In Progress to Completed in CMake Tools Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug a bug in the product Feature: ctest
Projects
Status: Completed
Development

No branches or pull requests

2 participants