aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/testing_commands.py
diff options
context:
space:
mode:
authorShing Lyu <shing.lyu@gmail.com>2016-10-28 15:05:07 +0800
committerShing Lyu <shing.lyu@gmail.com>2016-11-07 15:20:36 +0800
commit9aaa0886240aa4863ae2f8620932ecf6084f4f1f (patch)
tree5aff436e3959679376c397feff702be681d5e1df /python/servo/testing_commands.py
parentd941c5b91673d006304d90f792930d6c107dbef6 (diff)
downloadservo-9aaa0886240aa4863ae2f8620932ecf6084f4f1f.tar.gz
servo-9aaa0886240aa4863ae2f8620932ecf6084f4f1f.zip
Use headless rendering for performance test
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r--python/servo/testing_commands.py55
1 files changed, 30 insertions, 25 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py
index 88a6d7b24ca..fdb471a437d 100644
--- a/python/servo/testing_commands.py
+++ b/python/servo/testing_commands.py
@@ -162,6 +162,8 @@ class MachCommands(CommandBase):
description='Run the page load performance test',
category='testing')
def test_perf(self):
+ self.set_software_rendering_env(True)
+
self.ensure_bootstrapped()
env = self.build_env()
return call(["bash", "test_perf.sh"],
@@ -422,31 +424,7 @@ class MachCommands(CommandBase):
# Helper for test_css and test_wpt:
def wptrunner(self, run_file, **kwargs):
- # On Linux and mac, find the OSMesa software rendering library and
- # add it to the dynamic linker search path.
- if sys.platform.startswith('linux'):
- try:
- args = [self.get_binary_path(kwargs["release"], not kwargs["release"])]
- osmesa_path = path.join(find_dep_path_newest('osmesa-src', args[0]), "out", "lib", "gallium")
- os.environ["LD_LIBRARY_PATH"] = osmesa_path
- os.environ["GALLIUM_DRIVER"] = "softpipe"
- except BuildNotFound:
- # This can occur when cross compiling (e.g. arm64), in which case
- # we won't run the tests anyway so can safely ignore this step.
- pass
- if sys.platform.startswith('darwin'):
- try:
- args = [self.get_binary_path(kwargs["release"], not kwargs["release"])]
- osmesa_path = path.join(find_dep_path_newest('osmesa-src', args[0]),
- "out", "src", "gallium", "targets", "osmesa", ".libs")
- glapi_path = path.join(find_dep_path_newest('osmesa-src', args[0]),
- "out", "src", "mapi", "shared-glapi", ".libs")
- os.environ["DYLD_LIBRARY_PATH"] = osmesa_path + ":" + glapi_path
- os.environ["GALLIUM_DRIVER"] = "softpipe"
- except BuildNotFound:
- # This can occur when cross compiling (e.g. arm64), in which case
- # we won't run the tests anyway so can safely ignore this step.
- pass
+ self.set_software_rendering_env(kwargs['release'])
os.environ["RUST_BACKTRACE"] = "1"
kwargs["debug"] = not kwargs["release"]
@@ -658,6 +636,33 @@ class MachCommands(CommandBase):
return check_call(
[run_file, "|".join(tests), bin_path, base_dir])
+ def set_software_rendering_env(self, use_release):
+ # On Linux and mac, find the OSMesa software rendering library and
+ # add it to the dynamic linker search path.
+ if sys.platform.startswith('linux'):
+ try:
+ args = [self.get_binary_path(use_release, not use_release)]
+ osmesa_path = path.join(find_dep_path_newest('osmesa-src', args[0]), "out", "lib", "gallium")
+ os.environ["LD_LIBRARY_PATH"] = osmesa_path
+ os.environ["GALLIUM_DRIVER"] = "softpipe"
+ except BuildNotFound:
+ # This can occur when cross compiling (e.g. arm64), in which case
+ # we won't run the tests anyway so can safely ignore this step.
+ pass
+ elif sys.platform.startswith('darwin'):
+ try:
+ args = [self.get_binary_path(use_release, not use_release)]
+ osmesa_path = path.join(find_dep_path_newest('osmesa-src', args[0]),
+ "out", "src", "gallium", "targets", "osmesa", ".libs")
+ glapi_path = path.join(find_dep_path_newest('osmesa-src', args[0]),
+ "out", "src", "mapi", "shared-glapi", ".libs")
+ os.environ["DYLD_LIBRARY_PATH"] = osmesa_path + ":" + glapi_path
+ os.environ["GALLIUM_DRIVER"] = "softpipe"
+ except BuildNotFound:
+ # This can occur when cross compiling (e.g. arm64), in which case
+ # we won't run the tests anyway so can safely ignore this step.
+ pass
+
def create_parser_create():
import argparse