Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Enable Quick Debugging in Test Explorer like in Project Outline#3451

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
basejumpa wants to merge3 commits intomicrosoft:main
base:main
Choose a base branch
Loading
frombasejumpa:main

Conversation

@basejumpa
Copy link

@basejumpabasejumpa commentedNov 16, 2023
edited
Loading

This change addresses items#3345,#3280 and#3153

The following changes are proposed:

When the user debugs a test viaTestExplorer/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 athttps://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 usedhttps://github.com/basejumpa/vscode-cmake-tools-testdata as testdata while coding.

@basejumpa
Copy link
Author

@microsoft-github-policy-service agree

@basejumpa
Copy link
Author

basejumpa commentedNov 17, 2023
edited
Loading

@quyykk
@taneadam
@ilvirtuoso

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 fromhttps://github.com/basejumpa/vscode-cmake-tools/actions/runs/6895050421 and install it via ˋcode --install-extension cmake-tools.vsixˋ (remove the installed one before).

@basejumpabasejumpa changed the titleSame Quick Debugging in Test Explorer as in Project OutlineEnable Quick Debugging in Test Explorer like in Project OutlineNov 17, 2023
@quyykk
Copy link

quyykk commentedNov 18, 2023
edited
Loading

I tried the original version before the force push and it didn't seem to work, sayingNo launch configurations found.. Did I mess something up? Thanks for working on this!

@basejumpa
Copy link
Author

@quyykk I needed to uninstall the extension before installing the vsix package. It sounds like you didn't uninstall, either.

@quyykk
Copy link

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.

@basejumpa
Copy link
Author

@quyykk

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).

image

The related documentation indocs/debug-launch.md still needs to be adapted within this PR.

@quyykk
Copy link

Here I made a video:

cmake-test1.mp4

Doing the same thing with the latest release gives me this prompt:

image

@basejumpa
Copy link
Author

@quyykk Weird! And you really installed via the command line the cmake-tools.vsix built from my feature branch athttps://github.com/basejumpa/vscode-cmake-tools/actions/workflows/build-vsix.yml ?

@quyykk
Copy link

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.

@basejumpa
Copy link
Author

basejumpa commentedNov 22, 2023
edited
Loading

@quyykk

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 (seemy 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:

# Install C/C++ Extension Pack comprising debugger support for C/C++ and CMake toolscode --install-extension ms-vscode.cpptools-extension-pack# Download and force install of the build of CMake tools of the build https://github.com/basejumpa/vscode-cmake-tools/actions/runs/6912931021gh run download 6912931021 --repo basejumpa/vscode-cmake-tools --name=cmake-tools.vsixcode --install-extension cmake-tools.vsix --force# Reload VScodecode --reuse-window .
  • Select Kit "Clang ..."
  • Build the project
  • Open filetestdata-02-gtest/some_unit/some_unit_test.cpp
  • Set breakpoints in lines 5 and 9.
  • Open view "TESTING".
  • Hit "Refresh Tests" (loop icon in header)
  • Debug a test.

Result:

  • Breakpoint hit inside debug session. No launch config was asked for.

@quyykk
Copy link

@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 😄

basejumpa reacted with thumbs up emoji

@basejumpa
Copy link
Author

basejumpa commentedNov 22, 2023
edited
Loading

@quyykk I now managed to use the project on branch you're currently working on (see pull-requestendless-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:

...[build] Build finished with exit code 0[main] Failed to prepare executable target with name "endless-sky-tests"[ctest] No launch configurations found.

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: ExtensionC++ TestMate works like a charm with your code (since your unit tests are made withCatch2).

Steps to complete build enviornment in a GitHub codespace
code --install-extension ms-vscode.cpptools-extension-pack# Do what the .github/workflows/ci.yml doessudo rm /etc/apt/sources.list.d/*&& sudo dpkg --clear-avail# Speed up installation and get rid of unwanted listssudo apt-get updatesudo 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-utilssudo sh -c'echo "pcm.!default { type plug slave.pcm \"null\" }"  >> /etc/asound.conf'cmake --versionapt-get upgrade cmakesudo apt-get upgrade cmakecmake --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 cmakecmake --versionsudo apt-get upgradesudo apt-get updatesudo apt-get cmakesudo apt-get install cmakecmake --versionsudo apt update&& sudo apt install -y software-properties-common lsb-release&& sudo apt clean allwget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc2>/dev/null| gpg --dearmor -| sudo tee /etc/apt/trusted.gpg.d/kitware.gpg>/dev/nullsudo apt-add-repository"deb https://apt.kitware.com/ubuntu/$(lsb_release -cs) main"sudo apt updatesudo apt install kitware-archive-keyringsudo apt updatesudo apt install cmakecmake --version# Install ninjasudo apt-get install ninja-b# Instgall SDL2cd ..mkdir tmpcd tmpgit clone https://github.com/libsdl-org/SDL.git -b SDL2cd SDLmkdir buildcd build../configuremakesudo make installsudo apt-get install libsdl2-2.0-0sudo apt-get install libjpeg-devsudo apt-get install libjpegsudo apt-get install libglewsudo apt-get install libglew-devsudo apt-get install libopenalsudo apt-get install libopenal-devsudo 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/6912931021gh run download 6912931021 --repo basejumpa/vscode-cmake-tools --name=cmake-tools.vsixcode --install-extension cmake-tools.vsix --force# Reload VScodecode --reuse-window.

@basejumpabasejumpa marked this pull request as draftNovember 22, 2023 17:45
@basejumpa
Copy link
Author

basejumpa commentedNov 25, 2023
edited
Loading

The "culprit" why my changes weren't effective in the endless-sky project is the renaming via

set_target_properties(EndlessSkyTests PROPERTIES OUTPUT_NAME "endless-sky-tests")

athere. When I comment out that statement it works as expected.

Steps to establish work-environment with endless-sky as testdata

Create codespace on#3451

Whenever notification dialogs appear in the lower right: Close them with the cross in their title bar.

In view "TERMINAL" do ...

# Change to home directory and get the testdata(cd ; git clone https://github.com/quyykk/endless-sky --depth 1 --single-branch bye-codeblocks)# Complete build environment for testdatasudo apt-get update && sudo apt-get install libsdl2-dev libglew-dev libopenal-dev libmad0-dev

In Sidebar hit Run & Debug

Launch Extension

In the new instance of VSCode do the following:

Open folder~/bye-codeblocks

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"

@basejumpa
Copy link
Author

basejumpa commentedNov 25, 2023
edited
Loading

@quyykk Now it works in your project as well. I would appreciate if you could try out the vsix from buildhttps://github.com/basejumpa/vscode-cmake-tools/actions/runs/6991343632

@quyykk
Copy link

@basejumpa Works on my end too, thanks!

@weyllor
Copy link

+1

@gcampbell-msft
Copy link
Collaborator

@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

basejumpa reacted with thumbs up emoji

@basejumpa
Copy link
Author

@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.

gcampbell-msft reacted with thumbs up emoji

@gcampbell-msft
Copy link
Collaborator

@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.
Also,
@basejumpa@quyykk@taneadam@ilvirtuoso Please let us know if this is something you'd like to be merged into the product, and if so, if@basejumpa doesn't plan to work on this more, we may be able to put it on our backlog to work on ourselves. Thanks!

@basejumpa
Copy link
Author

basejumpa commentedOct 26, 2024
edited
Loading

@gcampbell-msft

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.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotAwaiting requested review from CopilotCopilot will automatically review once the pull request is marked ready for review

At least 1 approving review is required to merge this pull request.

Assignees

@paulmaybeepaulmaybee

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@basejumpa@quyykk@weyllor@gcampbell-msft@paulmaybee

[8]ページ先頭

©2009-2025 Movatter.jp