blob: a42238de1bee708acc98b2b4cf87c1c656d41d41 [file] [log] [blame]
Martin v. Löwis1c6b1a22002-11-19 17:47:07 +00001# Test driver for bsddb package.
2"""
3Run all test cases.
4"""
5
6import sys
7import unittest
8from test.test_support import requires, verbose, run_suite
9requires('bsddb')
10
11verbose = 0
12if 'verbose' in sys.argv:
13 verbose = 1
14 sys.argv.remove('verbose')
15
16if 'silent' in sys.argv: # take care of old flag, just in case
17 verbose = 0
18 sys.argv.remove('silent')
19
20
21def suite():
22 test_modules = [ 'test_compat',
23 'test_basics',
24 'test_misc',
25 'test_dbobj',
26 'test_recno',
27 'test_queue',
28 'test_get_none',
29 'test_dbshelve',
30 'test_dbtables',
31 'test_thread',
32 'test_lock',
33 'test_associate',
34 ]
35
36 alltests = unittest.TestSuite()
37 for name in test_modules:
38 module = __import__("bsddb.test."+name, globals(), locals(), name)
39 print module,name
40 alltests.addTest(module.suite())
41 return alltests
42
43# For invocation through regrtest
44def test_main():
45 tests = suite()
46 run_suite(tests)
47
48# For invocation as a script
49if __name__ == '__main__':
50 from bsddb import db
51 print '-=' * 38
52 print db.DB_VERSION_STRING
53 print 'bsddb3.db.version(): %s' % (db.version(), )
54 print 'bsddb3.db.__version__: %s' % db.__version__
55 print 'bsddb3.db.cvsid: %s' % db.cvsid
56 print 'python version: %s' % sys.version
57 print '-=' * 38
58
59 unittest.main( defaultTest='suite' )
60