From 677205f953d852e8f19009843a6f8fa9e4821bfb Mon Sep 17 00:00:00 2001 From: Gabe Gottlob Date: Fri, 30 May 2025 11:44:12 -0400 Subject: [PATCH 1/3] RSDK-7426: Make it more obvious how to run the tests for the C++ SDK --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index c4447a8fb..c8f5fca82 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,12 @@ to change without warning. In particular, using Boost.Log macros such as `BOOST_LOG_TRIVIAL` or `BOOST_LOG_SEV` is undefined behavior which will likely fail to output log messages. +## Running Tests +Tests for the SDK are located in `src/viam/sdk/tests`. The CMakeLists.txt file in that directory defines how to build them. When the SDK is built, the test executables are placed in the test folder within your specified build directory (e.g., `build`, if you followed the instructions in [`BUILDING.md`](https://github.com/viamrobotics/viam-cpp-sdk/blob/main/BUILDING.md)). To run the entire test suite at once, navigate to the `tests` folder in your build directory and run: +``` +ctest +``` + ## License Copyright 2022 Viam Inc. From 19fce5c3a5c7bee6dd97cb94efa9ba44bbe82fc6 Mon Sep 17 00:00:00 2001 From: Gabe Gottlob Date: Fri, 30 May 2025 11:53:54 -0400 Subject: [PATCH 2/3] RSDK-7426: Add forgotten line to test running instructions in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c8f5fca82..674cbaff4 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ to change without warning. In particular, using Boost.Log macros such as fail to output log messages. ## Running Tests -Tests for the SDK are located in `src/viam/sdk/tests`. The CMakeLists.txt file in that directory defines how to build them. When the SDK is built, the test executables are placed in the test folder within your specified build directory (e.g., `build`, if you followed the instructions in [`BUILDING.md`](https://github.com/viamrobotics/viam-cpp-sdk/blob/main/BUILDING.md)). To run the entire test suite at once, navigate to the `tests` folder in your build directory and run: +Tests for the SDK are located in `src/viam/sdk/tests`. The CMakeLists.txt file in that directory defines how to build them. When the SDK is built, the test executables are placed in the test folder within your specified build directory (e.g., `build`, if you followed the instructions in [`BUILDING.md`](https://github.com/viamrobotics/viam-cpp-sdk/blob/main/BUILDING.md)). The test executable files can be run individually. To run the entire test suite at once, navigate to the `tests` folder in your build directory and run: ``` ctest ``` From a160f11de7cada2ca2ad8fe39519a1fd6ea7572a Mon Sep 17 00:00:00 2001 From: Gabe Gottlob Date: Tue, 3 Jun 2025 10:21:32 -0400 Subject: [PATCH 3/3] Address comments --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 674cbaff4..5f0dcb3e2 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,14 @@ Tests for the SDK are located in `src/viam/sdk/tests`. The CMakeLists.txt file i ``` ctest ``` +Or to avoid navigating all the way to the folder you can specify the test directory, for example: +``` +ctest --test-dir build/src/viam/sdk/tests/ +``` +Additionally, for more useful ctest options explore: +``` +ctest --help +``` ## License Copyright 2022 Viam Inc.