mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[Testing] Get the python tests working when uninstalled
Also fix a couple of failing tests. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21667 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -77,5 +77,14 @@ eval `@-GNC_SRCDIR-@/src/gnc-test-env \
|
||||
--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 "$@"
|
||||
|
||||
@@ -104,3 +104,29 @@ sqlite3test_SOURCES = sqlite3test.c
|
||||
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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -19,7 +19,6 @@ class TestAccount( AccountSession ):
|
||||
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__':
|
||||
|
||||
@@ -51,9 +51,9 @@ class TestBusiness( BusinessSession ):
|
||||
|
||||
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() )
|
||||
|
||||
Reference in New Issue
Block a user