Commit cb29ebf7 authored by Dylan Baker's avatar Dylan Baker Cleanups

This patch tidies up a few things, and lays groundwork for later patches
in this series.

Reviewed by: Kenney Phillis <>
Signed-off-by: Dylan Baker's avatarDylan Baker <>
parent 0d13d9c6
......@@ -77,27 +77,25 @@ def main():
help="Capture a difference in dmesg before and "
"after each test")
metavar="<Path to test profile>",
help="Path to testfile to run")
metavar="<Results Path>",
help="Path to results folder")
args = parser.parse_args()
# Set the platform to pass to waffle
if args.platform is not None:
if args.platform:
os.environ['PIGLIT_PLATFORM'] = args.platform
# Always Convert Results Path from Relative path to Actual Path.
resultsDir = path.realpath(args.resultsPath)
# If resume is requested attempt to load the results file
# in the specified path
if args.resume is True:
# Load settings from the old results JSON
old_results = core.load_results(resultsDir)
profileFilename = old_results.options['profile']
old_results = core.load_results(args.results_path)
args.test_profile = old_results.options['profile']
# Changing the args to the old args allows us to set them
# all in one places down the way
......@@ -106,8 +104,6 @@ def main():
args.concurrency = old_results.options['concurrency']
# Otherwise parse additional settings from the command line
profileFilename = args.testProfile
# Pass arguments into Environment
env = core.Environment(concurrent=args.concurrency,
......@@ -121,7 +117,7 @@ def main():
piglit_dir = path.dirname(path.realpath(sys.argv[0]))
core.checkDir(resultsDir, False)
core.checkDir(args.results_path, False)
results = core.TestrunResult()
......@@ -129,10 +125,10 @@ def main():
if is not None: =
else: = path.basename(resultsDir) = path.basename(args.results_path)
# Begin json.
result_filepath = os.path.join(resultsDir, 'main')
result_filepath = path.join(args.results_path, 'main')
result_file = open(result_filepath, 'w')
json_writer = core.JSONWriter(result_file)
......@@ -140,7 +136,7 @@ def main():
# Write out command line options for use in resuming.
json_writer.write_dict_item('profile', profileFilename)
json_writer.write_dict_item('profile', args.test_profile)
json_writer.write_dict_item('filter', args.include_tests)
json_writer.write_dict_item('exclude_filter', args.exclude_tests)
json_writer.write_dict_item('concurrency', args.concurrency)
......@@ -150,7 +146,7 @@ def main():
for (key, value) in env.collectData().items():
json_writer.write_dict_item(key, value)
profile = core.loadTestProfile(profileFilename)
profile = core.loadTestProfile(args.test_profile)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment