[cig-commits] r6443 - in short/3D/PyLith/trunk: . unittests/pytests
unittests/pytests/utils
brad at geodynamics.org
brad at geodynamics.org
Tue Mar 27 15:07:18 PDT 2007
Author: brad
Date: 2007-03-27 15:07:17 -0700 (Tue, 27 Mar 2007)
New Revision: 6443
Added:
short/3D/PyLith/trunk/unittests/pytests/utils/
short/3D/PyLith/trunk/unittests/pytests/utils/Makefile.am
short/3D/PyLith/trunk/unittests/pytests/utils/TestPetscManager.py
short/3D/PyLith/trunk/unittests/pytests/utils/testdriver.py
Modified:
short/3D/PyLith/trunk/TODO
short/3D/PyLith/trunk/configure.ac
short/3D/PyLith/trunk/unittests/pytests/Makefile.am
Log:
Added simple unit test (not thorough) for PetscManager.
Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO 2007-03-27 21:16:44 UTC (rev 6442)
+++ short/3D/PyLith/trunk/TODO 2007-03-27 22:07:17 UTC (rev 6443)
@@ -2,10 +2,6 @@
MAIN PRIORITIES (Brad)
======================================================================
-Unit tests:
- petsc module
- ParameterManager
-
1. Finish implementing ExplicitElasticity
a. C++
b. Python object
Modified: short/3D/PyLith/trunk/configure.ac
===================================================================
--- short/3D/PyLith/trunk/configure.ac 2007-03-27 21:16:44 UTC (rev 6442)
+++ short/3D/PyLith/trunk/configure.ac 2007-03-27 22:07:17 UTC (rev 6443)
@@ -168,6 +168,7 @@
unittests/pytests/materials/data/Makefile
unittests/pytests/meshio/Makefile
unittests/pytests/meshio/data/Makefile
+ unittests/pytests/utils/Makefile
doc/Makefile])
AC_OUTPUT
Modified: short/3D/PyLith/trunk/unittests/pytests/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/Makefile.am 2007-03-27 21:16:44 UTC (rev 6442)
+++ short/3D/PyLith/trunk/unittests/pytests/Makefile.am 2007-03-27 22:07:17 UTC (rev 6443)
@@ -12,6 +12,8 @@
SUBDIRS = \
feassemble \
- meshio
+ materials \
+ meshio \
+ utils
# End of file
Added: short/3D/PyLith/trunk/unittests/pytests/utils/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/utils/Makefile.am 2007-03-27 21:16:44 UTC (rev 6442)
+++ short/3D/PyLith/trunk/unittests/pytests/utils/Makefile.am 2007-03-27 22:07:17 UTC (rev 6443)
@@ -0,0 +1,24 @@
+# -*- Makefile -*-
+#
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard
+# U.S. Geological Survey
+#
+# <LicenseText>
+#
+# ----------------------------------------------------------------------
+#
+
+subpackage = utils
+include $(top_srcdir)/subpackage.am
+
+TESTS = testdriver.py
+
+check_SCRIPTS = testdriver.py
+
+noinst_PYTHON = \
+ TestPetscManager.py
+
+
+# End of file
Added: short/3D/PyLith/trunk/unittests/pytests/utils/TestPetscManager.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/utils/TestPetscManager.py 2007-03-27 21:16:44 UTC (rev 6442)
+++ short/3D/PyLith/trunk/unittests/pytests/utils/TestPetscManager.py 2007-03-27 22:07:17 UTC (rev 6443)
@@ -0,0 +1,37 @@
+#!/usr/bin/env python
+#
+# ======================================================================
+#
+# Brad T. Aagaard
+# U.S. Geological Survey
+#
+# {LicenseText}
+#
+# ======================================================================
+#
+
+## @file unittests/pytests/utils/TestPescManager.py
+
+## @brief Unit testing of PetscManager object.
+
+import unittest
+
+# ----------------------------------------------------------------------
+class TestPetscManager(unittest.TestCase):
+ """
+ Unit testing of PetscManager object.
+ """
+
+
+ def test_initfinal(self):
+ """
+ Test initialize/finalize.
+ """
+ from pylith.utils.PetscManager import PetscManager
+ manager = PetscManager()
+ manager.initialize()
+ manager.finalize()
+ return
+
+
+# End of file
Added: short/3D/PyLith/trunk/unittests/pytests/utils/testdriver.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/utils/testdriver.py 2007-03-27 21:16:44 UTC (rev 6442)
+++ short/3D/PyLith/trunk/unittests/pytests/utils/testdriver.py 2007-03-27 22:07:17 UTC (rev 6443)
@@ -0,0 +1,65 @@
+#!/usr/bin/env python
+#
+# ======================================================================
+#
+# Brad T. Aagaard
+# U.S. Geological Survey
+#
+# {LicenseText}
+#
+# ======================================================================
+#
+
+## @file unittests/utils/testdriver.py
+
+## @brief Python application for testing meshio code.
+
+from pyre.applications.Script import Script
+
+import unittest
+
+class TestApp(Script):
+ """
+ Test application.
+ """
+
+ # PUBLIC METHODS /////////////////////////////////////////////////////
+
+ def __init__(self, name="testapp"):
+ """
+ Constructor.
+ """
+ Script.__init__(self, name)
+ return
+
+
+ def main(self):
+ """
+ Run the application.
+ """
+ unittest.TextTestRunner(verbosity=2).run(self._suite())
+ return
+
+
+ # PRIVATE METHODS ////////////////////////////////////////////////////
+
+ def _suite(self):
+ """
+ Setup the test suite.
+ """
+
+ suite = unittest.TestSuite()
+
+ from TestPetscManager import TestPetscManager
+ suite.addTest(unittest.makeSuite(TestPetscManager))
+
+ return suite
+
+
+# ----------------------------------------------------------------------
+if __name__ == '__main__':
+ app = TestApp()
+ app.run()
+
+
+# End of file
Property changes on: short/3D/PyLith/trunk/unittests/pytests/utils/testdriver.py
___________________________________________________________________
Name: svn:executable
+ *
More information about the cig-commits
mailing list