unit tests
From: raphtee@google.com
git-svn-id: http://test.kernel.org/svn/autotest/trunk@1411 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/unittest_suite.py b/unittest_suite.py
new file mode 100644
index 0000000..f7fd69a
--- /dev/null
+++ b/unittest_suite.py
@@ -0,0 +1,52 @@
+#!/usr/bin/python2.4
+
+import os, sys
+import unittest
+
+# ensure the root is where it should be
+root = os.path.dirname(__file__)
+sys.path.append(root)
+
+
+suites = []
+def lister(dummy, dirname, files):
+ loader = unittest.TestLoader()
+ for f in files:
+ if f.endswith('_unittest.py'):
+ temp = os.path.join(dirname, f).strip('.py')
+ mod = temp[1:].replace('/', '.')
+ suite = loader.loadTestsFromName(mod)
+ suites.append(suite)
+
+
+if __name__ == "__main__":
+ os.path.walk(root, lister, None)
+ alltests = unittest.TestSuite(suites)
+ runner = unittest.TextTestRunner(verbosity=2)
+ runner.run(alltests)
+#!/usr/bin/python2.4
+
+import os, sys
+import unittest
+
+# ensure the root is where it should be
+root = os.path.dirname(__file__)
+sys.path.append(root)
+
+
+suites = []
+def lister(dummy, dirname, files):
+ loader = unittest.TestLoader()
+ for f in files:
+ if f.endswith('_unittest.py'):
+ temp = os.path.join(dirname, f).strip('.py')
+ mod = temp[1:].replace('/', '.')
+ suite = loader.loadTestsFromName(mod)
+ suites.append(suite)
+
+
+if __name__ == "__main__":
+ os.path.walk(root, lister, None)
+ alltests = unittest.TestSuite(suites)
+ runner = unittest.TextTestRunner(verbosity=2)
+ runner.run(alltests)