svn commit: samba r17679 - in branches/SAMBA_4_0/source/lib/ldb: . tests tools

tridge at samba.org tridge at samba.org
Tue Aug 22 01:32:30 GMT 2006


Author: tridge
Date: 2006-08-22 01:32:29 +0000 (Tue, 22 Aug 2006)
New Revision: 17679

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=17679

Log:

- fix 'make test-ldap' to skip ldb specials

- allow ldb to be built in a separate build directory, using:

     /some/path/to/ldb/configure
     make

  this will make it much easier to put ldb in the build farm without
  interfering with the build farm builds of tdb and talloc

Modified:
   branches/SAMBA_4_0/source/lib/ldb/Makefile.in
   branches/SAMBA_4_0/source/lib/ldb/configure.in
   branches/SAMBA_4_0/source/lib/ldb/tests/init_slapd.sh
   branches/SAMBA_4_0/source/lib/ldb/tests/start_slapd.sh
   branches/SAMBA_4_0/source/lib/ldb/tests/test-generic.sh
   branches/SAMBA_4_0/source/lib/ldb/tests/test-ldap.sh
   branches/SAMBA_4_0/source/lib/ldb/tests/test-tdb.sh
   branches/SAMBA_4_0/source/lib/ldb/tools/ldbtest.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/Makefile.in
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/Makefile.in	2006-08-22 01:13:45 UTC (rev 17678)
+++ branches/SAMBA_4_0/source/lib/ldb/Makefile.in	2006-08-22 01:32:29 UTC (rev 17679)
@@ -8,6 +8,9 @@
 libdir = @libdir@
 bindir = @bindir@
 mandir = @mandir@
+VPATH = @srcdir@:@srcdir@/..
+srcdir = @srcdir@
+builddir = @builddir@
 WITH_GCOV = @WITH_GCOV@
 WITH_LDAP = @WITH_LDAP@
 WITH_SQLITE3 = @WITH_SQLITE3@
@@ -16,22 +19,19 @@
 OPENLDAP_PREFIX=/usr
 LDAP_LIBS=-L$(OPENLDAP_PREFIX)/lib -llber -lldap
 LDAP_FLAGS=-DHAVE_LDAP=1
-LDB_LDAP_OBJ=ldb_ldap/ldb_ldap.o
+LDB_LDAP_OBJ=$(srcdir)/ldb_ldap/ldb_ldap.o
 endif
 
 ifeq ($(WITH_SQLITE3),yes)
 SQLITE3_PREFIX=/usr
 SQLITE3_LIBS=-L$(SQLITE3_PREFIX)/lib -lsqlite3
 SQLITE3_FLAGS=-DHAVE_SQLITE3=1
-LDB_SQLITE3_OBJ=ldb_sqlite3/ldb_sqlite3.o
+LDB_SQLITE3_OBJ=$(srcdir)/ldb_sqlite3/ldb_sqlite3.o
 endif
 
-TDBDIR=../tdb
-TALLOCDIR=../talloc
-
 CFLAGS1=-Wall -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith \
-       -Wcast-qual -Wcast-align -Wwrite-strings -g -Iinclude -I. -I.. \
-       -I$(TDBDIR)/include -I$(TALLOCDIR) -DUSE_MMAP=1 $(LDAP_FLAGS)
+       -Wcast-qual -Wcast-align -Wwrite-strings -g -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/.. \
+       -I$(srcdir)/../tdb/include -I$(srcdir)/../tdb -I$(srcdir)/../talloc -DUSE_MMAP=1 $(LDAP_FLAGS)
 
 # enable the following two lines to build with gcov code coverage support
 ifeq ($(WITH_GCOV),1)
@@ -43,26 +43,32 @@
 
 LIB_FLAGS=-Llib -lldb $(LDAP_LIBS) $(SQLITE3_LIBS) $(GCOV_LIBS) @LIBS@
 
+TDBDIR=tdb
 TDB_OBJ=$(TDBDIR)/common/tdb.o $(TDBDIR)/common/dump.o \
 	$(TDBDIR)/common/io.o $(TDBDIR)/common/lock.o \
 	$(TDBDIR)/common/open.o $(TDBDIR)/common/traverse.o \
 	$(TDBDIR)/common/freelist.o $(TDBDIR)/common/error.o \
 	$(TDBDIR)/common/transaction.o 
+
+TALLOCDIR=talloc
 TALLOC_OBJ=$(TALLOCDIR)/talloc.o
 
-LDB_TDB_OBJ=ldb_tdb/ldb_tdb.o \
-	ldb_tdb/ldb_pack.o ldb_tdb/ldb_search.o ldb_tdb/ldb_index.o \
-	ldb_tdb/ldb_cache.o ldb_tdb/ldb_tdb_wrap.o
+LDB_TDB_DIR=ldb_tdb
+LDB_TDB_OBJ=$(LDB_TDB_DIR)/ldb_tdb.o \
+	$(LDB_TDB_DIR)/ldb_pack.o $(LDB_TDB_DIR)/ldb_search.o $(LDB_TDB_DIR)/ldb_index.o \
+	$(LDB_TDB_DIR)/ldb_cache.o $(LDB_TDB_DIR)/ldb_tdb_wrap.o
 
-COMMON_OBJ=common/ldb.o common/ldb_ldif.o \
-	   common/ldb_parse.o common/ldb_msg.o common/ldb_utf8.o \
-	   common/ldb_debug.o common/ldb_modules.o \
-	   common/ldb_dn.o common/ldb_match.o common/ldb_attributes.o \
-	   common/attrib_handlers.o common/ldb_controls.o common/qsort.o
+COMDIR=common
+COMMON_OBJ=$(COMDIR)/ldb.o $(COMDIR)/ldb_ldif.o \
+	   $(COMDIR)/ldb_parse.o $(COMDIR)/ldb_msg.o $(COMDIR)/ldb_utf8.o \
+	   $(COMDIR)/ldb_debug.o $(COMDIR)/ldb_modules.o \
+	   $(COMDIR)/ldb_dn.o $(COMDIR)/ldb_match.o $(COMDIR)/ldb_attributes.o \
+	   $(COMDIR)/attrib_handlers.o $(COMDIR)/ldb_controls.o $(COMDIR)/qsort.o
 
-MODULES_OBJ=modules/operational.o modules/schema.o modules/rdn_name.o \
-	   modules/objectclass.o \
-	   modules/paged_results.o modules/sort.o modules/asq.o
+MODDIR=modules
+MODULES_OBJ=$(MODDIR)/operational.o $(MODDIR)/schema.o $(MODDIR)/rdn_name.o \
+	   $(MODDIR)/objectclass.o \
+	   $(MODDIR)/paged_results.o $(MODDIR)/sort.o $(MODDIR)/asq.o
 
 OBJS =  $(MODULES_OBJ) $(COMMON_OBJ) $(LDB_TDB_OBJ) $(TDB_OBJ) $(TALLOC_OBJ) $(LDB_LDAP_OBJ) $(LDB_SQLITE3_OBJ)
 
@@ -72,24 +78,22 @@
 
 LIBS = $(LDB_LIB)($(OBJS))
 
-DIRS = lib bin
-
 MANPAGES = $(patsubst %.xml,%,$(wildcard man/*.xml))
 
 EXAMPLES = examples/ldbreader examples/ldifreader
 
-all: $(DIRS) $(BINS) $(LIBS) $(EXAMPLES) $(MANPAGES) doxygen
+DIRS = lib bin common ldb_tdb ldb_ldap ldb_sqlite3 modules tools examples tdb talloc
 
+all: dirs $(BINS) $(LIBS) $(EXAMPLES) $(MANPAGES) doxygen
+
 .c.o:
 	@echo Compiling $*.c
+	@mkdir -p `dirname $@`
 	@$(CC) $(CFLAGS) -c $< -o $@
 
-lib:
-	mkdir -p lib
+dirs: $(DIRS)
+	mkdir -p $(DIRS)
 
-bin:
-	mkdir -p bin
-
 lib/libldb.a: $(OBJS)
 
 bin/ldbadd: tools/ldbadd.o tools/cmdline.o $(LIBS)
@@ -157,12 +161,12 @@
 
 test-tdb: $(BINS)
 	@echo "STARTING TDB BACKEND TEST"
-	tests/test-tdb.sh
+	$(srcdir)/tests/test-tdb.sh
 
 ifeq ($(WITH_LDAP),yes)
 test-ldap:
 	@echo "STARTING LDAP BACKEND TEST"
-	tests/test-ldap.sh
+	$(srcdir)/tests/test-ldap.sh
 else
 test-ldap:
 	@echo "SKIP LDAP TEST - NO LDAP SUPPORT"
@@ -171,7 +175,7 @@
 ifeq ($(WITH_SQLITE3),yes)
 test-sqlite3:
 	@echo "STARTING SQLITE3 BACKEND TEST"
-	tests/test-sqlite3.sh
+	$(srcdir)/tests/test-sqlite3.sh
 else
 test-sqlite3:
 	@echo "SKIP SQLITE3 TEST - NO SQLITE3 SUPPORT"
@@ -180,7 +184,7 @@
 ifeq (1,0)
 test-schema:
 	@echo "STARTING SCHEMA MODULE TEST"
-	tests/test-schema.sh
+	$(srcdir)/tests/test-schema.sh
 else
 test-schema:
 	@echo "SKIPPING SCHEMA MODULE TEST"
@@ -198,12 +202,12 @@
 	cp $(filter %.3, $(MANPAGES)) $(mandir)/man3
 
 gcov:
-	$(GCOV) -po ldb_sqlite3 ldb_sqlite3/*.c 2| tee ldb_sqlite3.report.gcov
-	$(GCOV) -po ldb_ldap ldb_ldap/*.c 2| tee ldb_ldap.report.gcov
-	$(GCOV) -po ldb_tdb ldb_tdb/*.c 2| tee ldb_tdb.report.gcov
-	$(GCOV) -po common common/*.c 2| tee common.report.gcov
-	$(GCOV) -po modules modules/*.c 2| tee modules.report.gcov
-	$(GCOV) -po tools tools/*.c 2| tee tools.report.gcov
+	$(GCOV) -po ldb_sqlite3 $(srcdir)/ldb_sqlite3/*.c 2| tee ldb_sqlite3.report.gcov
+	$(GCOV) -po ldb_ldap $(srcdir)/ldb_ldap/*.c 2| tee ldb_ldap.report.gcov
+	$(GCOV) -po ldb_tdb $(srcdir)/ldb_tdb/*.c 2| tee ldb_tdb.report.gcov
+	$(GCOV) -po common $(srcdir)/common/*.c 2| tee common.report.gcov
+	$(GCOV) -po modules $(srcdir)/modules/*.c 2| tee modules.report.gcov
+	$(GCOV) -po tools $(srcdir)/tools/*.c 2| tee tools.report.gcov
 
 ctags:
 	ctags `find $(srcdir) -name "*.[ch]"`

Modified: branches/SAMBA_4_0/source/lib/ldb/configure.in
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/configure.in	2006-08-22 01:13:45 UTC (rev 17678)
+++ branches/SAMBA_4_0/source/lib/ldb/configure.in	2006-08-22 01:32:29 UTC (rev 17679)
@@ -12,6 +12,7 @@
 AC_DEFUN([SMB_EXT_LIB], [echo -n ""])
 AC_DEFUN([SMB_ENABLE], [echo -n ""])
 AC_INIT(include/ldb.h)
+AC_CONFIG_SRCDIR([common/ldb.c])
 WITH_GCOV=0
 AC_ARG_ENABLE(gcov,
 	AS_HELP_STRING([--enable-gcov],[enable GCOV code coverage tests]),

Modified: branches/SAMBA_4_0/source/lib/ldb/tests/init_slapd.sh
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/tests/init_slapd.sh	2006-08-22 01:13:45 UTC (rev 17678)
+++ branches/SAMBA_4_0/source/lib/ldb/tests/init_slapd.sh	2006-08-22 01:32:29 UTC (rev 17679)
@@ -1,5 +1,10 @@
 #!/bin/sh 
 
+if [ -z "$LDBDIR" ]; then
+    LDBDIR=`dirname $0`/..
+    export LDBDIR
+fi
+
 rm -rf tests/tmp/db
 mkdir -p tests/tmp/db
 
@@ -10,4 +15,4 @@
 if pidof slapd > /dev/null; then
     killall -9 slapd
 fi
-slapadd -f tests/slapd.conf < tests/init.ldif || exit 1
+slapadd -f $LDBDIR/tests/slapd.conf < $LDBDIR/tests/init.ldif || exit 1

Modified: branches/SAMBA_4_0/source/lib/ldb/tests/start_slapd.sh
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/tests/start_slapd.sh	2006-08-22 01:13:45 UTC (rev 17678)
+++ branches/SAMBA_4_0/source/lib/ldb/tests/start_slapd.sh	2006-08-22 01:32:29 UTC (rev 17679)
@@ -1,7 +1,12 @@
 #!/bin/sh
 
-mkdir -p tests/tmp/db
+if [ -z "$LDBDIR" ]; then
+    LDBDIR=`dirname $0`/..
+    export LDBDIR
+fi
 
-slapd -f tests/slapd.conf -h "`tests/ldapi_url.sh`" $*
+mkdir -p $LDBDIR/tests/tmp/db
 
+slapd -f $LDBDIR/tests/slapd.conf -h "`$LDBDIR/tests/ldapi_url.sh`" $*
+
 sleep 2

Modified: branches/SAMBA_4_0/source/lib/ldb/tests/test-generic.sh
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/tests/test-generic.sh	2006-08-22 01:13:45 UTC (rev 17678)
+++ branches/SAMBA_4_0/source/lib/ldb/tests/test-generic.sh	2006-08-22 01:32:29 UTC (rev 17679)
@@ -1,5 +1,9 @@
 #!/bin/sh
 
+if [ -z "$LDB_SPECIALS" ]; then
+    export LDB_SPECIALS=1
+fi
+
 echo "LDB_URL: $LDB_URL"
 
 echo "Adding base elements"
@@ -22,8 +26,10 @@
 echo "Starting ldbtest"
 time $VALGRIND ldbtest --num-records 100 --num-searches 10  || exit 1
 
-echo "Adding index"
-$VALGRIND ldbadd $LDBDIR/tests/test-index.ldif  || exit 1
+if [ $LDB_SPECIALS = 1 ]; then
+ echo "Adding index"
+ $VALGRIND ldbadd $LDBDIR/tests/test-index.ldif  || exit 1
+fi
 
 echo "Adding attributes"
 $VALGRIND ldbadd $LDBDIR/tests/test-wrong_attributes.ldif  || exit 1

Modified: branches/SAMBA_4_0/source/lib/ldb/tests/test-ldap.sh
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/tests/test-ldap.sh	2006-08-22 01:13:45 UTC (rev 17678)
+++ branches/SAMBA_4_0/source/lib/ldb/tests/test-ldap.sh	2006-08-22 01:32:29 UTC (rev 17679)
@@ -24,17 +24,18 @@
     fi
 done
 
-export LDB_URL=`tests/ldapi_url.sh`
+if [ -z "$LDBDIR" ]; then
+    LDBDIR=`dirname $0`/..
+    export LDBDIR
+fi
 
+export LDB_URL=`$LDBDIR/tests/ldapi_url.sh`
+
 PATH=bin:$PATH
 export PATH
 
-if [ -z "$LDBDIR" ]; then
-    LDBDIR="."
-    export LDBDIR
-fi
-
 . $LDBDIR/tests/init_slapd.sh
 . $LDBDIR/tests/start_slapd.sh
 
+export LDB_SPECIALS=0
 . $LDBDIR/tests/test-generic.sh

Modified: branches/SAMBA_4_0/source/lib/ldb/tests/test-tdb.sh
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/tests/test-tdb.sh	2006-08-22 01:13:45 UTC (rev 17678)
+++ branches/SAMBA_4_0/source/lib/ldb/tests/test-tdb.sh	2006-08-22 01:32:29 UTC (rev 17679)
@@ -13,7 +13,7 @@
 rm -f $LDB_URL*
 
 if [ -z "$LDBDIR" ]; then
-    LDBDIR="."
+    LDBDIR=`dirname $0`/..
     export LDBDIR
 fi
 

Modified: branches/SAMBA_4_0/source/lib/ldb/tools/ldbtest.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/tools/ldbtest.c	2006-08-22 01:13:45 UTC (rev 17678)
+++ branches/SAMBA_4_0/source/lib/ldb/tools/ldbtest.c	2006-08-22 01:32:29 UTC (rev 17679)
@@ -291,7 +291,14 @@
 	struct ldb_dn *basedn;
 	int ret;
 	int flags = 0;
+	const char *specials;
 
+	specials = getenv("LDB_SPECIALS");
+	if (specials && atoi(specials) == 0) {
+		printf("LDB_SPECIALS disabled - skipping index test\n");
+		return;
+	}
+
 	if (options->nosync) {
 		flags |= LDB_FLG_NOSYNC;
 	}



More information about the samba-cvs mailing list