Skip to content

Commit 855942f

Browse files
authored
Add developer guidance for debugging & running tests (#5234)
Related to - #5231 I moved the guidance to a separate file for easily extending it if we need to without clogging the main README. The pre-requisite section is the same as before
1 parent 761af8d commit 855942f

File tree

3 files changed

+46
-26
lines changed

3 files changed

+46
-26
lines changed
File renamed without changes.

README.md

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -84,32 +84,7 @@ The client is built around the concept of sources; a set of packages effectively
8484

8585
## Building the client
8686

87-
1. Clone the repository
88-
2. Configure your system, please use the [configuration file](.configurations/configuration.dsc.yaml). This can be applied by either:
89-
* [Dev Home](https://github.com/microsoft/devhome)'s machine configuration tool
90-
* WinGet configuration. Run `winget configure .configurations/configuration.dsc.yaml` from the project root so relative paths resolve correctly.
91-
3. Run `vcpkg integrate install` from the Developer Command Prompt for VS 2022. This is a one-time setup step until the configuration file in step 2 is updated to work with vcpkg setup.
92-
93-
### Prerequisites
94-
95-
* Windows 10 1809 (17763) or later
96-
* [Developer Mode enabled](https://docs.microsoft.com/windows/uwp/get-started/enable-your-device-for-development)
97-
* [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/)
98-
* Or use WinGet to install it ;) (although you may need to adjust the workloads via Tools->Get Tools and Features...)
99-
* The following workloads:
100-
* .NET Desktop Development
101-
* Desktop Development with C++
102-
* Universal Windows Platform Development
103-
* Check [.vsconfig file](.vsconfig) for full components list
104-
* [Windows SDK for Windows 11 (10.0.22000.194)](https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/)
105-
> [!NOTE]
106-
> You can also get it through `winget install Microsoft.WindowsSDK --version 10.0.22000.832` (use --force if you have a newer version installed) or via Visual Studio > Get Tools and Features > Individual Components > Windows 10 SDK (10.0.22000.0)
107-
* The following extensions:
108-
* [Microsoft Visual Studio Installer Projects](https://marketplace.visualstudio.com/items?itemName=VisualStudioClient.MicrosoftVisualStudio2022InstallerProjects)
109-
110-
### Building
111-
112-
Open `winget-cli\src\AppInstallerCLI.sln` in Visual Studio and build. We currently only build using the solution; command-line methods of building a VS solution should work as well. After the build finishes, deploy the solution from Build > Deploy Solution. You can then run the client from the command line using `wingetdev`.
87+
Please follow our [developer guidance](/doc/Developing.md) to build, run & test the client.
11388

11489
## Credit
11590

doc/Developing.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Developer guidance
2+
3+
## Prerequisites
4+
5+
* Windows 10 1809 (17763) or later
6+
* [Developer Mode enabled](https://docs.microsoft.com/windows/uwp/get-started/enable-your-device-for-development)
7+
* [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/)
8+
* Or use WinGet to install it ;) (although you may need to adjust the workloads via Tools->Get Tools and Features...)
9+
* The following workloads:
10+
* .NET Desktop Development
11+
* Desktop Development with C++
12+
* Universal Windows Platform Development
13+
* Check [.vsconfig file](.vsconfig) for full components list
14+
15+
* [Windows SDK for Windows 11 (10.0.22000.194)](https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/)
16+
17+
> [!NOTE]
18+
> You can also get it through `winget install Microsoft.WindowsSDK --version 10.0.22000.832` (use --force if you have a newer version installed) or via Visual Studio > Get Tools and Features > Individual Components > Windows 10 SDK (10.0.22000.0)
19+
20+
* The following extensions:
21+
22+
* [Microsoft Visual Studio Installer Projects](https://marketplace.visualstudio.com/items?itemName=VisualStudioClient.MicrosoftVisualStudio2022InstallerProjects)
23+
24+
## Building the client
25+
26+
1. Clone the repository
27+
2. Configure your system using the [configuration file](../.config/configuration.winget) in the repository. To run the configuration, use `winget configure .config/configuration.winget` from the project root so relative paths resolve correctly.
28+
3. Run `vcpkg integrate install` from the Developer Command Prompt / Developer PowerShell for VS 2022. This is a one-time setup step until the configuration file in step 2 is updated to work with vcpkg setup.
29+
30+
Open `winget-cli\src\AppInstallerCLI.sln` in Visual Studio and build. We currently only build using the solution; command-line methods of building a VS solution should work as well.
31+
32+
## Running and Debugging
33+
34+
After the build finishes, deploy the solution from Build > Deploy Solution. You can then run the client from the command line using `wingetdev`.
35+
36+
To enable step-through debugging, right click on `AppInstallerCLIPackage` in the Solution Explorer, select Properties, and navigate to the Debug tab. In the Debugger type selection, change "Application process" and "Background task process" to "Native Only". This will allow you to add breakpoints and step through the code. The main entry point for the client is in `src/AppInstallerCLI/main.cpp`
37+
38+
The best way to debug the client is to select `Do not launch, but debug my code when it starts` in the `Debug` tab and start the debugging session with <kbd>F5</kbd>. You can then use the `wingetdev` command in a terminal session, or any PowerShell code for COM API interaction, which will get picked up by the debugger.
39+
40+
## Running Unit Tests
41+
42+
The unit tests are located inside the `AppInstallerCLITests` project. When the solution is built, all tests are compiled under `src/<ARCHITECTURE>/<Debug|Release>/AppInstallerCLITests`. An executable `AppInstallerCLITests.exe` is generated in this directory to run the tests. Run `AppInstallerCLITests.exe` from the command line to execute the tests. To see all available options, run `AppInstallerCLITests.exe --help`.
43+
44+
> [!TIP]
45+
> If you just want to run a particular test, you can specify the test name as an argument to the executable. For example, `AppInstallerCLITests.exe EnsureSortedErrorList`.

0 commit comments

Comments
 (0)