<div dir="ltr">This patch series looks good to me.<br><br><br>Reviewed by: Kenney Phillis <<a href="mailto:Kkphillisjr@gmail.com">Kkphillisjr@gmail.com</a>><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Fri, Nov 15, 2013 at 12:24 PM, Dylan Baker <span dir="ltr"><<a href="mailto:baker.dylan.c@gmail.com" target="_blank">baker.dylan.c@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This patch tidies up a few things, and lays groundwork for later patches<br>
in this series.<br>
<br>
Signed-off-by: Dylan Baker <<a href="mailto:baker.dylan.c@gmail.com">baker.dylan.c@gmail.com</a>><br>
---<br>
piglit-run.py | 26 +++++++++++---------------<br>
1 file changed, 11 insertions(+), 15 deletions(-)<br>
<br>
diff --git a/piglit-run.py b/piglit-run.py<br>
index 1d63cd4..86448ae 100755<br>
--- a/piglit-run.py<br>
+++ b/piglit-run.py<br>
@@ -77,27 +77,25 @@ def main():<br>
action="store_true",<br>
help="Capture a difference in dmesg before and "<br>
"after each test")<br>
- parser.add_argument("testProfile",<br>
+ parser.add_argument("test_profile",<br>
metavar="<Path to test profile>",<br>
help="Path to testfile to run")<br>
- parser.add_argument("resultsPath",<br>
+ parser.add_argument("results_path",<br>
+ type=path.realpath,<br>
metavar="<Results Path>",<br>
help="Path to results folder")<br>
args = parser.parse_args()<br>
<br>
# Set the platform to pass to waffle<br>
- if args.platform is not None:<br>
+ if args.platform:<br>
os.environ['PIGLIT_PLATFORM'] = args.platform<br>
<br>
- # Always Convert Results Path from Relative path to Actual Path.<br>
- resultsDir = path.realpath(args.resultsPath)<br>
-<br>
# If resume is requested attempt to load the results file<br>
# in the specified path<br>
if args.resume is True:<br>
# Load settings from the old results JSON<br>
- old_results = core.load_results(resultsDir)<br>
- profileFilename = old_results.options['profile']<br>
+ old_results = core.load_results(args.results_path)<br>
+ args.test_profile = old_results.options['profile']<br>
<br>
# Changing the args to the old args allows us to set them<br>
# all in one places down the way<br>
@@ -105,8 +103,6 @@ def main():<br>
args.include_tests = old_results.options['filter']<br>
<br>
# Otherwise parse additional settings from the command line<br>
- else:<br>
- profileFilename = args.testProfile<br>
<br>
# Pass arguments into Environment<br>
env = core.Environment(concurrent=args.concurrency,<br>
@@ -120,7 +116,7 @@ def main():<br>
piglit_dir = path.dirname(path.realpath(sys.argv[0]))<br>
os.chdir(piglit_dir)<br>
<br>
- core.checkDir(resultsDir, False)<br>
+ core.checkDir(args.results_path, False)<br>
<br>
results = core.TestrunResult()<br>
<br>
@@ -128,10 +124,10 @@ def main():<br>
if <a href="http://args.name" target="_blank">args.name</a> is not None:<br>
<a href="http://results.name" target="_blank">results.name</a> = <a href="http://args.name" target="_blank">args.name</a><br>
else:<br>
- <a href="http://results.name" target="_blank">results.name</a> = path.basename(resultsDir)<br>
+ <a href="http://results.name" target="_blank">results.name</a> = path.basename(args.results_path)<br>
<br>
# Begin json.<br>
- result_filepath = os.path.join(resultsDir, 'main')<br>
+ result_filepath = path.join(args.results_path, 'main')<br>
result_file = open(result_filepath, 'w')<br>
json_writer = core.JSONWriter(result_file)<br>
json_writer.open_dict()<br>
@@ -139,7 +135,7 @@ def main():<br>
# Write out command line options for use in resuming.<br>
json_writer.write_dict_key('options')<br>
json_writer.open_dict()<br>
- json_writer.write_dict_item('profile', profileFilename)<br>
+ json_writer.write_dict_item('profile', args.test_profile)<br>
json_writer.write_dict_item('filter', args.include_tests)<br>
json_writer.write_dict_item('exclude_filter', args.exclude_tests)<br>
json_writer.close_dict()<br>
@@ -148,7 +144,7 @@ def main():<br>
for (key, value) in env.collectData().items():<br>
json_writer.write_dict_item(key, value)<br>
<br>
- profile = core.loadTestProfile(profileFilename)<br>
+ profile = core.loadTestProfile(args.test_profile)<br>
<br>
json_writer.write_dict_key('tests')<br>
json_writer.open_dict()<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.3.2<br>
<br>
_______________________________________________<br>
Piglit mailing list<br>
<a href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/piglit" target="_blank">http://lists.freedesktop.org/mailman/listinfo/piglit</a><br>
</font></span></blockquote></div><br></div>