diff --git a/source/headermap.txt b/source/headermap.txt index fbfc56e1274..bbd0d3c8662 100644 --- a/source/headermap.txt +++ b/source/headermap.txt @@ -44,7 +44,7 @@ rpc_server/common/common.h: dcerpc_server/common.h libcli/auth/credentials.h: domain_credentials.h lib/charset/charset.h: charset.h libcli/ldap/ldap.h: ldap.h -torture/torture.h: torture.h +lib/torture/torture.h: torture.h libcli/libcli.h: client.h librpc/gen_ndr/nbt.h: gen_ndr/nbt.h librpc/gen_ndr/svcctl.h: gen_ndr/svcctl.h @@ -60,7 +60,7 @@ lib/util/asn1.h: samba/asn1.h libcli/util/error.h: core/error.h lib/tdb_wrap.h: tdb_wrap.h lib/ldb_wrap.h: ldb_wrap.h -torture/ui.h: torture/ui.h +torture/smbtorture.h: smbtorture.h librpc/gen_ndr/winbind.h: gen_ndr/winbind.h param/share.h: share.h lib/util/util_tdb.h: util_tdb.h diff --git a/source/lib/basic.mk b/source/lib/basic.mk index 71acb944923..e7e0ba80c4c 100644 --- a/source/lib/basic.mk +++ b/source/lib/basic.mk @@ -16,6 +16,7 @@ mkinclude util/config.mk mkinclude tdr/config.mk mkinclude dbwrap/config.mk mkinclude crypto/config.mk +mkinclude torture/config.mk [SUBSYSTEM::LIBCOMPRESSION] diff --git a/source/lib/crypto/sha1test.c b/source/lib/crypto/sha1test.c index 0e943bd74d7..77777642771 100644 --- a/source/lib/crypto/sha1test.c +++ b/source/lib/crypto/sha1test.c @@ -17,7 +17,7 @@ */ #include "includes.h" -#include "torture/ui.h" +#include "torture/torture.h" #include "lib/crypto/crypto.h" diff --git a/source/lib/torture/config.mk b/source/lib/torture/config.mk new file mode 100644 index 00000000000..e981ee0c99b --- /dev/null +++ b/source/lib/torture/config.mk @@ -0,0 +1,11 @@ +# TORTURE subsystem +[LIBRARY::torture] +PUBLIC_DEPENDENCIES = \ + LIBSAMBA-HOSTCONFIG \ + LIBSAMBA-UTIL \ + LIBTALLOC + +PC_FILES += lib/torture/torture.pc +torture_OBJ_FILES = $(addprefix lib/torture/, torture.o) + +PUBLIC_HEADERS += lib/torture/torture.h diff --git a/source/torture/ui.c b/source/lib/torture/torture.c similarity index 99% rename from source/torture/ui.c rename to source/lib/torture/torture.c index abbd8147476..3f2c7848aa3 100644 --- a/source/torture/ui.c +++ b/source/lib/torture/torture.c @@ -19,7 +19,6 @@ */ #include "includes.h" -#include "torture/ui.h" #include "torture/torture.h" #include "lib/util/dlinklist.h" #include "param/param.h" diff --git a/source/torture/ui.h b/source/lib/torture/torture.h similarity index 100% rename from source/torture/ui.h rename to source/lib/torture/torture.h diff --git a/source/lib/util/tests/str.c b/source/lib/util/tests/str.c index a219ef0891d..3bd6a02fdc2 100644 --- a/source/lib/util/tests/str.c +++ b/source/lib/util/tests/str.c @@ -20,7 +20,7 @@ */ #include "includes.h" -#include "torture/ui.h" +#include "torture/torture.h" static bool test_string_sub_simple(struct torture_context *tctx) { diff --git a/source/torture/basic/base.c b/source/torture/basic/base.c index 966d436935b..2ab3f9ca916 100644 --- a/source/torture/basic/base.c +++ b/source/torture/basic/base.c @@ -19,7 +19,7 @@ */ #include "includes.h" -#include "torture/torture.h" +#include "torture/smbtorture.h" #include "torture/basic/proto.h" #include "libcli/libcli.h" #include "libcli/raw/raw_proto.h" diff --git a/source/torture/basic/locking.c b/source/torture/basic/locking.c index 2e2585b9766..3f399c97efd 100644 --- a/source/torture/basic/locking.c +++ b/source/torture/basic/locking.c @@ -23,9 +23,8 @@ #include "includes.h" #include "libcli/raw/libcliraw.h" #include "libcli/libcli.h" -#include "torture/ui.h" +#include "torture/smbtorture.h" #include "torture/util.h" -#include "torture/torture.h" #include "system/time.h" #include "system/filesys.h" diff --git a/source/torture/basic/misc.c b/source/torture/basic/misc.c index 188fc1bc69b..24e0324bc3e 100644 --- a/source/torture/basic/misc.c +++ b/source/torture/basic/misc.c @@ -30,7 +30,7 @@ #include "libcli/resolve/resolve.h" #include "auth/credentials/credentials.h" #include "librpc/gen_ndr/ndr_nbt.h" -#include "torture/torture.h" +#include "torture/smbtorture.h" #include "torture/util.h" #include "libcli/smb_composite/smb_composite.h" #include "libcli/composite/composite.h" diff --git a/source/torture/config.mk b/source/torture/config.mk index 1565797609d..4113cab0642 100644 --- a/source/torture/config.mk +++ b/source/torture/config.mk @@ -1,17 +1,3 @@ -# TORTURE subsystem -[LIBRARY::torture] -PRIVATE_PROTO_HEADER = proto.h -PUBLIC_DEPENDENCIES = \ - LIBSAMBA-HOSTCONFIG \ - LIBSAMBA-UTIL \ - LIBTALLOC \ - LIBPOPT - -PC_FILES += torture/torture.pc -torture_OBJ_FILES = $(addprefix torture/, torture.o ui.o) - -PUBLIC_HEADERS += torture/torture.h torture/ui.h - [SUBSYSTEM::TORTURE_UTIL] PRIVATE_DEPENDENCIES = LIBCLI_RAW LIBPYTHON smbcalls PROVISION PUBLIC_DEPENDENCIES = POPT_CREDENTIALS @@ -255,8 +241,9 @@ PRIVATE_DEPENDENCIES = \ # End BINARY smbtorture ################################# -smbtorture_OBJ_FILES = torture/smbtorture.o +smbtorture_OBJ_FILES = torture/smbtorture.o torture/torture.o +PUBLIC_HEADERS += torture/smbtorture.h MANPAGES += torture/man/smbtorture.1 ################################# @@ -340,9 +327,14 @@ gcov: test do $(GCOV) -p -o $$I $$I/*.c; \ done -lcov: test +samba.info: test -rm heimdal/lib/*/{lex,parse}.{gcda,gcno} lcov --base-directory `pwd` --directory . --capture --output-file samba.info - genhtml -o coverage samba.info + +lcov: samba.info + genhtml -o coverage $< testcov-html:: lcov + +clean:: + @rm -f samba.info diff --git a/source/torture/ldap/common.c b/source/torture/ldap/common.c index 5913163822a..2c11de729c2 100644 --- a/source/torture/ldap/common.c +++ b/source/torture/ldap/common.c @@ -22,7 +22,7 @@ #include "includes.h" #include "libcli/ldap/ldap_client.h" -#include "torture/torture.h" +#include "torture/smbtorture.h" #include "torture/ldap/proto.h" NTSTATUS torture_ldap_bind(struct ldap_connection *conn, const char *userdn, const char *password) diff --git a/source/torture/libnet/libnet.c b/source/torture/libnet/libnet.c index 3a75ffcae3e..8c8353e8d6b 100644 --- a/source/torture/libnet/libnet.c +++ b/source/torture/libnet/libnet.c @@ -18,7 +18,7 @@ */ #include "includes.h" -#include "torture/torture.h" +#include "torture/smbtorture.h" #include "librpc/rpc/dcerpc.h" #include "librpc/gen_ndr/security.h" #include "librpc/gen_ndr/lsa.h" diff --git a/source/torture/local/dbspeed.c b/source/torture/local/dbspeed.c index bf88c00e358..017c8568f4f 100644 --- a/source/torture/local/dbspeed.c +++ b/source/torture/local/dbspeed.c @@ -26,7 +26,7 @@ #include "lib/ldb/include/ldb_errors.h" #include "lib/ldb_wrap.h" #include "lib/tdb_wrap.h" -#include "torture/torture.h" +#include "torture/smbtorture.h" #include "param/param.h" float tdb_speed; diff --git a/source/torture/local/local.c b/source/torture/local/local.c index e4dfadd3d1c..1c3274adcda 100644 --- a/source/torture/local/local.c +++ b/source/torture/local/local.c @@ -18,7 +18,7 @@ */ #include "includes.h" -#include "torture/torture.h" +#include "torture/smbtorture.h" #include "torture/local/proto.h" #include "torture/ndr/ndr.h" #include "torture/ndr/proto.h" diff --git a/source/torture/nbench/nbench.c b/source/torture/nbench/nbench.c index e9bd32cce05..96144c47735 100644 --- a/source/torture/nbench/nbench.c +++ b/source/torture/nbench/nbench.c @@ -19,9 +19,8 @@ #include "includes.h" #include "libcli/libcli.h" -#include "torture/ui.h" #include "torture/util.h" -#include "torture/torture.h" +#include "torture/smbtorture.h" #include "system/filesys.h" #include "system/locale.h" #include "pstring.h" diff --git a/source/torture/nbt/nbt.c b/source/torture/nbt/nbt.c index d27a26eb30c..422261884f6 100644 --- a/source/torture/nbt/nbt.c +++ b/source/torture/nbt/nbt.c @@ -21,7 +21,7 @@ #include "libcli/nbt/libnbt.h" #include "torture/torture.h" #include "torture/nbt/proto.h" -#include "torture/ui.h" +#include "torture/smbtorture.h" #include "libcli/resolve/resolve.h" #include "param/param.h" diff --git a/source/torture/ndr/ndr.c b/source/torture/ndr/ndr.c index 55b00d1fb80..63636f8c5f7 100644 --- a/source/torture/ndr/ndr.c +++ b/source/torture/ndr/ndr.c @@ -21,7 +21,7 @@ #include "includes.h" #include "torture/ndr/ndr.h" #include "torture/ndr/proto.h" -#include "torture/ui.h" +#include "torture/torture.h" #include "util/dlinklist.h" #include "param/param.h" diff --git a/source/torture/rap/rap.c b/source/torture/rap/rap.c index 4b5f4b582c5..1ccd1254ddd 100644 --- a/source/torture/rap/rap.c +++ b/source/torture/rap/rap.c @@ -21,7 +21,7 @@ #include "includes.h" #include "libcli/libcli.h" -#include "torture/torture.h" +#include "torture/smbtorture.h" #include "torture/util.h" #include "libcli/rap/rap.h" #include "libcli/raw/libcliraw.h" diff --git a/source/torture/raw/lookuprate.c b/source/torture/raw/lookuprate.c index 0e8f002efb8..782cb1b31b7 100644 --- a/source/torture/raw/lookuprate.c +++ b/source/torture/raw/lookuprate.c @@ -20,7 +20,7 @@ #include "includes.h" #include "param/param.h" #include "system/filesys.h" -#include "torture/torture.h" +#include "torture/smbtorture.h" #include "torture/basic/proto.h" #include "libcli/libcli.h" #include "torture/util.h" diff --git a/source/torture/raw/raw.c b/source/torture/raw/raw.c index 262ed1384bf..c6133081b04 100644 --- a/source/torture/raw/raw.c +++ b/source/torture/raw/raw.c @@ -18,10 +18,10 @@ */ #include "includes.h" -#include "torture/torture.h" #include "libcli/raw/libcliraw.h" -#include "torture/raw/proto.h" #include "torture/util.h" +#include "torture/smbtorture.h" +#include "torture/raw/proto.h" NTSTATUS torture_raw_init(void) { diff --git a/source/torture/rpc/rpc.c b/source/torture/rpc/rpc.c index 7c8e78b160f..fdb88b13dcc 100644 --- a/source/torture/rpc/rpc.c +++ b/source/torture/rpc/rpc.c @@ -23,7 +23,7 @@ #include "lib/cmdline/popt_common.h" #include "librpc/rpc/dcerpc.h" #include "torture/rpc/rpc.h" -#include "torture/torture.h" +#include "torture/smbtorture.h" #include "librpc/ndr/ndr_table.h" #include "lib/util/dlinklist.h" diff --git a/source/torture/rpc/rpc.h b/source/torture/rpc/rpc.h index d0a07277877..48db814b7a3 100644 --- a/source/torture/rpc/rpc.h +++ b/source/torture/rpc/rpc.h @@ -28,7 +28,7 @@ #include "librpc/rpc/dcerpc.h" #include "libcli/raw/libcliraw.h" #include "torture/rpc/proto.h" -#include "torture/ui.h" +#include "torture/torture.h" struct torture_rpc_tcase { struct torture_tcase tcase; diff --git a/source/torture/rpc/spoolss_notify.c b/source/torture/rpc/spoolss_notify.c index 19cff53d847..ab6309d55f8 100644 --- a/source/torture/rpc/spoolss_notify.c +++ b/source/torture/rpc/spoolss_notify.c @@ -21,7 +21,6 @@ #include "includes.h" #include "torture/torture.h" -#include "torture/ui.h" #include "torture/rpc/rpc.h" #include "librpc/gen_ndr/ndr_spoolss_c.h" #include "rpc_server/dcerpc_server.h" diff --git a/source/torture/rpc/spoolss_win.c b/source/torture/rpc/spoolss_win.c index 9e2921d406b..9ce9fb75263 100644 --- a/source/torture/rpc/spoolss_win.c +++ b/source/torture/rpc/spoolss_win.c @@ -20,7 +20,6 @@ #include "includes.h" #include "torture/torture.h" -#include "torture/ui.h" #include "torture/rpc/rpc.h" #include "librpc/gen_ndr/ndr_spoolss_c.h" #include "rpc_server/dcerpc_server.h" diff --git a/source/torture/smb2/smb2.c b/source/torture/smb2/smb2.c index f406b7d6e82..37eadcf7fd5 100644 --- a/source/torture/smb2/smb2.c +++ b/source/torture/smb2/smb2.c @@ -21,7 +21,7 @@ #include "libcli/smb2/smb2.h" #include "libcli/smb2/smb2_calls.h" -#include "torture/torture.h" +#include "torture/smbtorture.h" #include "torture/smb2/proto.h" #include "lib/util/dlinklist.h" diff --git a/source/torture/smbtorture.c b/source/torture/smbtorture.c index 01a55a67f66..511f58cd7c0 100644 --- a/source/torture/smbtorture.c +++ b/source/torture/smbtorture.c @@ -30,7 +30,7 @@ #include "lib/events/events.h" #include "dynconfig.h" -#include "torture/torture.h" +#include "torture/smbtorture.h" #include "build.h" #include "lib/util/dlinklist.h" #include "librpc/rpc/dcerpc.h" diff --git a/source/torture/torture.h b/source/torture/smbtorture.h similarity index 91% rename from source/torture/torture.h rename to source/torture/smbtorture.h index 26ecdb567b4..3b5a573d83f 100644 --- a/source/torture/torture.h +++ b/source/torture/smbtorture.h @@ -18,10 +18,10 @@ along with this program. If not, see . */ -#ifndef __TORTURE_H__ -#define __TORTURE_H__ +#ifndef __SMBTORTURE_H__ +#define __SMBTORTURE_H__ -#include "torture/ui.h" +#include "torture/torture.h" struct smbcli_state; @@ -37,5 +37,4 @@ struct torture_test; int torture_init(void); bool torture_register_suite(struct torture_suite *suite); - -#endif /* __TORTURE_H__ */ +#endif /* __SMBTORTURE_H__ */ diff --git a/source/torture/unix/unix.c b/source/torture/unix/unix.c index 05ea27db026..661e3372700 100644 --- a/source/torture/unix/unix.c +++ b/source/torture/unix/unix.c @@ -18,7 +18,7 @@ */ #include "includes.h" -#include "torture/torture.h" +#include "torture/smbtorture.h" #include "torture/unix/proto.h" NTSTATUS torture_unix_init(void) diff --git a/source/torture/util.h b/source/torture/util.h index 1009fcf9f11..9dc948ade50 100644 --- a/source/torture/util.h +++ b/source/torture/util.h @@ -20,6 +20,11 @@ #ifndef _TORTURE_PROVISION_H_ #define _TORTURE_PROVISION_H_ +#include "torture/torture.h" + +struct smbcli_state; +struct smbcli_tree; + /** setup a directory ready for a test */ diff --git a/source/torture/util_smb.c b/source/torture/util_smb.c index c1a20094f38..938e7d6c038 100644 --- a/source/torture/util_smb.c +++ b/source/torture/util_smb.c @@ -28,7 +28,6 @@ #include "system/shmem.h" #include "system/wait.h" #include "system/time.h" -#include "torture/ui.h" #include "torture/torture.h" #include "util/dlinklist.h" #include "auth/credentials/credentials.h" diff --git a/source/torture/winbind/winbind.c b/source/torture/winbind/winbind.c index e2836023376..b12e92552ed 100644 --- a/source/torture/winbind/winbind.c +++ b/source/torture/winbind/winbind.c @@ -18,7 +18,7 @@ */ #include "includes.h" -#include "torture/torture.h" +#include "torture/smbtorture.h" #include "torture/winbind/proto.h" NTSTATUS torture_winbind_init(void)