aboutsummaryrefslogtreecommitdiff
path: root/package/wayland/0001-configure-add-option-to-disable-tests.patch
blob: c6e4a49681f84d6a252560edfce6e99f961908ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
From 55ae8e1103f4697bfa01a84301a6560b89de5248 Mon Sep 17 00:00:00 2001
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
Date: Mon, 16 Apr 2018 19:52:34 +0300
Subject: [PATCH] configure: add option to disable tests

When building for a product, tests are not needed.

Besides, one test requires a C++ compiler, which is not always
available.

So, add an option to configure to disable building tests altogether.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Tested-by: Eric Engestrom <eric.engestrom@imgtec.com>

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

---
Changes v1 -> v2:
  - fix typo in yes-check  (Eric)
---
 Makefile.am  | 2 ++
 configure.ac | 8 ++++++++
 2 files changed, 10 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index 741db5ebf9d9..4862d42959f0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -160,6 +160,7 @@ pkgconfig_DATA += egl/wayland-egl.pc
 include_HEADERS += egl/wayland-egl-backend.h
 pkgconfig_DATA += egl/wayland-egl-backend.pc
 
+if ENABLE_TESTS
 built_test_programs =				\
 	array-test				\
 	client-test				\
@@ -287,6 +288,7 @@ os_wrappers_test_LDADD = libtest-runner.la
 
 exec_fd_leak_checker_SOURCES = tests/exec-fd-leak-checker.c
 exec_fd_leak_checker_LDADD = libtest-runner.la
+endif
 
 EXTRA_DIST += tests/scanner-test.sh			\
 	protocol/tests.xml				\
diff --git a/configure.ac b/configure.ac
index c74ee97b24a2..5c94b7b76b06 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,10 +89,18 @@ AC_ARG_ENABLE([dtd-validation],
 	      [],
 	      [enable_dtd_validation=yes])
 
+AC_ARG_ENABLE([tests],
+	      [AC_HELP_STRING([--disable-tests],
+			      [Disable compilation of test programs])],
+	      [],
+	      [enable_tests=yes])
+
 AM_CONDITIONAL(USE_HOST_SCANNER, test "x$with_host_scanner" = xyes)
 
 AM_CONDITIONAL(ENABLE_LIBRARIES, test "x$enable_libraries" = xyes)
 
+AM_CONDITIONAL(ENABLE_TESTS, test "x$enable_tests" = xyes)
+
 AC_ARG_WITH(icondir, [  --with-icondir=<dir>    Look for cursor icons here],
 		     [  ICONDIR=$withval],
 		     [  ICONDIR=${datadir}/icons])
-- 
2.14.3