Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1429511 - Move Rust port of mozrunner to central. r=ahal
Browse files Browse the repository at this point in the history
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
andreastt committed Jan 12, 2018
1 parent 9c9b424 commit e7eb1bc
Show file tree
Hide file tree
Showing 6 changed files with 439 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ mobile/android/gradle/.gradle
embedding/ios/GeckoEmbed/GeckoEmbed.xcodeproj/project.xcworkspace/xcuserdata
embedding/ios/GeckoEmbed/GeckoEmbed.xcodeproj/xcuserdata

# Rust port of mozbase are libraries
testing/mozbase/rust/*/target
testing/mozbase/rust/*/Cargo.lock

# Ignore mozharness execution files
testing/mozharness/.tox/
testing/mozharness/build/
Expand Down
17 changes: 17 additions & 0 deletions testing/mozbase/rust/mozrunner/Cargo.toml
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"
6 changes: 6 additions & 0 deletions testing/mozbase/rust/mozrunner/moz.build
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 testing/mozbase/rust/mozrunner/src/bin/firefox-default-path.rs
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);
}
8 changes: 8 additions & 0 deletions testing/mozbase/rust/mozrunner/src/lib.rs
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;
Loading

0 comments on commit e7eb1bc

Please sign in to comment.