summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/main.mk3
-rwxr-xr-xsource4/script/tests/test_swig.sh19
-rw-r--r--source4/scripting/config.mk9
-rwxr-xr-xsource4/scripting/swig/torture/torture_tdb.py10
4 files changed, 37 insertions, 4 deletions
diff --git a/source4/main.mk b/source4/main.mk
index b1d001a2ae..6ae230488d 100644
--- a/source4/main.mk
+++ b/source4/main.mk
@@ -304,6 +304,9 @@ gdbtest-all: all
unused_macros:
./script/find_unused_macros.pl `find . -name "*.[ch]"` | sort
+swigtest: swig
+ ./script/tests/test_swig.sh
+
###############################################################################
# File types
###############################################################################
diff --git a/source4/script/tests/test_swig.sh b/source4/script/tests/test_swig.sh
new file mode 100755
index 0000000000..6b97ab4d33
--- /dev/null
+++ b/source4/script/tests/test_swig.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+if [ $# -ne 0 ]; then
+ cat <<EOF
+Usage: test_swig.sh
+EOF
+ exit 1;
+fi
+
+incdir=`dirname $0`
+. $incdir/test_functions.sh
+
+failed=0
+
+export PYTHONPATH=scripting/swig:$PYTHONPATh
+
+scripting/swig/torture/torture_tdb.py || failed=`expr $failed + 1`
+
+testok $0 $failed
diff --git a/source4/scripting/config.mk b/source4/scripting/config.mk
index c169680507..bbca5034eb 100644
--- a/source4/scripting/config.mk
+++ b/source4/scripting/config.mk
@@ -22,14 +22,15 @@ REQUIRED_SUBSYSTEMS = LIBCLI NDR_MISC LIBSAMBA-UTIL LIBSAMBA-CONFIG RPC_NDR_SAMR
#######################
# Swig extensions
-swig: scripting/swig/_tdb.so scripting/swig/_ldb.so scripting/swig/_dcerpc.so
+swig: scripting/swig/_tdb.so scripting/swig/_ldb.so
scripting/swig/tdb_wrap.c: scripting/swig/tdb.i
swig -python scripting/swig/tdb.i
-scripting/swig/_tdb.so: scripting/swig/tdb_wrap.o $(LIBRARY_swig_tdb_DEPEND_LIST)
- $(SHLD) $(SHLD_FLAGS) -o scripting/swig/_tdb.so scripting/swig/tdb_wrap.o \
- $(LIBRARY_swig_tdb_LINK_LIST) $(LIBRARY_swig_tdb_LINK_FLAGS)
+scripting/swig/_tdb.so: scripting/swig/tdb_wrap.o bin/subsystems/LIBRARY_LIBTDB.o
+ $(SHLD) $(SHLD_FLAGS) -o scripting/swig/_tdb.so \
+ scripting/swig/tdb_wrap.o \
+ bin/subsystems/LIBRARY_LIBTDB.o
scripting/swig/ldb_wrap.c: scripting/swig/ldb.i
swig -python scripting/swig/ldb.i
diff --git a/source4/scripting/swig/torture/torture_tdb.py b/source4/scripting/swig/torture/torture_tdb.py
new file mode 100755
index 0000000000..4c44096811
--- /dev/null
+++ b/source4/scripting/swig/torture/torture_tdb.py
@@ -0,0 +1,10 @@
+#!/usr/bin/python
+
+import sys, tdb
+from os import *
+
+t = tdb.open('foo.tdb', 0, 0, O_RDWR | O_CREAT, 0600)
+tdb.close(t)
+
+unlink('foo.tdb')
+