Add python tests.
authorJelmer Vernooij <jelmer@samba.org>
Sat, 28 Feb 2009 18:09:34 +0000 (19:09 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 28 Feb 2009 18:09:34 +0000 (19:09 +0100)
.gitignore
Makefile
config.mk.in
python/tests/__init__.py [new file with mode: 0644]

index 0a3013c120667900701fada213e3e31a8993293e..c1abad34a323ad65c950a087a7797ba89762628c 100644 (file)
@@ -14,3 +14,5 @@ config.status
 lex.yy.c
 lex.h
 policy.so
+_trial_temp
+*.pyc
index 9b7a3590ddd3da3ead0863319d78be28f2606916..814229c9d03118b15c5ca72b0c7152c26adaa971 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -35,9 +35,12 @@ distclean::
        rm -rf autom4te.cache/
        rm -f config.h
 
-python: policy.$(SHLIBEXT)
+python:: python/policy.$(SHLIBEXT)
 
-policy.$(SHLIBEXT): pypolicy.o
+check-python:: python
+       PYTHONPATH=python $(TRIAL) python/tests
+
+python/policy.$(SHLIBEXT): pypolicy.o
        $(CC) -shared -o $@ $^ `$(PYTHON_CONFIG) --libs`
 
 pypolicy.o: CFLAGS+=`$(PYTHON_CONFIG) --cflags` -fPIC
index 47d167c098cb11fa9a5b358c6e9f1d1e91b0143a..6438c4e718931d08f320fa6e502e4007b343f5e8 100644 (file)
@@ -1,3 +1,4 @@
+TRIAL=trial
 PYTHON_CONFIG=@PYTHON_CONFIG@
 SHLIBEXT=so
 CC=@CC@
diff --git a/python/tests/__init__.py b/python/tests/__init__.py
new file mode 100644 (file)
index 0000000..563e8fd
--- /dev/null
@@ -0,0 +1 @@
+import policy