summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2015-01-19 09:36:20 -0800
committerDylan Baker <baker.dylan.c@gmail.com>2015-03-09 10:23:39 -0700
commit6aa103a54014ff13961d3dc40d6ddb58388668e2 (patch)
tree9ef592fcbe6336ea8c3cf05909a7d2740782c172
parent9526a4f3c757b8d5b7a2734b312a7c44e6508409 (diff)
igt.py: Use __future__ functions, mainly print_function
This makes igt more like the rest of piglit which uses the __future__ version of print, division, and import Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Thomas Wood <thomas.wood@intel.com>
-rw-r--r--tests/igt.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/igt.py b/tests/igt.py
index a144cddf0..d7704060a 100644
--- a/tests/igt.py
+++ b/tests/igt.py
@@ -32,6 +32,7 @@ drm. Even if you have rendernode support enabled.
"""
+from __future__ import print_function, division, absolute_import
import os
import re
import sys
@@ -52,10 +53,10 @@ def check_environment():
"""
debugfs_path = "/sys/kernel/debug/dri"
if os.getuid() != 0:
- print "Test Environment check: not root!"
+ print("Test Environment check: not root!")
return False
if not os.path.isdir(debugfs_path):
- print "Test Environment check: debugfs not mounted properly!"
+ print("Test Environment check: debugfs not mounted properly!")
return False
for subdir in os.listdir(debugfs_path):
if not os.path.isdir(os.path.join(debugfs_path, subdir)):
@@ -63,10 +64,10 @@ def check_environment():
clients = open(os.path.join(debugfs_path, subdir, "clients"), 'r')
lines = clients.readlines()
if len(lines) > 2:
- print "Test Environment check: other drm clients running!"
+ print("Test Environment check: other drm clients running!")
return False
- print "Test Environment check: Succeeded."
+ print("Test Environment check: Succeeded.")
return True
@@ -80,7 +81,7 @@ else:
# check for the test lists
if not (os.path.exists(os.path.join(IGT_TEST_ROOT, 'single-tests.txt'))
and os.path.exists(os.path.join(IGT_TEST_ROOT, 'multi-tests.txt'))):
- print "intel-gpu-tools test lists not found."
+ print("intel-gpu-tools test lists not found.")
sys.exit(0)
@@ -147,7 +148,7 @@ def add_subtest_cases(test):
return
if proc.returncode != 0:
- print "Error: Could not list subtests for " + test
+ print("Error: Could not list subtests for " + test)
return
subtests = out.split("\n")