Skip to content

Commit

Permalink
add support for ascii testfile, allow multiple compilers in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Jul 25, 2016
1 parent d6c28b4 commit 1ee4449
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions scripts/create_test
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def parse_command_line(args, description):
parser = argparse.ArgumentParser(
usage="""\n%s <TEST|SUITE> [<TEST|SUITE> ...] [--verbose]
OR
%s xml --category [CATEGORY] [--machine ...] [--compiler ...] [ --testlist ...]
%s --xml-category [CATEGORY] [--xml-machine ...] [--xml-compiler ...] [ --xml-testlist ...]
OR
%s --help
OR
Expand Down Expand Up @@ -161,6 +161,8 @@ OR
help="Use this category key in the lookup in testlist.xml")
parser.add_argument("--xml-testlist",
help="Use this testlist to lookup tests")
parser.add_argument("--testfile", nargs=1, default=None,
help="A file containing an ascii list of tests to run")

args = parser.parse_args(args[1:])

Expand Down Expand Up @@ -206,6 +208,13 @@ OR
if args.test_id is None:
args.test_id = CIME.utils.get_utc_timestamp()


if args.testfile is not None:
with open(args.testfile[0], "r") as fd:
args.testargs.extend( fd.read().splitlines() )
# Remove empty items if any
args.testargs = filter(None, args.testargs)

return args.testargs, args.compiler, args.machine, args.no_run, args.no_build, args.no_batch,\
args.test_root, args.baseline_root, args.clean, args.compare, args.generate, \
args.baseline_name, args.namelists_only, args.project, args.test_id, args.parallel_jobs, \
Expand Down Expand Up @@ -327,12 +336,6 @@ def create_test(testargs, compiler, machine_name, no_run, no_build, no_batch, te
else:
expect(machine_name == testsplit[4],
"ambiguity in machine, please use the --machine option")
if testsplit[5] is not None:
if compiler is None:
compiler = testsplit[5]
else:
expect(compiler == testsplit[5],
"ambiguity in compiler, please use the --compiler option")

impl = SystemTest(testargs,
no_run=no_run, no_build=no_build, no_batch=no_batch,
Expand Down
2 changes: 1 addition & 1 deletion utils/python/CIME/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def get_full_test_name(partial_test, grid=None, compset=None, machine=None, comp
expect(arg_val is not None,
"Could not fill-out test name, partial string '%s' had no %s information and you did not provide any" % (partial_test, name))
result = "%s%s%s" % (result, "_" if name == "compiler" else ".", arg_val)
elif (arg_val is not None):
elif (arg_val is not None and partial_val != partial_compiler):
expect(arg_val == partial_val,
"Mismatch in field %s, partial string '%s' indicated it should be '%s' but you provided '%s'" % (name, partial_test, partial_val, arg_val))

Expand Down

0 comments on commit 1ee4449

Please sign in to comment.