This repository has been archived by the owner on Aug 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1429511 - Move Rust port of mozrunner to central. r=ahal
This moves the Rust crate mozrunner into central from GitHub. The old repository will be graveyarded: https://github.com/jgraham/rust_mozrunner The git history is not considered important, hence this does not overlay that onto central like we did for testing/geckodriver and testing/webdriver. MozReview-Commit-ID: J4ZYdow2Lkw
- Loading branch information
Showing
6 changed files
with
439 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
name = "mozrunner" | ||
version = "0.5.0" | ||
authors = ["Mozilla Tools and Automation <auto-tools@mozilla.com>"] | ||
description = "Library for starting Firefox binaries." | ||
repository = "https://github.com/jgraham/rust_mozrunner" | ||
license = "MPL-2.0" | ||
|
||
[dependencies] | ||
log = "0.3" | ||
mozprofile = "0.3" | ||
|
||
[target.'cfg(target_os = "windows")'.dependencies] | ||
winreg = "0.3.5" | ||
|
||
[[bin]] | ||
name = "firefox-default-path" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
with Files("**"): | ||
BUG_COMPONENT = ("Testing", "Mozbase Rust") |
17 changes: 17 additions & 0 deletions
17
testing/mozbase/rust/mozrunner/src/bin/firefox-default-path.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
extern crate mozrunner; | ||
|
||
use mozrunner::runner::platform; | ||
use std::io::Write; | ||
|
||
fn main() { | ||
let (path, code) = platform::firefox_default_path() | ||
.map(|x| (x.to_string_lossy().into_owned(), 0)) | ||
.unwrap_or(("Firefox binary not found".to_owned(), 1)); | ||
|
||
let mut writer: Box<Write> = match code { | ||
0 => Box::new(std::io::stdout()), | ||
_ => Box::new(std::io::stderr()) | ||
}; | ||
writeln!(&mut writer, "{}", &*path).unwrap(); | ||
std::process::exit(code); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#[macro_use] extern crate log; | ||
extern crate mozprofile; | ||
#[cfg(target_os = "windows")] | ||
extern crate winreg; | ||
|
||
pub mod runner; | ||
|
||
pub use runner::platform::firefox_default_path; |
Oops, something went wrong.