Matt Knepley  committed c8f5ba6

Builder: Allow --testum to take a list

Hg-commit: 94a6ca27f413d7d39c531c64539a39441b125dea

  • Participants
  • Parent commits 2704771
  • Branches master

Comments (0)

Files changed (1)

File config/

   if not isinstance(params, list):
     params = [params]
-  # NOTE: testnum will be wrong for single tests, just push fixes to PETSc
+  # Process testnum
+  if args.testnum is not None:
+    if args.testnum[0] == '[':
+      testnum = args.testnum[1:-1].split(',')
+    else:
+      testnum = [args.testnum]
+    numtests = len(testnum)
+  else:
+    numtests = len(params)
   rebuildTest = True
-  numtests = 1 if args.testnum is not None else len(params)
   maker.logPrint('Running %d tests\n' % (numtests,), debugSection='screen', forceScroll=True)
   for testnum, param in enumerate(params):
     testnum = str(testnum)
     if 'num' in param: testnum = param['num']
-    if not args.testnum is None and testnum != str(args.testnum): continue
+    if not args.testnum is None and not testnum in str(args.testnum): continue
     if 'setup' in param:
       os.system('python '+param['setup'])
   parser_check.add_argument('files', nargs='*', help='Extra examples to test')
   parser_check.add_argument('--args', action='append', default=[], help='Extra execution arguments for test')
   parser_check.add_argument('--retain', action='store_true', default=False, help='Retain the executable after testing')
-  parser_check.add_argument('--testnum', type=int, help='The test number to execute')
+  parser_check.add_argument('--testnum', help='The test to execute')
   parser_check.add_argument('--replace', action='store_true', default=False, help='Replace stored output with test output')
   parser_regression = subparsers.add_parser('regression', help='Execute regression tests')