From 032a21c45fba3b90e7e6018a62170f00ae45a0b4 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Wed, 2 Apr 2014 17:21:00 -0400 Subject: [PATCH] added regular expression searching for test configurations --- tests/run_tests.py | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index 9aa99a8e85..1df65e88ba 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -5,6 +5,7 @@ from __future__ import print_function import os import sys import shutil +import re from subprocess import call from collections import OrderedDict from optparse import OptionParser @@ -152,37 +153,10 @@ add_test('omp-phdf5-petsc-normal', openmp=True, mpi=True, hdf5=True, petsc=True) add_test('omp-phdf5-petsc-debug', openmp=True, mpi=True, hdf5=True, petsc=True, debug=True) add_test('omp-phdf5-petsc-optimize', openmp=True, mpi=True, hdf5=True, petsc=True, optimize=True) -# Process command line arguments +# Delete items of dictionary that don't match regular expression if opts.configs != None: - tests_ = opts.configs.split() - - # Check for special subsets of tests - tests__ = [] - for i in tests_: - - # This checks for any subsets of tests. The string after - # all-XXXX will be used to search through all tests. - if i.startswith('all-'): - suffix = i.split('all-')[1] - for j in tests: - if j.rfind(suffix) != -1: - try: - tests__.index(j) - except ValueError: - tests__.append(j) - - # Test name specified on command line - else: - try: - tests__.index(i) - except ValueError: - tests__.append(i) # append specific test (e.g., mpi-debug) - - # Delete items of dictionary that are not in tests__ for key in iter(tests): - try: - tests__.index(key) - except ValueError: + if not re.search(opts.configs, key): del tests[key] # Begin testing