Added python tests.

This commit is contained in:
John Wiegley 2007-04-15 11:45:07 +00:00
parent fc6b8837ec
commit 205351c9f9
22 changed files with 34 additions and 23 deletions

View file

@ -143,14 +143,36 @@ if HAVE_BOOST_PYTHON
noinst_PROGRAMS = ledger.so
# jww (2007-04-14): This is not passing HAVE_EXPAT!
PYLIBS = pyledger ledger boost_python gmp pcre
if HAVE_EXPAT
PYLIBS += expat
endif
if HAVE_XMLPARSE
PYLIBS += xmlparse xmltok
endif
if HAVE_LIBOFX
PYLIBS += ofx
endif
if DEBUG
DEBUG_LEVEL = 4
else
DEBUG_LEVEL = 0
endif
ledger.so: pyledger.cc libledger.la libpyledger.la
CFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS) -L. -L.libs" \
CFLAGS="$(CPPFLAGS)" \
LDFLAGS="$(LDFLAGS) -L. -L.libs" \
PYLIBS="$(PYLIBS)" \
DEBUG_LEVEL="$(DEBUG_LEVEL)" \
python setup.py build --build-lib=.
install-exec-hook:
CFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS) -L. -L.libs" \
CFLAGS="$(CPPFLAGS)" \
LDFLAGS="$(LDFLAGS) -L. -L.libs" \
PYLIBS="$(PYLIBS)" \
DEBUG_LEVEL="$(DEBUG_LEVEL)" \
python setup.py install --prefix=$(prefix)
endif
@ -166,7 +188,7 @@ check_PROGRAMS = $(TESTS)
UnitTests_SOURCES = tests/UnitTests.cc \
\
tests/corelib/numerics/BasicAmountTestCase.cc
tests/corelib/numerics/BasicAmount.cc
UnitTests_LDADD = $(lib_LTLIBRARIES) -lcppunit
UnitTests_LDFLAGS = $(LIBADD_DL)
@ -185,8 +207,8 @@ if DEBUG
UnitTests_CXXFLAGS += -DDEBUG_LEVEL=4
endif
PyUnitTests:
python tests/python/UnitTests.py
PyUnitTests: PyUnitTests.py
cp PyUnitTests.py PyUnitTests
######################################################################

View file

@ -3,24 +3,13 @@
from distutils.core import setup, Extension
import os
import string
defines = [('PYTHON_MODULE', 1)]
if os.environ.has_key("DEBUG_LEVEL"):
defines.extend ([('DEBUG_LEVEL', os.environ["DEBUG_LEVEL"])])
defines.extend ([('DEBUG_LEVEL', 4)])
libs = ["pyledger", "ledger", "boost_python", "gmp", "pcre"]
if os.environ.has_key ("HAVE_EXPAT") and\
os.environ["HAVE_EXPAT"] == "true":
libs.extend (["expat"])
if os.environ.has_key ("HAVE_XMLPARSE") and\
os.environ["HAVE_XMLPARSE"] == "true":
libs.extend (["xmlparse", "xmltok"])
if os.environ.has_key ("HAVE_LIBOFX") and\
os.environ["HAVE_LIBOFX"] == "true":
libs.extend (["ofx"])
libs = os.environ["PYLIBS"].split()
setup(name = "Ledger",
version = "3.0",
@ -29,5 +18,5 @@ setup(name = "Ledger",
author_email = "johnw@newartisans.com",
url = "http://johnwiegley.com/",
ext_modules = [
Extension("ledger", ["pyledger.cc"],
define_macros = defines, libraries = libs)])
Extension("ledger", ["pyledger.cc"],
define_macros = defines, libraries = libs)])

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file