summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2019-05-06 10:23:49 +1200
committerGary Lockyer <gary@samba.org>2019-05-06 05:46:11 +0000
commit6cc68c1ccf7683543e2735844210627d39556e34 (patch)
tree4da87485113de4295a53bc1f130570bd17231539 /lib
parent169290896684d52b9d63cb17c0b90a3d63dd9b8d (diff)
downloadsamba-6cc68c1ccf7683543e2735844210627d39556e34.tar.gz
replace: Fix "make test" to actually test libreplace
Found by Joe Guo during preperation for automated code coverage output. In order to allow the Makefile wrapper to work we need to rename the test directory to tests. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Diffstat (limited to 'lib')
-rw-r--r--lib/replace/tests/getifaddrs.c (renamed from lib/replace/test/getifaddrs.c)0
-rw-r--r--lib/replace/tests/incoherent_mmap.c (renamed from lib/replace/test/incoherent_mmap.c)0
-rw-r--r--lib/replace/tests/main.c (renamed from lib/replace/test/main.c)0
-rw-r--r--lib/replace/tests/os2_delete.c (renamed from lib/replace/test/os2_delete.c)0
-rw-r--r--lib/replace/tests/shared_mmap.c (renamed from lib/replace/test/shared_mmap.c)0
-rw-r--r--lib/replace/tests/shared_mremap.c (renamed from lib/replace/test/shared_mremap.c)0
-rw-r--r--lib/replace/tests/snprintf.c (renamed from lib/replace/test/snprintf.c)0
-rw-r--r--lib/replace/tests/strptime.c (renamed from lib/replace/test/strptime.c)0
-rw-r--r--lib/replace/tests/testsuite.c (renamed from lib/replace/test/testsuite.c)0
-rw-r--r--lib/replace/wscript36
10 files changed, 27 insertions, 9 deletions
diff --git a/lib/replace/test/getifaddrs.c b/lib/replace/tests/getifaddrs.c
index 8d575aff37a..8d575aff37a 100644
--- a/lib/replace/test/getifaddrs.c
+++ b/lib/replace/tests/getifaddrs.c
diff --git a/lib/replace/test/incoherent_mmap.c b/lib/replace/tests/incoherent_mmap.c
index ee288fd8061..ee288fd8061 100644
--- a/lib/replace/test/incoherent_mmap.c
+++ b/lib/replace/tests/incoherent_mmap.c
diff --git a/lib/replace/test/main.c b/lib/replace/tests/main.c
index 94264d73672..94264d73672 100644
--- a/lib/replace/test/main.c
+++ b/lib/replace/tests/main.c
diff --git a/lib/replace/test/os2_delete.c b/lib/replace/tests/os2_delete.c
index 4b99ccf9103..4b99ccf9103 100644
--- a/lib/replace/test/os2_delete.c
+++ b/lib/replace/tests/os2_delete.c
diff --git a/lib/replace/test/shared_mmap.c b/lib/replace/tests/shared_mmap.c
index 9d6e3fc95aa..9d6e3fc95aa 100644
--- a/lib/replace/test/shared_mmap.c
+++ b/lib/replace/tests/shared_mmap.c
diff --git a/lib/replace/test/shared_mremap.c b/lib/replace/tests/shared_mremap.c
index 08040e2e595..08040e2e595 100644
--- a/lib/replace/test/shared_mremap.c
+++ b/lib/replace/tests/shared_mremap.c
diff --git a/lib/replace/test/snprintf.c b/lib/replace/tests/snprintf.c
index 77473f067b2..77473f067b2 100644
--- a/lib/replace/test/snprintf.c
+++ b/lib/replace/tests/snprintf.c
diff --git a/lib/replace/test/strptime.c b/lib/replace/tests/strptime.c
index 5bf03f5b353..5bf03f5b353 100644
--- a/lib/replace/test/strptime.c
+++ b/lib/replace/tests/strptime.c
diff --git a/lib/replace/test/testsuite.c b/lib/replace/tests/testsuite.c
index dba545e27a2..dba545e27a2 100644
--- a/lib/replace/test/testsuite.c
+++ b/lib/replace/tests/testsuite.c
diff --git a/lib/replace/wscript b/lib/replace/wscript
index 29a8d56c318..d442792433d 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -632,7 +632,7 @@ def configure(conf):
conf.CHECK_FUNCS('strptime')
conf.CHECK_DECLS('strptime', headers='time.h')
conf.CHECK_CODE('''#define LIBREPLACE_CONFIGURE_TEST_STRPTIME
- #include "test/strptime.c"''',
+ #include "tests/strptime.c"''',
define='HAVE_WORKING_STRPTIME',
execute=True,
addmain=False,
@@ -647,25 +647,25 @@ def configure(conf):
define='HAVE_GETTIMEOFDAY_TZ_VOID',
headers='sys/time.h')
- conf.CHECK_CODE('#include "test/snprintf.c"',
+ conf.CHECK_CODE('#include "tests/snprintf.c"',
define="HAVE_C99_VSNPRINTF",
execute=True,
addmain=False,
msg="Checking for C99 vsnprintf")
- conf.CHECK_CODE('#include "test/shared_mmap.c"',
+ conf.CHECK_CODE('#include "tests/shared_mmap.c"',
addmain=False, add_headers=False, execute=True,
define='HAVE_SHARED_MMAP',
msg="Checking for HAVE_SHARED_MMAP")
- conf.CHECK_CODE('#include "test/shared_mremap.c"',
+ conf.CHECK_CODE('#include "tests/shared_mremap.c"',
addmain=False, add_headers=False, execute=True,
define='HAVE_MREMAP',
msg="Checking for HAVE_MREMAP")
# OpenBSD (and I've heard HPUX) doesn't sync between mmap and write.
# FIXME: Anything other than a 0 or 1 exit code should abort configure!
- conf.CHECK_CODE('#include "test/incoherent_mmap.c"',
+ conf.CHECK_CODE('#include "tests/incoherent_mmap.c"',
addmain=False, add_headers=False, execute=True,
define='HAVE_INCOHERENT_MMAP',
msg="Checking for HAVE_INCOHERENT_MMAP")
@@ -763,7 +763,7 @@ def configure(conf):
#include "snprintf.c"
#include "getifaddrs.c"
#define getifaddrs_test main
- #include "test/getifaddrs.c"
+ #include "tests/getifaddrs.c"
''' % method,
method,
lib='nsl socket' + bsd_for_strlcpy,
@@ -861,13 +861,13 @@ def build(bld):
if bld.CONFIG_SET('HAVE_WNO_FORMAT_TRUNCATION'):
replace_test_cflags += " -Wno-format-truncation"
bld.SAMBA_SUBSYSTEM('replace-test',
- source='''test/testsuite.c test/strptime.c
- test/os2_delete.c test/getifaddrs.c''',
+ source='''tests/testsuite.c tests/strptime.c
+ tests/os2_delete.c tests/getifaddrs.c''',
deps='replace',
cflags=replace_test_cflags)
bld.SAMBA_BINARY('replace_testsuite',
- source='test/main.c',
+ source='tests/main.c',
deps='replace replace-test',
install=False)
@@ -885,6 +885,24 @@ def build(bld):
bld.SAMBA_SUBSYSTEM('samba_intl', source='', use_global_deps=False,deps=bld.env.intl_libs)
+def testonly(ctx):
+ '''run talloc testsuite'''
+ import samba_utils
+
+ samba_utils.ADD_LD_LIBRARY_PATH('bin/shared')
+ samba_utils.ADD_LD_LIBRARY_PATH('bin/shared/private')
+
+ cmd = os.path.join(Context.g_module.out, 'replace_testsuite')
+ ret = samba_utils.RUN_COMMAND(cmd)
+ print("testsuite returned %d" % ret)
+ sys.exit(ret)
+
+# WAF doesn't build the unit tests for this, maybe because they don't link with talloc?
+# This forces it
+def test(ctx):
+ Options.commands.append('build')
+ Options.commands.append('testonly')
+
def dist():
'''makes a tarball for distribution'''
samba_dist.dist()