microsoft / vscode-cmake-tools

CMake integration in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools
MIT License
1.43k stars 430 forks source link

After clicking Run Tests an error is reported #3738

Closed v-frankwang closed 1 month ago

v-frankwang commented 1 month ago

Brief Issue Summary

Note: This issue is only reproduced on the pre-release channel.

Repro steps:

  1. Create a new folder named 'CMakeProject1' and open it with vscode.
  2. Create a file named CMakeLists.txt with the following content: cmake_minimum_required(VERSION 3.8) project(CMakeProject1) add_executable(CMakeProject1 "CMakeProject1.cpp" "CMakeProject1.h") enable_testing() add_executable(UnitTest "test.cpp") add_test(UnitTest0 UnitTest 0) add_test(UnitTest1 UnitTest 1)
  3. Create a file named test.cpp with the following content:

    include

              auto main() -> int { std::cout << "hello world" << std::endl; }
  4. Create a file named CMakeProject1.cpp with the following content:

    include "CMakeProject1.h"

           using namespace std;
           int main()
          {
               cout << "Hello CMake." << endl;
               return 0;
          }
  5. Create a file named “CMakeProject1.h” with the following content:

    pragma once

           #include <iostream>
  6. Run command: “CMake:configure”
  7. Click on Testing in the left navigation bar
  8. Click'Debug Tests'.

Actual results: image

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

No response

gcampbell-msft commented 1 month ago

This PR #3731 fixes this issue. Thanks.