Added python tests.
This commit is contained in:
parent
fc6b8837ec
commit
205351c9f9
22 changed files with 34 additions and 23 deletions
34
Makefile.am
34
Makefile.am
|
|
@ -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
|
||||
|
||||
######################################################################
|
||||
|
||||
|
|
|
|||
23
setup.py
23
setup.py
|
|
@ -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)])
|
||||
|
|
|
|||
0
tests/python/baseline/__init__.py
Normal file
0
tests/python/baseline/__init__.py
Normal file
0
tests/python/cases/__init__.py
Normal file
0
tests/python/cases/__init__.py
Normal file
0
tests/python/corelib/balances/__init__.py
Normal file
0
tests/python/corelib/balances/__init__.py
Normal file
0
tests/python/corelib/values/__init__.py
Normal file
0
tests/python/corelib/values/__init__.py
Normal file
0
tests/python/driver/__init__.py
Normal file
0
tests/python/driver/__init__.py
Normal file
0
tests/python/journal/__init__.py
Normal file
0
tests/python/journal/__init__.py
Normal file
0
tests/python/parsers/__init__.py
Normal file
0
tests/python/parsers/__init__.py
Normal file
0
tests/python/parsers/binary/__init__.py
Normal file
0
tests/python/parsers/binary/__init__.py
Normal file
0
tests/python/parsers/gnucash/__init__.py
Normal file
0
tests/python/parsers/gnucash/__init__.py
Normal file
0
tests/python/parsers/ofx/__init__.py
Normal file
0
tests/python/parsers/ofx/__init__.py
Normal file
0
tests/python/parsers/qif/__init__.py
Normal file
0
tests/python/parsers/qif/__init__.py
Normal file
0
tests/python/parsers/textual/__init__.py
Normal file
0
tests/python/parsers/textual/__init__.py
Normal file
0
tests/python/python/__init__.py
Normal file
0
tests/python/python/__init__.py
Normal file
0
tests/python/reports/__init__.py
Normal file
0
tests/python/reports/__init__.py
Normal file
0
tests/python/reports/balance/__init__.py
Normal file
0
tests/python/reports/balance/__init__.py
Normal file
0
tests/python/reports/emacs/__init__.py
Normal file
0
tests/python/reports/emacs/__init__.py
Normal file
0
tests/python/reports/equity/__init__.py
Normal file
0
tests/python/reports/equity/__init__.py
Normal file
0
tests/python/reports/print/__init__.py
Normal file
0
tests/python/reports/print/__init__.py
Normal file
0
tests/python/reports/register/__init__.py
Normal file
0
tests/python/reports/register/__init__.py
Normal file
0
tests/python/transforms/__init__.py
Normal file
0
tests/python/transforms/__init__.py
Normal file
Loading…
Add table
Reference in a new issue