test-tidy fixes.

This commit is contained in:
Michael Howell 2015-07-31 21:49:01 -07:00
parent f82f46680e
commit a93b4bba6d
2 changed files with 8 additions and 4 deletions

View file

@ -404,4 +404,3 @@ class MachCommands(CommandBase):
return subprocess.check_call(
[run_file, "|".join(tests), bin_path, base_dir])

View file

@ -15,15 +15,18 @@ import threading
import urlparse
import json
# Port to run the HTTP server on for Dromaeo.
TEST_SERVER_PORT = 8192
# Run servo and print / parse the results for a specific Dromaeo module.
def run_servo(servo_exe, 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)
# Print usage if command line args are incorrect
def print_usage():
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):
self.send_response(200)
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'))
parameters = urlparse.parse_qs(self.rfile.read(length))
self.server.got_post = True
self.server.post_data = parameters['data']
def log_message(self, format, *args):
return
if __name__ == '__main__':
if len(sys.argv) == 4:
tests = sys.argv[1]
@ -69,7 +74,7 @@ if __name__ == '__main__':
n = max(n, len(test) + len(data[test]) + 3)
l = max(l, len(test))
print("\n Test{0} | Time".format(" " * (l - len("Test"))))
print("-" * (n+2))
print("-" * (n + 2))
for test in data:
print(" {0}{1} | {2}".format(test, " " * (l - len(test)), data[test]))
proc.kill()