aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/jquery/run_jquery.py42
-rwxr-xr-xtests/power/PowerMeasure.py8
2 files changed, 28 insertions, 22 deletions
diff --git a/tests/jquery/run_jquery.py b/tests/jquery/run_jquery.py
index ac5398a12d1..42b3da9cdb5 100755
--- a/tests/jquery/run_jquery.py
+++ b/tests/jquery/run_jquery.py
@@ -22,24 +22,24 @@ import urlparse
# See https://github.com/servo/servo/issues/6210 and
# https://github.com/servo/servo/issues/6211
JQUERY_MODULES = [
- #"ajax", # panics
- #"attributes",
- #"callbacks",
- #"core", # mozjs crash
- #"css",
- #"data",
- #"deferred",
- #"dimensions",
- #"effects",
- #"event", # panics
- #"manipulation", # mozjs crash
- #"offset",
- #"queue",
+ # "ajax", # panics
+ # "attributes",
+ # "callbacks",
+ # "core", # mozjs crash
+ # "css",
+ # "data",
+ # "deferred",
+ # "dimensions",
+ # "effects",
+ # "event", # panics
+ # "manipulation", # mozjs crash
+ # "offset",
+ # "queue",
"selector",
- #"serialize",
- #"support",
- #"traversing",
- #"wrap"
+ # "serialize",
+ # "support",
+ # "traversing",
+ # "wrap"
]
# Port to run the HTTP server on for jQuery.
@@ -48,6 +48,7 @@ TEST_SERVER_PORT = 8192
# A regex for matching console.log output lines from the test runner.
REGEX_PATTERN = "^\[jQuery test\] \[([0-9]+)/([0-9]+)/([0-9]+)] (.*)"
+
# The result of a single test group.
class TestResult:
def __init__(self, success, fail, total, text):
@@ -94,7 +95,7 @@ def parse_string_to_results(buffer):
# Run servo and print / parse the results for a specific jQuery test module.
def run_servo(servo_exe, module):
url = "http://localhost:{0}/jquery/test/?module={1}".format(TEST_SERVER_PORT, module)
- args = [ servo_exe, url, "-z", "-f" ]
+ args = [servo_exe, url, "-z", "-f"]
proc = subprocess.Popen(args, stdout=subprocess.PIPE)
while True:
line = proc.stdout.readline()
@@ -107,26 +108,31 @@ def run_servo(servo_exe, module):
except AttributeError:
pass
+
# Build the filename for an expected results file.
def module_filename(module):
return 'expected_{0}.txt'.format(module)
+
# Read an existing set of expected results to compare against.
def read_existing_results(module):
with open(module_filename(module), 'r') as file:
buffer = file.read()
return parse_string_to_results(buffer)
+
# Write a set of results to file
def write_results(module, results):
with open(module_filename(module), 'w') as file:
for result in test_results.itervalues():
file.write(result.text + '\n')
+
# Print usage if command line args are incorrect
def print_usage():
print("USAGE: {0} servo_binary jquery_base_dir test|update".format(sys.argv[0]))
+
# Run a simple HTTP server to serve up the jQuery test suite
def run_http_server():
class ThreadingSimpleServer(SocketServer.ThreadingMixIn,
diff --git a/tests/power/PowerMeasure.py b/tests/power/PowerMeasure.py
index e80447fd1e6..374ab597765 100755
--- a/tests/power/PowerMeasure.py
+++ b/tests/power/PowerMeasure.py
@@ -38,7 +38,7 @@ def PowerCollector(OutputDir, Benchmarks, LayoutThreads, Renderer):
powerTiming = 1
ExperimentNum = 21
for ExpNum in range(1, ExperimentNum):
- for layoutT in range(1, LayoutThreads+1):
+ for layoutT in range(1, LayoutThreads + 1):
print(" layoutT=%d ExpNum=%d" % (layoutT, ExpNum))
PowerFiles = path.join(
power_dir, "power-Layout%d-set%d.csv" % (layoutT, ExpNum))
@@ -71,7 +71,7 @@ def PowerParser(OutputDir, LayoutThreads):
ResultFile.write("LayoutThreads, MeanPower, MaxPower , MinPower, MeanTime , MaxTime, "
"MinTime \n")
- for layoutT in range(1, LayoutThreads+1):
+ for layoutT in range(1, LayoutThreads + 1):
MaxTime = 0
MinTime = 1000000
MaxPower = 0
@@ -132,8 +132,8 @@ def PowerParser(OutputDir, LayoutThreads):
TimeGen = TimeGen + TotalTime
PowerGen = PowerGen + TotalPower
- TotalPower = PowerGen / float(ExperimentNum-1)
- TotalTime = TimeGen / float(ExperimentNum-1)
+ TotalPower = PowerGen / float(ExperimentNum - 1)
+ TotalTime = TimeGen / float(ExperimentNum - 1)
ResultFile.write(str(layoutT) + " , " + str(TotalPower) + " , " +
str(MaxPower) + " , " + str(MinPower) + " , " +
str(TotalTime) + " , " + str(MaxTime) + " , " +