Skip to content

Commit 74f2d4c

Browse files
authored
Update developer guide documentation (#194)
1 parent 0a06dd2 commit 74f2d4c

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

docs/pages/developer_guide.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,20 @@ This is useful when continuously running the integration tests during developmen
4646

4747
* The changes should be implemented in a feature branch of the developer's fork of svZeroDSolver.
4848
* Once the changes are implemented, the developer should make sure the build, documentation, and code format tests are passing on the user's feature branch.
49-
* The tests are automatically run when pushing changes to the developer's remote branch on Github.
50-
* Alternatively, the developer can run the tests locally.
51-
* The build tests can be run using the `pip` install and `pytest`.
52-
* The tests for the C++ interface require the `CMake` install and can be run by building the tests in `svZeroDSolver/tests/test_interface`.
53-
* Code formatting can be performed following the instructions in the Formatting section below.
54-
* The documentation can be built following the instructions in the Documentation section below.
49+
50+
# Testing code changes
51+
* Tests are automatically run as Github workflows when pushing changes to the developer's remote branch on Github. These tests are defined in the `.github/workflows` directory.
52+
* It may be helpful and more efficient to run the build tests locally with each incremental change the developer makes. This can be done by following these steps:
53+
1. If you do not have `pytest` installed in your virtual environment, install it with `pip install pytest`
54+
2. We first need to build the svZeroDSolver project. This can be done by running `pip install -e .` from the svZeroDSolver directory
55+
3. From the main svZeroDSolver directory, `cd tests`.
56+
4. Now that you are in the `tests` directory, run `pytest`. The terminal output will show which tests are passing.
57+
* To run a specific subset of tests matching a certain pattern, e.g., only the calibrator, you can use `pytest -k calibrator`.
58+
* To see all simulation output, run `pytest -sv`.
59+
* If you want to run the tests using the binaries in the `Release` directory instead of the python module, you can call `pytest --coverage`
60+
* The tests for the C++ interface require the `CMake` install and can be run by building the tests in `svZeroDSolver/tests/test_interface`.
61+
* Code formatting can be performed following the instructions in the [Formatting](#formatting) section.
62+
* The documentation can be built following the instructions in the [Documentation](#documentation) section.
5563
* Once all the tests are passing, the developer should open a pull request from the feature branch and link the relevant issue.
5664

5765
# Adding new blocks
@@ -66,7 +74,7 @@ Steps required to visualize a new block with svZeroDSolver Visualization applica
6674

6775
We follow the [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html).
6876

69-
## Formatting
77+
## Formatting {#formatting}
7078

7179
We use [clang-format](https://clang.llvm.org/docs/ClangFormat.html) to automatically
7280
format our code accoring to the [Google Style](https://google.github.io/styleguide/cppguide.html),
@@ -78,7 +86,11 @@ There are tools for your favorite IDE to automatically format your code. Example
7886
- [vim](https://github.com/rhysd/vim-clang-format)
7987
- [and many more](https://clang.llvm.org/docs/ClangFormat.html)
8088

81-
Before committing any changes, you can run the following
89+
Before formatting the code with clang-format, ensure that you have latest clang-format version by running `clang-format --version`. To upgrade `clang-format` use the following commands
90+
* on MacOS: `brew upgrade clang-format`
91+
* on Ubuntu: `sudo apt upgrade clang-format`
92+
93+
Before committing any changes, run the following
8294
command **from your build folder** to format all your files:
8395

8496
```bash
@@ -105,7 +117,7 @@ requirements.
105117

106118
On Sherlock at Stanford, clang-format is included in the `llvm` module.
107119

108-
# Documentation
120+
# Documentation {#documentation}
109121

110122
We use [Doxygen](https://doxygen.nl) to automatically build an html documentation
111123
from source code. Please have at Doxygen's [Documentation Guide](https://www.doxygen.nl/manual/docblocks.html)

0 commit comments

Comments
 (0)