Accept hyphens in test names; fix profiler args string.
Updated regular expression parser to accept hyphens in the test names.
Also fixed the quotes on profiler args, for proper parsing by
test_that.
BUG=None
TEST=Ran crosperf successfully with benchmark name that had hyphen in it;
successfully ran crosperf with profiler args.
Change-Id: I4a154e390a5fabfc47e0783212fed928eb5e9873
Reviewed-on: https://chrome-internal-review.googlesource.com/146967
Reviewed-by: Yunlian Jiang <yunlian@google.com>
Commit-Queue: Caroline Tice <cmtice@google.com>
Tested-by: Caroline Tice <cmtice@google.com>
diff --git a/crosperf/experiment_file.py b/crosperf/experiment_file.py
index c70566f..293e822 100644
--- a/crosperf/experiment_file.py
+++ b/crosperf/experiment_file.py
@@ -33,7 +33,7 @@
# Field regex, e.g. "iterations: 3"
_FIELD_VALUE_RE = re.compile(r"(\+)?\s*(\w+?)(?:\.(\S+))?\s*:\s*(.*)")
# Open settings regex, e.g. "label {"
- _OPEN_SETTINGS_RE = re.compile(r"(?:([\w.]+):)?\s*([\w.]+)\s*{")
+ _OPEN_SETTINGS_RE = re.compile(r"(?:([\w.-]+):)?\s*([\w.-]+)\s*{")
# Close settings regex.
_CLOSE_SETTINGS_RE = re.compile(r"}")
diff --git a/crosperf/suite_runner.py b/crosperf/suite_runner.py
index 47e29c4..f69f372 100644
--- a/crosperf/suite_runner.py
+++ b/crosperf/suite_runner.py
@@ -20,7 +20,7 @@
if not perf_args_list[0] in ["record", "stat"]:
raise Exception("perf_args must start with either record or stat")
extra_test_args = ["profiler=custom_perf",
- ("profiler_args=\"'%s'\"" %
+ ("profiler_args='%s'" %
perf_args)]
return " ".join(extra_test_args)
else: