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: README.md
+30
Original file line number
Diff line number
Diff line change
@@ -120,6 +120,36 @@ gazebo worlds/iris.world
120
120
121
121
Please refer to the documentation of the particular flight stack how to run it against this framework, e.g. [PX4](http://dev.px4.io/simulation-gazebo.html)
122
122
123
+
124
+
## Unit Tests
125
+
126
+
For building and running test an installation of 'googletest' is needed. On Ubuntu it can be installed with:
127
+
128
+
```bash
129
+
sudo apt-get install libgtest-dev
130
+
cd /usr/src/googletest
131
+
sudo cmake .&&cd googletest
132
+
sudo make
133
+
sudo cp *.a /usr/lib
134
+
```
135
+
136
+
Building the tests on an other platform than Linux is not yet supported.
137
+
138
+
For building the tests, the flag `ENABLE_UNIT_TESTS` needs to be provided to cmake.
139
+
140
+
```bash
141
+
mkdir build &&cd build
142
+
cmake -DENABLE_UNIT_TESTS=On ..
143
+
```
144
+
145
+
Then build and run the tests:
146
+
147
+
```bash
148
+
make && make test
149
+
```
150
+
151
+
When writing test it’s important to be careful which API functions of Gazebo are called. As no Gazebo server is running during the tests some functions can produce undefined behaviour (e.g. segfaults).
0 commit comments