mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
test-tidy fixes.
This commit is contained in:
parent
f82f46680e
commit
a93b4bba6d
2 changed files with 8 additions and 4 deletions
|
@ -404,4 +404,3 @@ class MachCommands(CommandBase):
|
||||||
|
|
||||||
return subprocess.check_call(
|
return subprocess.check_call(
|
||||||
[run_file, "|".join(tests), bin_path, base_dir])
|
[run_file, "|".join(tests), bin_path, base_dir])
|
||||||
|
|
||||||
|
|
|
@ -15,15 +15,18 @@ import threading
|
||||||
import urlparse
|
import urlparse
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
|
||||||
# Port to run the HTTP server on for Dromaeo.
|
# Port to run the HTTP server on for Dromaeo.
|
||||||
TEST_SERVER_PORT = 8192
|
TEST_SERVER_PORT = 8192
|
||||||
|
|
||||||
|
|
||||||
# Run servo and print / parse the results for a specific Dromaeo module.
|
# Run servo and print / parse the results for a specific Dromaeo module.
|
||||||
def run_servo(servo_exe, tests):
|
def run_servo(servo_exe, tests):
|
||||||
url = "http://localhost:{0}/dromaeo/web/?{1}&automated&post_json".format(TEST_SERVER_PORT, tests)
|
url = "http://localhost:{0}/dromaeo/web/?{1}&automated&post_json".format(TEST_SERVER_PORT, tests)
|
||||||
args = [servo_exe, url, "-z", "-f"]
|
args = [servo_exe, url, "-z", "-f"]
|
||||||
return subprocess.Popen(args)
|
return subprocess.Popen(args)
|
||||||
|
|
||||||
|
|
||||||
# Print usage if command line args are incorrect
|
# Print usage if command line args are incorrect
|
||||||
def print_usage():
|
def print_usage():
|
||||||
print("USAGE: {0} tests servo_binary dromaeo_base_dir".format(sys.argv[0]))
|
print("USAGE: {0} tests servo_binary dromaeo_base_dir".format(sys.argv[0]))
|
||||||
|
@ -34,14 +37,16 @@ class RequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||||
def do_POST(self):
|
def do_POST(self):
|
||||||
self.send_response(200)
|
self.send_response(200)
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
self.wfile.write("<HTML>POST OK.<BR><BR>");
|
self.wfile.write("<HTML>POST OK.<BR><BR>")
|
||||||
length = int(self.headers.getheader('content-length'))
|
length = int(self.headers.getheader('content-length'))
|
||||||
parameters = urlparse.parse_qs(self.rfile.read(length))
|
parameters = urlparse.parse_qs(self.rfile.read(length))
|
||||||
self.server.got_post = True
|
self.server.got_post = True
|
||||||
self.server.post_data = parameters['data']
|
self.server.post_data = parameters['data']
|
||||||
|
|
||||||
def log_message(self, format, *args):
|
def log_message(self, format, *args):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if len(sys.argv) == 4:
|
if len(sys.argv) == 4:
|
||||||
tests = sys.argv[1]
|
tests = sys.argv[1]
|
||||||
|
@ -69,7 +74,7 @@ if __name__ == '__main__':
|
||||||
n = max(n, len(test) + len(data[test]) + 3)
|
n = max(n, len(test) + len(data[test]) + 3)
|
||||||
l = max(l, len(test))
|
l = max(l, len(test))
|
||||||
print("\n Test{0} | Time".format(" " * (l - len("Test"))))
|
print("\n Test{0} | Time".format(" " * (l - len("Test"))))
|
||||||
print("-" * (n+2))
|
print("-" * (n + 2))
|
||||||
for test in data:
|
for test in data:
|
||||||
print(" {0}{1} | {2}".format(test, " " * (l - len(test)), data[test]))
|
print(" {0}{1} | {2}".format(test, " " * (l - len(test)), data[test]))
|
||||||
proc.kill()
|
proc.kill()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue