[Freeipa-devel] [PATCH] add test target to makefiles

Kevin McCarthy kmccarth at redhat.com
Tue Sep 4 17:23:54 UTC 2007


Adding test target to top-level makefiles and makefiles in direct
subdirs (hook up deeper ones as you need them).

Hooked up the ipa-python unit test to run from the Makefile.

-Kevin
-------------- next part --------------
# HG changeset patch
# User Kevin McCarthy <kmccarth at redhat.com>
# Date 1188926565 25200
# Node ID cd1400b2d848ae6a83ccce9679bd6ec034218d93
# Parent  b8e9c44915550cf7d6e935acb804e11e94fea015
Add 'test' target to makefiles.  Hook up ipautil tests to run.

diff -r b8e9c4491555 -r cd1400b2d848 Makefile
--- a/Makefile	Fri Aug 31 10:59:26 2007 -0700
+++ b/Makefile	Tue Sep 04 10:22:45 2007 -0700
@@ -59,6 +59,11 @@ clean:
 		(cd $$subdir && $(MAKE) $@) || exit 1; \
 	done
 	rm -f *~
+
+test:
+	@for subdir in $(SUBDIRS); do \
+		(cd $$subdir && $(MAKE) $@) || exit 1; \
+	done
 
 version-update:
 	sed s/VERSION/$(SERV_VERSION)/ ipa-server/freeipa-server.spec.in \
diff -r b8e9c4491555 -r cd1400b2d848 ipa-admintools/Makefile
--- a/ipa-admintools/Makefile	Fri Aug 31 10:59:26 2007 -0700
+++ b/ipa-admintools/Makefile	Tue Sep 04 10:22:45 2007 -0700
@@ -10,3 +10,5 @@ install:
 
 clean:
 	rm -f *~ *.pyc
+
+test:
diff -r b8e9c4491555 -r cd1400b2d848 ipa-client/Makefile
--- a/ipa-client/Makefile	Fri Aug 31 10:59:26 2007 -0700
+++ b/ipa-client/Makefile	Tue Sep 04 10:22:45 2007 -0700
@@ -21,3 +21,5 @@ clean:
 	done
 	rm -f *~
 	rm -f ipaclient/*~
+
+test:
diff -r b8e9c4491555 -r cd1400b2d848 ipa-python/Makefile
--- a/ipa-python/Makefile	Fri Aug 31 10:59:26 2007 -0700
+++ b/ipa-python/Makefile	Tue Sep 04 10:22:45 2007 -0700
@@ -1,6 +1,7 @@ PYTHONLIBDIR ?= $(shell  python -c "from
 PYTHONLIBDIR ?= $(shell  python -c "from distutils.sysconfig import *; print get_python_lib()")
 PACKAGEDIR ?= $(DESTDIR)/$(PYTHONLIBDIR)/ipa
 CONFIGDIR ?= $(DESTDIR)/etc/ipa
+TESTS = $(wildcard test/*.py)
 
 all: ;
 
@@ -15,3 +16,10 @@ clean:
 clean:
 	rm -f *~ *.pyc
 
+.PHONY: test
+test: $(subst .py,.tst,$(TESTS))
+
+%.tst: %.py
+	python $<
+
+
diff -r b8e9c4491555 -r cd1400b2d848 ipa-python/test/test_ipautil.py
--- a/ipa-python/test/test_ipautil.py	Fri Aug 31 10:59:26 2007 -0700
+++ b/ipa-python/test/test_ipautil.py	Tue Sep 04 10:22:45 2007 -0700
@@ -17,12 +17,17 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
 
+import sys
+sys.path.insert(0, ".")
+
 import unittest
-import ipa.ipautil
+
+import ipautil
+
 
 class TestCIDict(unittest.TestCase):
     def setUp(self):
-        self.cidict = ipa.ipautil.CIDict()
+        self.cidict = ipautil.CIDict()
         self.cidict["Key1"] = "val1"
         self.cidict["key2"] = "val2"
         self.cidict["KEY3"] = "VAL3"
diff -r b8e9c4491555 -r cd1400b2d848 ipa-server/Makefile
--- a/ipa-server/Makefile	Fri Aug 31 10:59:26 2007 -0700
+++ b/ipa-server/Makefile	Tue Sep 04 10:22:45 2007 -0700
@@ -21,3 +21,5 @@ clean:
 	done
 	rm -f *~
 	rm -f ipaserver/*~
+
+test:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 2228 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20070904/0a823c6f/attachment.bin>


More information about the Freeipa-devel mailing list