Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / amd64 / lib / python2.4 / bsddb / test / test_all.py
CommitLineData
920dae64
AT
1"""Run all test cases.
2"""
3
4import sys
5import os
6import unittest
7
8verbose = 0
9if 'verbose' in sys.argv:
10 verbose = 1
11 sys.argv.remove('verbose')
12
13if 'silent' in sys.argv: # take care of old flag, just in case
14 verbose = 0
15 sys.argv.remove('silent')
16
17
18def print_versions():
19 try:
20 # For Pythons w/distutils pybsddb
21 from bsddb3 import db
22 except ImportError:
23 # For Python 2.3
24 from bsddb import db
25 print
26 print '-=' * 38
27 print db.DB_VERSION_STRING
28 print 'bsddb.db.version(): %s' % (db.version(), )
29 print 'bsddb.db.__version__: %s' % db.__version__
30 print 'bsddb.db.cvsid: %s' % db.cvsid
31 print 'python version: %s' % sys.version
32 print 'My pid: %s' % os.getpid()
33 print '-=' * 38
34
35
36class PrintInfoFakeTest(unittest.TestCase):
37 def testPrintVersions(self):
38 print_versions()
39
40
41# This little hack is for when this module is run as main and all the
42# other modules import it so they will still be able to get the right
43# verbose setting. It's confusing but it works.
44import test_all
45test_all.verbose = verbose
46
47
48def suite():
49 test_modules = [
50 'test_associate',
51 'test_basics',
52 'test_compat',
53 'test_dbobj',
54 'test_dbshelve',
55 'test_dbtables',
56 'test_env_close',
57 'test_get_none',
58 'test_join',
59 'test_lock',
60 'test_misc',
61 'test_queue',
62 'test_recno',
63 'test_thread',
64 ]
65
66 alltests = unittest.TestSuite()
67 for name in test_modules:
68 module = __import__(name)
69 alltests.addTest(module.test_suite())
70 return alltests
71
72
73def test_suite():
74 suite = unittest.TestSuite()
75 suite.addTest(unittest.makeSuite(PrintInfoFakeTest))
76 return suite
77
78
79if __name__ == '__main__':
80 print_versions()
81 unittest.main(defaultTest='suite')