| 1 | # |
|---|
| 2 | # Test script for the Python Cryptography Toolkit. |
|---|
| 3 | # |
|---|
| 4 | |
|---|
| 5 | __revision__ = "$Id: test.py,v 1.7 2002/07/11 14:31:19 akuchling Exp $" |
|---|
| 6 | |
|---|
| 7 | import os, sys |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | # Add the build directory to the front of sys.path |
|---|
| 11 | from distutils.util import get_platform |
|---|
| 12 | s = "build/lib.%s-%.3s" % (get_platform(), sys.version) |
|---|
| 13 | s = os.path.join(os.getcwd(), s) |
|---|
| 14 | sys.path.insert(0, s) |
|---|
| 15 | s = os.path.join(os.getcwd(), 'test') |
|---|
| 16 | sys.path.insert(0, s) |
|---|
| 17 | |
|---|
| 18 | from Crypto.Util import test |
|---|
| 19 | |
|---|
| 20 | args = sys.argv[1:] |
|---|
| 21 | quiet = "--quiet" in args |
|---|
| 22 | if quiet: args.remove('--quiet') |
|---|
| 23 | |
|---|
| 24 | if not quiet: |
|---|
| 25 | print '\nStream Ciphers:' |
|---|
| 26 | print '===============' |
|---|
| 27 | |
|---|
| 28 | if args: test.TestStreamModules(args, verbose= not quiet) |
|---|
| 29 | else: test.TestStreamModules(verbose= not quiet) |
|---|
| 30 | |
|---|
| 31 | if not quiet: |
|---|
| 32 | print '\nBlock Ciphers:' |
|---|
| 33 | print '==============' |
|---|
| 34 | |
|---|
| 35 | if args: test.TestBlockModules(args, verbose= not quiet) |
|---|
| 36 | else: test.TestBlockModules(verbose= not quiet) |
|---|
| 37 | |
|---|
| 38 | |
|---|