[v2,6/26] framework/programs/run: Remove use of TestrunResult

Submitted by Dylan Baker on Oct. 27, 2016, 9:31 p.m.

Details

Message ID d2bb762d287f923b3ddc031115e9b33b5c282057.1477603560.git-series.dylan@pnwbakers.com
State New
Headers show

Not browsing as part of any series.

Patch hide | download patch | download mbox

diff --git a/framework/programs/run.py b/framework/programs/run.py
index 741a492..bf0cebe 100644
--- a/framework/programs/run.py
+++ b/framework/programs/run.py
@@ -305,20 +305,12 @@  def run(input_):
             'Cannot overwrite existing folder without the -o/--overwrite '
             'option being set.')
 
-    results = framework.results.TestrunResult()
-    backends.set_meta(args.backend, results)
-
-    # Set results.name
-    if args.name is not None:
-        results.name = args.name
-    else:
-        results.name = path.basename(args.results_path)
-
     backend = backends.get_backend(args.backend)(
         args.results_path,
         junit_suffix=args.junit_suffix,
         junit_subtests=args.junit_subtests)
-    backend.initialize(_create_metadata(args, results.name))
+    backend.initialize(_create_metadata(
+        args, args.name or path.basename(args.results_path)))
 
     profile = framework.profile.merge_test_profiles(args.test_profile)
     profile.results_dir = args.results_path
@@ -328,7 +320,6 @@  def run(input_):
             # Strip newlines
             profile.forced_test_list = list([t.strip() for t in test_list])
 
-    results.time_elapsed.start = time.time()
     # Set the dmesg type
     if args.dmesg:
         profile.dmesg = args.dmesg
@@ -336,10 +327,12 @@  def run(input_):
     if args.monitored:
         profile.monitoring = args.monitored
 
+    time_elapsed = framework.results.TimeAttribute(start=time.time())
+
     framework.profile.run(profile, args.log_level, backend, args.concurrent)
 
-    results.time_elapsed.end = time.time()
-    backend.finalize({'time_elapsed': results.time_elapsed.to_json()})
+    time_elapsed.end = time.time()
+    backend.finalize({'time_elapsed': time_elapsed.to_json()})
 
     print('Thank you for running Piglit!\n'
           'Results have been written to ' + args.results_path)