summaryrefslogtreecommitdiff
path: root/lib/audit_logging
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2018-06-01 06:42:24 +1200
committerAndrew Bartlett <abartlet@samba.org>2018-06-01 08:28:26 +0200
commit0f5f8f1312ee8c52d0a21f5435d92cc8543ef934 (patch)
treec5ba9bb6dda19eb68ed865af6189a54255c77fb5 /lib/audit_logging
parent48ad90d93be8d863ce4c1be7cab6f1d60ed61257 (diff)
downloadsamba-0f5f8f1312ee8c52d0a21f5435d92cc8543ef934.tar.gz
lib/audit_logging: Remove #ifdef HAVE_JANSSON from audit_logging_test binary
Instead, we either build or do not build the entire binary. This is much more likely to raise an error in make test if the build system changes. The concern is that HAVE_JANSSON can go away and the tests just vanish. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Diffstat (limited to 'lib/audit_logging')
-rw-r--r--lib/audit_logging/tests/audit_logging_test.c4
-rw-r--r--lib/audit_logging/wscript_build27
2 files changed, 14 insertions, 17 deletions
diff --git a/lib/audit_logging/tests/audit_logging_test.c b/lib/audit_logging/tests/audit_logging_test.c
index 56e8fbcd43e..6be71f31dbe 100644
--- a/lib/audit_logging/tests/audit_logging_test.c
+++ b/lib/audit_logging/tests/audit_logging_test.c
@@ -59,7 +59,6 @@
#include "lib/audit_logging/audit_logging.h"
-#ifdef HAVE_JANSSON
static void test_json_add_int(void **state)
{
struct json_object object;
@@ -490,7 +489,6 @@ static void test_json_to_string(void **state)
json_free(&object);
TALLOC_FREE(ctx);
}
-#endif
static void test_json_get_array(void **state)
{
@@ -671,7 +669,6 @@ static void test_audit_get_timestamp(void **state)
int main(int argc, const char **argv)
{
const struct CMUnitTest tests[] = {
-#ifdef HAVE_JANSSON
cmocka_unit_test(test_json_add_int),
cmocka_unit_test(test_json_add_bool),
cmocka_unit_test(test_json_add_string),
@@ -686,7 +683,6 @@ int main(int argc, const char **argv)
cmocka_unit_test(test_json_to_string),
cmocka_unit_test(test_json_get_array),
cmocka_unit_test(test_json_get_object),
-#endif
cmocka_unit_test(test_audit_get_timestamp),
};
diff --git a/lib/audit_logging/wscript_build b/lib/audit_logging/wscript_build
index 4022d9031f6..fff683788d6 100644
--- a/lib/audit_logging/wscript_build
+++ b/lib/audit_logging/wscript_build
@@ -9,16 +9,17 @@ bld.SAMBA_SUBSYSTEM(
source='audit_logging.c'
)
-bld.SAMBA_BINARY(
- 'audit_logging_test',
- source='tests/audit_logging_test.c',
- deps='''
- audit_logging
- jansson
- cmocka
- talloc
- samba-util
- LIBTSOCKET
- ''',
- install=False
-)
+if bld.CONFIG_SET('ENABLE_SELFTEST'):
+ bld.SAMBA_BINARY(
+ 'audit_logging_test',
+ source='tests/audit_logging_test.c',
+ deps='''
+ audit_logging
+ jansson
+ cmocka
+ talloc
+ samba-util
+ LIBTSOCKET
+ ''',
+ install=False
+ )