aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/testing_commands.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r--python/servo/testing_commands.py22
1 files changed, 19 insertions, 3 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py
index 506d20874a4..1a4f24716e1 100644
--- a/python/servo/testing_commands.py
+++ b/python/servo/testing_commands.py
@@ -304,6 +304,13 @@ class MachCommands(CommandBase):
"tests/wpt/mozilla/.")
return 0
+ def install_rustfmt(self):
+ with open(os.devnull, "w") as devnull:
+ if self.call_rustup_run(["cargo", "fmt", "--version", "-q"],
+ stderr=devnull) != 0:
+ # Rustfmt is not installed. Install:
+ self.call_rustup_run(["rustup", "component", "add", "rustfmt-preview"])
+
@Command('test-tidy',
description='Run the source code tidiness check',
category='testing')
@@ -322,7 +329,9 @@ class MachCommands(CommandBase):
else:
manifest_dirty = run_update(self.context.topdir, check_clean=True)
tidy_failed = tidy.scan(not all_files, not no_progress, stylo=stylo)
- return tidy_failed or manifest_dirty
+ self.install_rustfmt()
+ rustfmt_failed = self.call_rustup_run(["cargo", "fmt", "--", "--check"])
+ return tidy_failed or manifest_dirty or rustfmt_failed
@Command('test-webidl',
description='Run the WebIDL parser tests',
@@ -443,6 +452,13 @@ class MachCommands(CommandBase):
def update_manifest(self, **kwargs):
return run_update(self.context.topdir, **kwargs)
+ @Command('fmt',
+ description='Format the Rust source files with rustfmt',
+ category='testing')
+ def format_code(self, **kwargs):
+ self.install_rustfmt()
+ return self.call_rustup_run(["cargo", "fmt"])
+
@Command('update-wpt',
description='Update the web platform tests',
category='testing',
@@ -491,7 +507,7 @@ class MachCommands(CommandBase):
for failure in failures:
if tracker_api:
if tracker_api == 'default':
- tracker_api = "http://build.servo.org/intermittent-tracker"
+ tracker_api = "https://build.servo.org/intermittent-tracker"
elif tracker_api.endswith('/'):
tracker_api = tracker_api[0:-1]
@@ -519,7 +535,7 @@ class MachCommands(CommandBase):
if reporter_api:
if reporter_api == 'default':
- reporter_api = "http://build.servo.org/intermittent-failure-tracker"
+ reporter_api = "https://build.servo.org/intermittent-failure-tracker"
if reporter_api.endswith('/'):
reporter_api = reporter_api[0:-1]
reported = set()