r21667 - gnucash/trunk/src - [Testing] Get the python tests working when uninstalled

John Ralls jralls at code.gnucash.org
Sun Dec 4 19:06:19 EST 2011


Author: jralls
Date: 2011-12-04 19:06:18 -0500 (Sun, 04 Dec 2011)
New Revision: 21667
Trac: http://svn.gnucash.org/trac/changeset/21667

Modified:
   gnucash/trunk/src/bin/overrides/gnucash-build-env.in
   gnucash/trunk/src/optional/python-bindings/Makefile.am
   gnucash/trunk/src/optional/python-bindings/tests/Makefile.am
   gnucash/trunk/src/optional/python-bindings/tests/test_account.py
   gnucash/trunk/src/optional/python-bindings/tests/test_business.py
Log:
[Testing] Get the python tests working when uninstalled


Also fix a couple of failing tests.

Modified: gnucash/trunk/src/bin/overrides/gnucash-build-env.in
===================================================================
--- gnucash/trunk/src/bin/overrides/gnucash-build-env.in	2011-12-04 20:44:24 UTC (rev 21666)
+++ gnucash/trunk/src/bin/overrides/gnucash-build-env.in	2011-12-05 00:06:18 UTC (rev 21667)
@@ -77,5 +77,14 @@
   --guile-load-dir ${top_builddir}/src/business/dialog-tax-table \
   --guile-load-dir ${top_builddir}/src/business/business-gnome \
   --guile-load-dir ${top_builddir}/src/business/business-reports \
+  --library-dir    ${top_builddir}/src/libqof/qof \
+  --library-dir    ${top_builddir}/src/core-utils \
+  --library-dir    ${top_builddir}/src/calculation \
+  --library-dir    ${top_builddir}/src/app-utils \
+  --library-dir    ${top_builddir}/src/gnome-utils \
+  --library-dir    ${top_builddir}/src/engine \
+  --library-dir    ${top_builddir}/src/backend/xml \
+  --library-dir    ${top_builddir}/src/backend/sql  \
+  --library-dir    ${top_builddir}/src/gnc-module
   `
 exec "$@"

Modified: gnucash/trunk/src/optional/python-bindings/Makefile.am
===================================================================
--- gnucash/trunk/src/optional/python-bindings/Makefile.am	2011-12-04 20:44:24 UTC (rev 21666)
+++ gnucash/trunk/src/optional/python-bindings/Makefile.am	2011-12-05 00:06:18 UTC (rev 21667)
@@ -104,3 +104,29 @@
 sqlite3test_LDADD = ${_gnucash_core_c_la_LIBADD}
 sqlite3test_CPPFLAGS = ${_gnucash_core_c_la_CPPFLAGS}
 
+PYTHON_LINK_FILES = \
+  $(pkgpython_PYTHON)
+
+.py-links:
+	$(RM) -rf gnucash
+	mkdir -p gnucash
+if GNUCASH_SEPARATE_BUILDDIR
+	for X in ${PYTHON_LINK_FILES} ; do \
+	  $(LN_S) -f ${srcdir}/$$X . ; \
+	done
+endif
+	( cd gnucash; for file in $(PYTHON_LINK_FILES) ; do \
+	  $(LN_S) -f ${top_srcdir}/src/optional/python-bindings/$$file .; \
+	  done )
+
+
+if ! OS_WIN32
+	touch .py-links
+endif
+
+noinst_DATA = .py-links
+
+CLEANFILES = $(BUILT_SOURCES) .py-links
+
+clean-local:
+	rm -rf gnucash

Modified: gnucash/trunk/src/optional/python-bindings/tests/Makefile.am
===================================================================
--- gnucash/trunk/src/optional/python-bindings/tests/Makefile.am	2011-12-04 20:44:24 UTC (rev 21666)
+++ gnucash/trunk/src/optional/python-bindings/tests/Makefile.am	2011-12-05 00:06:18 UTC (rev 21667)
@@ -1,4 +1,9 @@
-TESTS_ENVIRONMENT = PYTHONPATH=$(PYTHONPATH):$(pythondir) $(top_builddir)/src/bin/overrides/gnucash-build-env $(PYTHON)
+
+
+TESTS_ENVIRONMENT = \
+  PYTHONPATH=$(PYTHONPATH):$(top_builddir)/src/optional/python-bindings \
+  PYTHONPATH=$$PYTHONPATH:$(top_builddir)/src/optional/python-bindings/.libs \
+  $(top_builddir)/src/bin/overrides/gnucash-build-env $(PYTHON)
 TESTS = runTests.py
 
 clean-local:

Modified: gnucash/trunk/src/optional/python-bindings/tests/test_account.py
===================================================================
--- gnucash/trunk/src/optional/python-bindings/tests/test_account.py	2011-12-04 20:44:24 UTC (rev 21666)
+++ gnucash/trunk/src/optional/python-bindings/tests/test_account.py	2011-12-05 00:06:18 UTC (rev 21667)
@@ -19,7 +19,6 @@
     def test_split(self):
         SPLIT = Split(self.book)
         self.assertTrue(self.account.insert_split(SPLIT))
-        self.assertTrue(self.account.find_split(SPLIT))
         self.assertTrue(self.account.remove_split(SPLIT))
 
 if __name__ == '__main__':

Modified: gnucash/trunk/src/optional/python-bindings/tests/test_business.py
===================================================================
--- gnucash/trunk/src/optional/python-bindings/tests/test_business.py	2011-12-04 20:44:24 UTC (rev 21666)
+++ gnucash/trunk/src/optional/python-bindings/tests/test_business.py	2011-12-05 00:06:18 UTC (rev 21667)
@@ -51,9 +51,9 @@
 
     def test_employee_name(self):
         NAME = 'John Doe'
-        self.assertEqual( '', self.employee.GetName() )
-        self.employee.SetName(NAME)
-        self.assertEqual( NAME, self.employee.GetName() )
+        self.assertEqual( '', self.employee.GetUsername() )
+        self.employee.SetUsername(NAME)
+        self.assertEqual( NAME, self.employee.GetUsername() )
 
     def test_post(self):
         self.assertTrue( self.invoice.IsPosted() )



More information about the gnucash-changes mailing list