mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #6279 - frewsxcv:flake8, r=jdm
Fixes #6236 Also included in this commit are the changes need to make flake8 pass for the existing python file <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6279) <!-- Reviewable:end -->
This commit is contained in:
commit
ccfe29d8f2
15 changed files with 113 additions and 68 deletions
|
@ -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,
|
||||
|
|
|
@ -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) + " , " +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue