projects/aports·blob master · refs

42 lines · 1.0 KiB

1From b50b584a2703394be08a2ad245b813b268a8e1ed Mon Sep 17 00:00:00 2001
2From: Philipp Zabel <[email protected]>
3Date: Sun, 4 Aug 2019 22:28:37 +0200
4Subject: [PATCH] meson: hook up unit tests
5
6Build the unit tests and hook them up to the ninja test target.
7---
8 meson.build | 24 ++++++++++++++++++++++++
9 1 file changed, 24 insertions(+)
10
11diff --git a/meson.build b/meson.build
12index 24198a4b..1e02bc10 100644
13--- a/meson.build
14+++ b/meson.build
15@@ -223,3 +223,27 @@ pkg.generate(
16 url: 'http://www.openhmd.net/',
17 )
18 install_headers('include/openhmd.h', subdir: 'openhmd')
19+
20+
21+#
22+# Unit tests
23+#
24+
25+unittests_sources = [
26+ 'src/omath.c',
27+ 'tests/unittests/highlevel.c',
28+ 'tests/unittests/main.c',
29+ 'tests/unittests/quat.c',
30+ 'tests/unittests/tests.h',
31+ 'tests/unittests/vec.c'
32+]
33+
34+unittests = executable(
35+ 'openhmd_unittests',
36+ unittests_sources,
37+ include_directories: include_directories('./include', './src'),
38+ link_with: [openhmd_lib],
39+ dependencies: [dep_libm, dep_threads]
40+)
41+
42+test('unittests', unittests)