[Cryptech-Commits] [sw/pkcs11] 02/07: Add support for running only a specified subset of the unit tests.

git at cryptech.is git at cryptech.is
Mon Jun 13 19:47:57 UTC 2016


This is an automated email from the git hooks/post-receive script.

sra at hactrn.net pushed a commit to branch master
in repository sw/pkcs11.

commit 5e349fa7c3aa2c60a457b3d799032a6fc62dc43a
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Fri Jun 10 16:42:48 2016 -0400

    Add support for running only a specified subset of the unit tests.
---
 unit_tests.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/unit_tests.py b/unit_tests.py
index 923d108..4d09b6a 100644
--- a/unit_tests.py
+++ b/unit_tests.py
@@ -14,7 +14,8 @@ def main():
     from sys import argv
     global args
     args = parse_arguments(argv[1:])
-    unittest.main(verbosity = 1 if args.quiet else 2, argv = argv[:1], catchbreak = True)
+    argv = argv[:1] + args.only_test
+    unittest.main(verbosity = 1 if args.quiet else 2, argv = argv, catchbreak = True)
 
 def parse_arguments(argv = ()):
     from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
@@ -33,6 +34,7 @@ def parse_arguments(argv = ()):
     parser.add_argument("--sql-file",   default = "unit_tests.db",                      help = "SQLite3 database")
     parser.add_argument("--ks-client",  default = "unit_tests.ks-client",               help = "client keystore (ks_mmap only)")
     parser.add_argument("--ks-server",  default = "unit_tests.ks-server",               help = "server keystore (ks_mmap only)")
+    parser.add_argument("--only-test",  default = [], nargs = "+",                      help = "only run tests named here")
     return parser.parse_args(argv)
 
 args = parse_arguments()



More information about the Commits mailing list