Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,20 @@ 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)). 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
```
Comment on lines +100 to +104
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(optional) might be worth noting that you can also run the entire test suite without having to navigate to the folder with ctest --test-dir src/viam/sdk/tests/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also probably worth noting that there are many other interesting ctest options you can use too, to filter tests, or rerun only failures, etc. I don't think we should try to document those, but encouraging developers to expore ctest --help would only be a good thing.

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.

Expand Down