-
Notifications
You must be signed in to change notification settings - Fork 454
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
Enable Quick Debugging in Test Explorer like in Project Outline #3451
base: main
Are you sure you want to change the base?
Conversation
@microsoft-github-policy-service agree |
As you guys are the creators of the issues addressed by this PR I'd appreciate if you could do some beta testing. You may use the vsix package from https://github.com/basejumpa/vscode-cmake-tools/actions/runs/6895050421 and install it via ˋcode --install-extension cmake-tools.vsixˋ (remove the installed one before). |
I tried the original version before the force push and it didn't seem to work, saying |
@quyykk I needed to uninstall the extension before installing the vsix package. It sounds like you didn't uninstall, either. |
I did uninstall it before trying. I can try again though. However, with the latest version I get prompted to select a launch configuration instead of seeing an error, so I'm pretty sure this is caused by this PR. |
I assume you used the "Debug C/C++m File" button in the headline of a cpp (test) file as shown in the screenshot as (1). This never was connected to vscode-cmake-tools (afaik). You should use the "Debug Test" button in the test explorer marked by (2). The related documentation in |
@quyykk Weird! And you really installed via the command line the cmake-tools.vsix built from my feature branch at https://github.com/basejumpa/vscode-cmake-tools/actions/workflows/build-vsix.yml ? |
Yeah, I used the link you posted above. I also restarted VSCode and verified that it is uninstalled before installing the file. I've also disabled Auto-Update, because it would update the extension immediately. |
Thx for your screencast. Since I am working on Win11 and I saw you working on linux I tried it out in a github workspace (Ubuntu). Since it worked there as intended (see my screencast I assume that at your machine it didn't work to replace the extension by the vsix file. Here are the steps I did in the screencast where I used my "try-out-zone" repository with very simple cmake projects:
Result:
|
@basejumpa Thanks, I tried your test project on my machine and it did indeed work! So I have to assume it has something to do with the project I used. I thought it was because of presets, but I added a default preset to your project and it still worked, so I'll have to investigate some more I guess 😄 |
@quyykk I now managed to use the project on branch you're currently working on (see pull-request endless-sky/endless-sky#8095 ) with my changed extension inside a github codespace. And you won't believe it: I have the same behavior as you had:
So now I can reproduce the behavior and work on it. I'll ping you here as soon as I have some update worth to test it. Thx in advance! By the way: Extension C++ TestMate works like a charm with your code (since your unit tests are made with Catch2). Steps to complete build enviornment in a GitHub codespacecode --install-extension ms-vscode.cpptools-extension-pack
# Do what the .github/workflows/ci.yml does
sudo rm /etc/apt/sources.list.d/* && sudo dpkg --clear-avail # Speed up installation and get rid of unwanted lists
sudo apt-get update
sudo apt-get install -y --no-install-recommends libxmu-dev libxi-dev libgl-dev libglu1-mesa-dev libgles2-mesa-dev libwayland-dev libxkbcommon-dev libegl1-mesa-dev libosmesa6 mesa-utils libglvnd-dev x11-utils
sudo sh -c 'echo "pcm.!default { type plug slave.pcm \"null\" }" >> /etc/asound.conf'
cmake --version
apt-get upgrade cmake
sudo apt-get upgrade cmake
cmake --version
# Get younger cmake with supports Ninja Multi-Config
# @see https://askubuntu.com/questions/355565/how-do-i-install-the-latest-version-of-cmake-from-the-command-line
# @see https://apt.kitware.com/
sudo apt remove --purge --auto-remove cmake
cmake --version
sudo apt-get upgrade
sudo apt-get update
sudo apt-get cmake
sudo apt-get install cmake
cmake --version
sudo apt update && sudo apt install -y software-properties-common lsb-release && sudo apt clean all
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main"
sudo apt update
sudo apt install kitware-archive-keyring
sudo apt update
sudo apt install cmake
cmake --version
# Install ninja
sudo apt-get install ninja-b
# Instgall SDL2
cd ..
mkdir tmp
cd tmp
git clone https://github.com/libsdl-org/SDL.git -b SDL2
cd SDL
mkdir build
cd build
../configure
make
sudo make install
sudo apt-get install libsdl2-2.0-0
sudo apt-get install libjpeg-dev
sudo apt-get install libjpeg
sudo apt-get install libglew
sudo apt-get install libglew-dev
sudo apt-get install libopenal
sudo apt-get install libopenal-dev
sudo apt-get install libmad0-dev
# Download and force install of the build of CMake tools of the build https://github.com/basejumpa/vscode-cmake-tools/actions/runs/6912931021
gh run download 6912931021 --repo basejumpa/vscode-cmake-tools --name=cmake-tools.vsix
code --install-extension cmake-tools.vsix --force
# Reload VScode
code --reuse-window . |
The "culprit" why my changes weren't effective in the endless-sky project is the renaming via
at here. When I comment out that statement it works as expected. Steps to establish work-environment with endless-sky as testdataCreate codespace on #3451 Whenever notification dialogs appear in the lower right: Close them with the cross in their title bar. In view "TERMINAL" do ...
In Sidebar hit Run & Debug Launch Extension In the new instance of VSCode do the following: Open folder CTRL-SHIFT-P cmake select configure preset Select the first one on top CTRL-SHIFT-P cmake select build preset Select Debug In Status Bar hit "Build" |
@quyykk Now it works in your project as well. I would appreciate if you could try out the vsix from build https://github.com/basejumpa/vscode-cmake-tools/actions/runs/6991343632 |
@basejumpa Works on my end too, thanks! |
+1 |
@basejumpa It seems like you've gotten some feedback that this helps out some scenarios for users, is this something you'd like to merge into the extension? If so, please convert from a draft to an official PR |
@gcampbell-msft Thx for the reminder. I'll resume working in it: Rebase my changes, double-check if things need to be adapted, add some tests, ... As soon as it is sufficient I remove the draft flag. |
@basejumpa Pinging on this. It's been a while since there was any activity on this, is this still something you'd like to merge into the product? My main feedback in general, is that it seems like we don't necessarily need to remove the features from #3064, but we could instead use your implementation when no launch configurations are found. This way, you can have the best of both worlds. Please let us know if this is still something you plan to work on. |
This topic hasn't bothered me the recent months only because currently I am busy with other topics. Shall mean please feel free to tackle this topic, maybe my old work towards some solution may help. |
This change addresses items #3345, #3280 and #3153
The following changes are proposed:
When the user debugs a test via
TestExplorer/some-test/Debug-Icon
now the method to create a debug configuration behind the scenes is used as when the user right-clicks an executable and used "Debug" in thePROJECT OUTLINE
of cmake.The purpose of this change
Harmonize Quick Debugging of executables and tests.
Simplify debugging of tests.
Changes in current behavior
This removes behavior introduced by PR #3064. But I think this is fine, see #3345 (comment) .
This may necessary to adapt the documentation at https://github.com/microsoft/vscode-cmake-tools/blob/main/docs/debug-launch.md#debugging-tests I'd add a suggestion if you guys like.
Please have a look there as well. Thx.
Remark: I used https://github.com/basejumpa/vscode-cmake-tools-testdata as testdata while coding.