diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/servo/build_commands.py | 4 | ||||
-rw-r--r-- | python/servo/testing_commands.py | 39 |
2 files changed, 22 insertions, 21 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index 30d6618f19b..1cf23237807 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -393,9 +393,7 @@ class MachCommands(CommandBase): expr = "s#libdir=.*#libdir=%s#g" % gst_lib_path subprocess.call(["perl", "-i", "-pe", expr, pc]) - # https://internals.rust-lang.org/t/exploring-crate-graph-build-times-with-cargo-build-ztimings/10975 - # Prepend so that e.g. `-Ztimings` (which means `-Ztimings=info,html`) - # given on the command line can override it + # Gather Cargo build timings (https://doc.rust-lang.org/cargo/reference/timings.html). opts = ["--timings"] + opts if very_verbose: diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index 291a00b15c0..1090ec65cab 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -245,24 +245,27 @@ class MachCommands(CommandBase): packages.discard('stylo') - if len(packages) > 0 or len(in_crate_packages) > 0: - args = [] - for crate in packages: - args += ["-p", "%s_tests" % crate] - for crate in in_crate_packages: - args += ["-p", crate] - args += test_patterns - - if nocapture: - args += ["--", "--nocapture"] - - err = self.run_cargo_build_like_command("bench" if bench else "test", - args, - env=self.build_env(test_unit=True), - with_layout_2020=with_layout_2020, - **kwargs) - if err: - return err + # Return if there is nothing to do. + if len(packages) == 0 and len(in_crate_packages) == 0: + return 0 + + # Gather Cargo build timings (https://doc.rust-lang.org/cargo/reference/timings.html). + args = ["--timings"] + for crate in packages: + args += ["-p", "%s_tests" % crate] + for crate in in_crate_packages: + args += ["-p", crate] + args += test_patterns + + if nocapture: + args += ["--", "--nocapture"] + + return self.run_cargo_build_like_command( + "bench" if bench else "test", + args, + env=self.build_env(test_unit=True), + with_layout_2020=with_layout_2020, + **kwargs) @Command('test-content', description='Run the content tests', |