summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtest/PyUnitTests.py11
-rw-r--r--test/python/JournalTest.py25
-rw-r--r--test/python/PostingTest.py25
-rw-r--r--test/python/TransactionTest.py25
-rw-r--r--test/python/UnitTests.py12
-rw-r--r--tools/Makefile.am4
6 files changed, 98 insertions, 4 deletions
diff --git a/test/PyUnitTests.py b/test/PyUnitTests.py
index a77d99ad..2aed48b9 100755
--- a/test/PyUnitTests.py
+++ b/test/PyUnitTests.py
@@ -1,6 +1,13 @@
-#!/bin/sh
+#!/bin/bash
+
+set -e
+
+PYTHONPATH="%builddir%/.libs":$PYTHONPATH \
+LD_LIBRARY_PATH="%builddir%/.libs":$LD_LIBRARY_PATH \
+DYLD_LIBRARY_PATH="%builddir%/.libs":$DYLD_LIBRARY_PATH \
+ %python% "%builddir%"/test/python/ConvertedTests.py
PYTHONPATH="%builddir%/.libs":$PYTHONPATH \
LD_LIBRARY_PATH="%builddir%/.libs":$LD_LIBRARY_PATH \
DYLD_LIBRARY_PATH="%builddir%/.libs":$DYLD_LIBRARY_PATH \
- %python% "%builddir%"/test/python/UnitTests.py
+ %python% "%srcdir%"/test/python/UnitTests.py
diff --git a/test/python/JournalTest.py b/test/python/JournalTest.py
new file mode 100644
index 00000000..66447f87
--- /dev/null
+++ b/test/python/JournalTest.py
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+
+import unittest
+import exceptions
+import operator
+
+from ledger import *
+from StringIO import *
+from datetime import *
+
+class JournalTestCase(unittest.TestCase):
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def test_(self):
+ pass
+
+def suite():
+ return unittest.TestLoader().loadTestsFromTestCase(JournalTestCase)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/python/PostingTest.py b/test/python/PostingTest.py
new file mode 100644
index 00000000..f191253e
--- /dev/null
+++ b/test/python/PostingTest.py
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+
+import unittest
+import exceptions
+import operator
+
+from ledger import *
+from StringIO import *
+from datetime import *
+
+class PostingTestCase(unittest.TestCase):
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def test_(self):
+ pass
+
+def suite():
+ return unittest.TestLoader().loadTestsFromTestCase(PostingTestCase)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/python/TransactionTest.py b/test/python/TransactionTest.py
new file mode 100644
index 00000000..66447f87
--- /dev/null
+++ b/test/python/TransactionTest.py
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+
+import unittest
+import exceptions
+import operator
+
+from ledger import *
+from StringIO import *
+from datetime import *
+
+class JournalTestCase(unittest.TestCase):
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def test_(self):
+ pass
+
+def suite():
+ return unittest.TestLoader().loadTestsFromTestCase(JournalTestCase)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/python/UnitTests.py b/test/python/UnitTests.py
new file mode 100644
index 00000000..388e2229
--- /dev/null
+++ b/test/python/UnitTests.py
@@ -0,0 +1,12 @@
+from unittest import TextTestRunner, TestSuite
+
+import JournalTest
+import TransactionTest
+import PostingTest
+
+suites = [
+ JournalTest.suite(),
+ TransactionTest.suite(),
+ PostingTest.suite()
+]
+TextTestRunner().run(TestSuite(suites))
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 5bb41cc0..fe0681e5 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -321,7 +321,7 @@ all_py_tests_sources = \
test/python/%.py: test/unit/%.cc test/convert.py
$(PYTHON) $(srcdir)/test/convert.py $< $@
-test/python/UnitTests.py: $(all_py_tests_sources)
+test/python/ConvertedTests.py: $(all_py_tests_sources)
@echo "from unittest import TextTestRunner, TestSuite" > $@
@for file in $$(ls $(srcdir)/test/unit/*.cc); do \
base=$$(basename $$file); \
@@ -346,7 +346,7 @@ ESC_distdir=`echo "$(distdir)" | sed 's/\//\\\\\//g'`
# jww (2007-05-10): This rule will not be triggered on systems that
# define an EXEEXT.
-PyUnitTests: test/PyUnitTests.py test/python/UnitTests.py
+PyUnitTests: test/PyUnitTests.py test/python/ConvertedTests.py
@cat $(srcdir)/test/PyUnitTests.py \
| sed "s/%python%/$(ESC_python)/" \
| sed "s/%srcdir%/$(ESC_srcdir)/g" \