From 3144ccb68a30f8915024f5041f068d83de116104 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 5 Jul 2017 10:10:18 +0200 Subject: [PATCH] Fix building unit tests only when we build the testsuite --- ...ild-unit-tests-with-selftest-enabled.patch | 48 +++++++++++++++++++ samba.spec | 2 +- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 samba-4.7.0-waf-Only-build-unit-tests-with-selftest-enabled.patch diff --git a/samba-4.7.0-waf-Only-build-unit-tests-with-selftest-enabled.patch b/samba-4.7.0-waf-Only-build-unit-tests-with-selftest-enabled.patch new file mode 100644 index 0000000..53bf9e3 --- /dev/null +++ b/samba-4.7.0-waf-Only-build-unit-tests-with-selftest-enabled.patch @@ -0,0 +1,48 @@ +From 6f3f8ab2db58a4b1f3467d47c6c317c90fed9669 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Wed, 5 Jul 2017 10:08:49 +0200 +Subject: [PATCH] waf: Only build unit tests with selftest enabled + +Signed-off-by: Andreas Schneider +--- + wscript | 2 +- + wscript_build | 3 ++- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/wscript b/wscript +index 47d020b..e80f766 100644 +--- a/wscript ++++ b/wscript +@@ -195,6 +195,7 @@ def configure(conf): + if Options.options.with_ntvfs_fileserver == False: + if not (Options.options.without_ad_dc): + raise Utils.WafError('--without-ntvfs-fileserver conflicts with --enable-selftest while building the AD DC') ++ conf.RECURSE('testsuite/unittests') + + if Options.options.with_ntvfs_fileserver == True: + if Options.options.without_ad_dc: +@@ -214,7 +215,6 @@ def configure(conf): + if conf.env.with_ctdb: + conf.RECURSE('ctdb') + conf.RECURSE('lib/socket') +- conf.RECURSE('testsuite/unittests') + conf.RECURSE('auth') + + conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS() +diff --git a/wscript_build b/wscript_build +index 2ddcdcc..3c97ce1 100644 +--- a/wscript_build ++++ b/wscript_build +@@ -124,7 +124,8 @@ bld.RECURSE('libcli/samsync') + bld.RECURSE('libcli/registry') + bld.RECURSE('source4/lib/policy') + bld.RECURSE('libcli/named_pipe_auth') +-bld.RECURSE('testsuite/unittests') ++if conf.CONFIG_GET('ENABLE_SELFTEST'): ++ bld.RECURSE('testsuite/unittests') + + if bld.CONFIG_GET('KRB5_VENDOR') in (None, 'heimdal'): + if bld.CONFIG_GET("HEIMDAL_KRB5_CONFIG") and bld.CONFIG_GET("USING_SYSTEM_KRB5"): +-- +2.9.4 + diff --git a/samba.spec b/samba.spec index db45fce..53cbda5 100644 --- a/samba.spec +++ b/samba.spec @@ -117,6 +117,7 @@ Source200: README.dc Source201: README.downgrade Patch0: samba-4.7.0-unittests-Add-missing-stdint.h-include.patch +Patch1: samba-4.7.0-waf-Only-build-unit-tests-with-selftest-enabled.patch Requires(pre): /usr/sbin/groupadd Requires(post): systemd @@ -1811,7 +1812,6 @@ rm -rf %{buildroot} %{_libdir}/samba/libnss-wrapper.so %{_libdir}/samba/libsocket-wrapper.so %{_libdir}/samba/libuid-wrapper.so -%{_libdir}/samba/libcmocka-samba4.so %endif ### TEST-LIBS