diff options
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r-- | python/servo/testing_commands.py | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index 3f0a24feb10..f990fbf9ec2 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -25,7 +25,7 @@ from mach.decorators import ( Command, ) -from servo.command_base import CommandBase, call, cd, check_call, host_triple +from servo.command_base import BuildNotFound, CommandBase, call, cd, check_call, find_dep_path_newest, host_triple from wptrunner import wptcommandline from update import updatecommandline from servo_tidy import tidy @@ -169,6 +169,16 @@ class MachCommands(CommandBase): return call(["cargo", "test"], env=env, cwd=path.join("ports", "geckolib")) + @Command('test-perf', + description='Run the page load performance test', + category='testing') + def test_perf(self): + self.ensure_bootstrapped() + env = self.build_env() + return call(["bash", "test_perf.sh"], + env=env, + cwd=path.join("etc", "ci", "performance")) + @Command('test-unit', description='Run unit tests', category='testing') @@ -420,6 +430,32 @@ 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(True, False)] + 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(True, False)] + 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 + os.environ["RUST_BACKTRACE"] = "1" kwargs["debug"] = not kwargs["release"] if kwargs.pop("chaos"): |