mirror of
https://github.com/servo/servo.git
synced 2025-07-28 09:40:33 +01:00
UI cheeze.
This commit is contained in:
parent
6749bed1f5
commit
f82f46680e
2 changed files with 28 additions and 20 deletions
|
@ -274,12 +274,14 @@ class MachCommands(CommandBase):
|
||||||
@Command('test-dromaeo',
|
@Command('test-dromaeo',
|
||||||
description='Run the Dromaeo test suite',
|
description='Run the Dromaeo test suite',
|
||||||
category='testing')
|
category='testing')
|
||||||
|
@CommandArgument('tests', default=["recommended"], nargs="...",
|
||||||
|
help="Specific tests to run")
|
||||||
@CommandArgument('--release', '-r', action='store_true',
|
@CommandArgument('--release', '-r', action='store_true',
|
||||||
help='Run the release build')
|
help='Run the release build')
|
||||||
@CommandArgument('--dev', '-d', action='store_true',
|
@CommandArgument('--dev', '-d', action='store_true',
|
||||||
help='Run the dev build')
|
help='Run the dev build')
|
||||||
def test_dromaeo(self, release, dev):
|
def test_dromaeo(self, tests, release, dev):
|
||||||
return self.dromaeo_test_runner("test", release, dev)
|
return self.dromaeo_test_runner(tests, release, dev)
|
||||||
|
|
||||||
@Command('update-jquery',
|
@Command('update-jquery',
|
||||||
description='Update the jQuery test suite expected results',
|
description='Update the jQuery test suite expected results',
|
||||||
|
@ -378,7 +380,7 @@ class MachCommands(CommandBase):
|
||||||
return subprocess.check_call(
|
return subprocess.check_call(
|
||||||
[run_file, cmd, bin_path, base_dir])
|
[run_file, cmd, bin_path, base_dir])
|
||||||
|
|
||||||
def dromaeo_test_runner(self, cmd, release, dev):
|
def dromaeo_test_runner(self, tests, release, dev):
|
||||||
self.ensure_bootstrapped()
|
self.ensure_bootstrapped()
|
||||||
base_dir = path.abspath(path.join("tests", "dromaeo"))
|
base_dir = path.abspath(path.join("tests", "dromaeo"))
|
||||||
dromaeo_dir = path.join(base_dir, "dromaeo")
|
dromaeo_dir = path.join(base_dir, "dromaeo")
|
||||||
|
@ -401,5 +403,5 @@ class MachCommands(CommandBase):
|
||||||
bin_path = path.abspath(self.get_binary_path(release, dev))
|
bin_path = path.abspath(self.get_binary_path(release, dev))
|
||||||
|
|
||||||
return subprocess.check_call(
|
return subprocess.check_call(
|
||||||
[run_file, cmd, bin_path, base_dir])
|
[run_file, "|".join(tests), bin_path, base_dir])
|
||||||
|
|
||||||
|
|
|
@ -13,20 +13,20 @@ import SimpleHTTPServer
|
||||||
import SocketServer
|
import SocketServer
|
||||||
import threading
|
import threading
|
||||||
import urlparse
|
import urlparse
|
||||||
|
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 jQuery test module.
|
# Run servo and print / parse the results for a specific Dromaeo module.
|
||||||
def run_servo(servo_exe):
|
def run_servo(servo_exe, tests):
|
||||||
url = "http://localhost:{0}/dromaeo/web/?recommended&automated&post_json".format(TEST_SERVER_PORT)
|
url = "http://localhost:{0}/dromaeo/web/?{1}&automated&post_json".format(TEST_SERVER_PORT, tests)
|
||||||
#url = "http://localhost:{0}/dromaeo/web/?sunspider-string-validate-input&automated&post_json".format(TEST_SERVER_PORT)
|
|
||||||
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} test servo_binary dromaeo_base_dir".format(sys.argv[0]))
|
print("USAGE: {0} tests servo_binary dromaeo_base_dir".format(sys.argv[0]))
|
||||||
|
|
||||||
|
|
||||||
# Handle the POST at the end
|
# Handle the POST at the end
|
||||||
|
@ -44,7 +44,7 @@ class RequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if len(sys.argv) == 4:
|
if len(sys.argv) == 4:
|
||||||
cmd = sys.argv[1]
|
tests = sys.argv[1]
|
||||||
servo_exe = sys.argv[2]
|
servo_exe = sys.argv[2]
|
||||||
base_dir = sys.argv[3]
|
base_dir = sys.argv[3]
|
||||||
os.chdir(base_dir)
|
os.chdir(base_dir)
|
||||||
|
@ -57,15 +57,21 @@ if __name__ == '__main__':
|
||||||
# Start the test server
|
# Start the test server
|
||||||
server = BaseHTTPServer.HTTPServer(('', TEST_SERVER_PORT), RequestHandler)
|
server = BaseHTTPServer.HTTPServer(('', TEST_SERVER_PORT), RequestHandler)
|
||||||
|
|
||||||
if cmd == "test":
|
print("Testing Dromaeo on Servo!")
|
||||||
print("Testing Dromaeo on Servo!")
|
proc = run_servo(servo_exe, tests)
|
||||||
proc = run_servo(servo_exe)
|
server.got_post = False
|
||||||
server.got_post = False
|
while not server.got_post:
|
||||||
while not server.got_post:
|
server.handle_request()
|
||||||
server.handle_request()
|
data = json.loads(server.post_data[0])
|
||||||
print("dromaeo: %s" % server.post_data)
|
n = 0
|
||||||
proc.kill()
|
l = 0
|
||||||
else:
|
for test in data:
|
||||||
print_usage()
|
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))
|
||||||
|
for test in data:
|
||||||
|
print(" {0}{1} | {2}".format(test, " " * (l - len(test)), data[test]))
|
||||||
|
proc.kill()
|
||||||
else:
|
else:
|
||||||
print_usage()
|
print_usage()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue