diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-02-04 10:13:52 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-04 10:13:52 -0500 |
commit | 7c112c7dcca276a24883c8e44d203283b545e88e (patch) | |
tree | ecd57d9b4e5c063854ec1efab5f7536fd1b0176c /python | |
parent | 7f7a460a15debe21117f25042059d6f24b99beda (diff) | |
parent | c3b2751eef87c62b4a79973717cc46de7a7abc9e (diff) | |
download | servo-7c112c7dcca276a24883c8e44d203283b545e88e.tar.gz servo-7c112c7dcca276a24883c8e44d203283b545e88e.zip |
Auto merge of #19944 - o0Ignition0o:mach_run_bin, r=jdm
Add a --bin flag to the |mach run and rr-record commands
Add a --bin flag to the |mach run and rr-record commands to specify which servo binary to run
<!-- Please describe your changes on the following line: -->
Step 1 for #19505.
This flag allows to specify a downloaded servo binary for the ./mach run and ./mach rr-record commands.
The base issue is mentored by @jdm
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).
<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because | I would love to write tests on this, but I'm not really sure I can, since it's on ./mach commands
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19944)
<!-- Reviewable:end -->
Diffstat (limited to 'python')
-rw-r--r-- | python/servo/post_build_commands.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py index eab7eaf0518..30d1eed9bc0 100644 --- a/python/servo/post_build_commands.py +++ b/python/servo/post_build_commands.py @@ -59,11 +59,13 @@ class PostBuildCommands(CommandBase): help='Launch in headless mode') @CommandArgument('--software', '-s', action='store_true', help='Launch with software rendering') + @CommandArgument('--bin', default=None, + help='Launch with specific binary') @CommandArgument( 'params', nargs='...', help="Command-line arguments to be passed through to Servo") def run(self, params, release=False, dev=False, android=None, debug=False, debugger=None, browserhtml=False, - headless=False, software=False): + headless=False, software=False, bin=None): env = self.build_env() env["RUST_BACKTRACE"] = "1" @@ -96,7 +98,7 @@ class PostBuildCommands(CommandBase): shell.communicate("\n".join(script) + "\n") return shell.wait() - args = [self.get_binary_path(release, dev)] + args = [bin or self.get_binary_path(release, dev)] if browserhtml: browserhtml_path = get_browserhtml_path(args[0]) @@ -173,14 +175,16 @@ class PostBuildCommands(CommandBase): help='Use release build') @CommandArgument('--dev', '-d', action='store_true', help='Use dev build') + @CommandArgument('--bin', default=None, + help='Launch with specific binary') @CommandArgument( 'params', nargs='...', help="Command-line arguments to be passed through to Servo") - def rr_record(self, release=False, dev=False, params=[]): + def rr_record(self, release=False, dev=False, bin=None, params=[]): env = self.build_env() env["RUST_BACKTRACE"] = "1" - servo_cmd = [self.get_binary_path(release, dev)] + params + servo_cmd = [bin or self.get_binary_path(release, dev)] + params rr_cmd = ['rr', '--fatal-errors', 'record'] try: check_call(rr_cmd + servo_cmd) |