From 8a8f39d70ac29351e05d9066b288989cc59522a4 Mon Sep 17 00:00:00 2001 From: Joachim Klein Date: Fri, 12 Oct 2018 14:25:04 +0200 Subject: [PATCH] imported patch prism-auto--property-list-file-with-arguments.patch --- prism/etc/scripts/prism-auto | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/prism/etc/scripts/prism-auto b/prism/etc/scripts/prism-auto index 1f3b8615..aa690e00 100755 --- a/prism/etc/scripts/prism-auto +++ b/prism/etc/scripts/prism-auto @@ -932,7 +932,7 @@ def benchmarkAutoFile(autoFile): # # * propertiesFile: name of the properties file (as a string) -def benchmarkPropertiesFile(propertiesFile): +def benchmarkPropertiesFile(propertiesFile, extraArgs): logging.debug("Benchmarking properties file " + propertiesFile) dir = os.path.dirname(propertiesFile) if dir == "": dir = "." @@ -949,7 +949,7 @@ def benchmarkPropertiesFile(propertiesFile): for modelFile in modelFiles: # Expand model based on any .args file, too for modelArgs in getMatchingArgListsForFile(modelFile[0]): - benchmark(modelFile[0], modelFile[1] + modelArgs + [propertiesFile] + args, dir) + benchmark(modelFile[0], modelFile[1] + modelArgs + [propertiesFile] + args + extraArgs, dir) # Execute benchmarking based on a property list. # A property list is a file containing pairs of the form , where: @@ -966,11 +966,20 @@ def benchmarkPropListFile(propListFile): for line in open(propListFile, 'r').readlines(): line = line.strip() if len(line) == 0 or lineIsCommentedOut(line): continue - items = line.split(',') - dir = os.path.join(listDir, items[0].strip()) + m = re.match('(.+?),(.+?)(,(.+))?$', line); + if m is None: + print("Malformed line in property list file " + propListFile + ": "+line) + return + modelSpec = m.group(1) + dir = os.path.join(listDir, modelSpec.strip()) dir = os.path.realpath(dir) - propFile = items[1].strip() - benchmarkPropertiesFile(os.path.join(dir, propFile)) + propFile = m.group(2).strip() + extraArgSpec = m.group(4) + if extraArgSpec is None: + benchmarkPropertiesFile(os.path.join(dir, propFile), []) + else: + extraArgs = extraArgSpec.split() + benchmarkPropertiesFile(os.path.join(dir, propFile), extraArgs) # (Re-)start the nailgun server # We first try to stop an existing server (which should fail quickly if there is none running)