Matt Knepley avatar Matt Knepley committed c8f5ba6

Builder: Allow --testum to take a list

Hg-commit: 94a6ca27f413d7d39c531c64539a39441b125dea

Comments (0)

Files changed (1)


   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')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.