Feature Request: Select Active Folder for Build and Test Tasks #3256
Labels
enhancement
an enhancement to the product that is either not present or an improvement to an existing feature
Feature: tasks
help wanted
we currently are not planning work on this and would like help from the open source community
Milestone
Brief Issue Summary
I have a multi-root
code-workspace
file with my root project folder and a tests folder. I have separate projects because the tests run locally on my windows machine with a msys64 toolchain, but the project itself is built for an ARM microcontroller with the arm-none-eabi toolchain.I want to create separate tasks to build my project for arm, and to run my unit tests on windows. So far, I'm focusing on running the tests.
I want to note that to do what I want to do manually, I can make sure my tests folder is selected (
++ctrl+shift+p++
CMake: Select Active Folder
, selectTests
) and then run the++ctrl+shift+p++
CMake: Run Tests
command. When I do this, it properly builds my test app and executes the unit tests. The issue is that I manually need to switch back to the project folder to run the build, and if I want to run the tests again, I need to manually switch back to the tests folder. I would like to automatically do that by using tasks to switch the folder and run the build or tests.Attempt Number 1 - Using
cmake
Task TypeThe first thing I tried was to find a way to adjust the
cmake
type test to use the tests folder. Here is my.code-workspace
file:Adjusting the
cwd
parameter had no effect though, and the task always executed on theProject
folder. I couldn't find another relevant parameter to try to change.Attempt Number 2 - Using Task to Switch Folders
My second idea was to switch folders using another task which is called as a dependency of my test task. Here is my configuration to do that:
This almost works, but it always opens up a input window to select with folder to select when the
cmake.selectActiveFolder
command runs:Is there any way to get VSCode to automatically select the
tests
folder? I couldn't get this working with theargs
parameter. Otherwise, is there another way to accomplish what I'm trying to do?CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: