aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/testing_commands.py
diff options
context:
space:
mode:
authorKimSnj <karimair@gmail.com>2016-11-27 18:15:51 +0100
committerKimSnj <karimair@gmail.com>2016-11-27 18:15:51 +0100
commitb5b76e80536c1245e9535980f6b00347f1dcd648 (patch)
tree4518ca1d95b4429e8b432f23d8ce0fcfd80fb8c1 /python/servo/testing_commands.py
parentc4f87f451faf8eeac3e046c38ebf8b9b3dd0051e (diff)
downloadservo-b5b76e80536c1245e9535980f6b00347f1dcd648.tar.gz
servo-b5b76e80536c1245e9535980f6b00347f1dcd648.zip
Use software rendering when running servo in headless mode
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r--python/servo/testing_commands.py36
1 files changed, 12 insertions, 24 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py
index f24750df245..c5074bcc7d0 100644
--- a/python/servo/testing_commands.py
+++ b/python/servo/testing_commands.py
@@ -25,7 +25,11 @@ from mach.decorators import (
Command,
)
-from servo.command_base import BuildNotFound, CommandBase, call, cd, check_call, find_dep_path_newest, host_triple
+from servo.command_base import (
+ BuildNotFound, CommandBase,
+ call, cd, check_call, host_triple, set_osmesa_env,
+)
+
from wptrunner import wptcommandline
from update import updatecommandline
from servo_tidy import tidy
@@ -637,29 +641,13 @@ class MachCommands(CommandBase):
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
+ try:
+ args = [self.get_binary_path(use_release, not use_release)]
+ set_osmesa_env(args[0], os.environ)
+ 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():