Skip to content

Commit 7c3964f

Browse files
marc-hblgirdwood
authored andcommitted
Unit tests: running them on the host _is_ possible.
... and now even CI does it since thesofproject/sof#4543 Also mention run-cmocks.sh Signed-off-by: Marc Herbert <marc.herbert@intel.com>
1 parent 141195e commit 7c3964f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

developer_guides/unit_tests.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,17 @@ Additional unit tests options can be found in :ref:`cmake`.
5454
Compiling unit tests without a cross-compilation toolchain
5555
==========================================================
5656

57-
You can also compile the unit tests with your native compiler. You won't
58-
be able to _run_ the tests but this can be convenient to test
59-
compilation issues quickly:
57+
You can also compile and run unit tests with your native compiler:
6058

6159
.. code-block:: bash
6260
63-
cmake -B build_ut -DBUILD_UNIT_TESTS_HOST=yes -DTOOLCHAIN=gcc \
61+
rm -rf build_ut/
62+
cmake -B build_ut/ -DBUILD_UNIT_TESTS_HOST=yes \
6463
-DBUILD_UNIT_TESTS=ON -DINIT_CONFIG=something_defconfig
64+
make -C build_ut/ -j8 && make -C build_ut/ test
6565
66+
The ``scripts/run-cmocks.sh`` script does all that and can also run unit
67+
tests with valgrind.
6668

6769
Wrapping objects for unit tests
6870
*******************************

0 commit comments

Comments
 (0)