You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/pages/developer_guide.md
+21-9Lines changed: 21 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,12 +46,20 @@ This is useful when continuously running the integration tests during developmen
46
46
47
47
* The changes should be implemented in a feature branch of the developer's fork of svZeroDSolver.
48
48
* 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.
55
63
* Once all the tests are passing, the developer should open a pull request from the feature branch and link the relevant issue.
56
64
57
65
# Adding new blocks
@@ -66,7 +74,7 @@ Steps required to visualize a new block with svZeroDSolver Visualization applica
66
74
67
75
We follow the [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html).
68
76
69
-
## Formatting
77
+
## Formatting {#formatting}
70
78
71
79
We use [clang-format](https://clang.llvm.org/docs/ClangFormat.html) to automatically
72
80
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
78
86
-[vim](https://github.com/rhysd/vim-clang-format)
79
87
-[and many more](https://clang.llvm.org/docs/ClangFormat.html)
80
88
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
82
94
command **from your build folder** to format all your files:
83
95
84
96
```bash
@@ -105,7 +117,7 @@ requirements.
105
117
106
118
On Sherlock at Stanford, clang-format is included in the `llvm` module.
107
119
108
-
# Documentation
120
+
# Documentation {#documentation}
109
121
110
122
We use [Doxygen](https://doxygen.nl) to automatically build an html documentation
111
123
from source code. Please have at Doxygen's [Documentation Guide](https://www.doxygen.nl/manual/docblocks.html)
0 commit comments