Skip to content

Commit

Permalink
servo: Merge #19476 - Use workspace.default-members to specify defaul…
Browse files Browse the repository at this point in the history
…t crates for cargo build (from servo:default-members); r=nox

… and 'cargo test', etc. Include Servo and its unit tests, but not Stylo because that would try to compile the style crate with incompatible feature flags: rust-lang/cargo#4463

`workspace.default-members` was added in rust-lang/cargo#4743. Older Cargo versions ignore it.

Source-Repo: https://github.com/servo/servo
Source-Revision: df68eea3f21cc3bbf24d5bbb66be42c4e3a9e427

--HG--
rename : servo/tests/unit/stylo/Cargo.toml => servo/ports/geckolib/tests/Cargo.toml
rename : servo/tests/unit/stylo/build.rs => servo/ports/geckolib/tests/build.rs
rename : servo/tests/unit/stylo/lib.rs => servo/ports/geckolib/tests/lib.rs
rename : servo/tests/unit/stylo/servo_function_signatures.rs => servo/ports/geckolib/tests/servo_function_signatures.rs
rename : servo/tests/unit/stylo/size_of.rs => servo/ports/geckolib/tests/size_of.rs
rename : servo/tests/unit/stylo/specified_values.rs => servo/ports/geckolib/tests/specified_values.rs
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 0939a7049dc771e9d1b4f45f6e3ade2866266fa4
  • Loading branch information
SimonSapin committed Dec 7, 2017
1 parent 951cdf9 commit d35e64e
Show file tree
Hide file tree
Showing 24 changed files with 51 additions and 70 deletions.
15 changes: 0 additions & 15 deletions servo/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion servo/Cargo.toml
@@ -1,8 +1,16 @@
[workspace]
members = [
"ports/cef",
"ports/servo",
"tests/unit/*",

"ports/geckolib",
"ports/geckolib/tests",

"ports/cef",
]
default-members = [
"ports/servo",
"tests/unit/*",
]
exclude = [".cargo"]

Expand Down
4 changes: 4 additions & 0 deletions servo/components/dom_struct/lib.rs
Expand Up @@ -19,5 +19,9 @@ pub fn dom_struct(args: TokenStream, input: TokenStream) -> TokenStream {
#[must_root]
#[repr(C)]
};

// Work around https://github.com/rust-lang/rust/issues/46489
let attributes = attributes.to_string().parse().unwrap();

iter::once(attributes).chain(iter::once(input)).collect()
}
3 changes: 0 additions & 3 deletions servo/ports/geckolib/Cargo.toml
Expand Up @@ -31,6 +31,3 @@ servo_arc = {path = "../../components/servo_arc"}
smallvec = "0.6"
style = {path = "../../components/style", features = ["gecko"]}
style_traits = {path = "../../components/style_traits"}

[dev-dependencies]
stylo_tests = {path = "../../tests/unit/stylo"}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 1 addition & 17 deletions servo/ports/servo/Cargo.toml
Expand Up @@ -13,22 +13,6 @@ path = "main.rs"
test = false
bench = false

[dev-dependencies]
deny_public_fields_tests = {path = "../../tests/unit/deny_public_fields"}
gfx_tests = {path = "../../tests/unit/gfx"}
layout_tests = {path = "../../tests/unit/layout"}
malloc_size_of_tests = {path = "../../tests/unit/malloc_size_of"}
metrics_tests = {path = "../../tests/unit/metrics"}
msg_tests = {path = "../../tests/unit/msg"}
net_tests = {path = "../../tests/unit/net"}
net_traits_tests = {path = "../../tests/unit/net_traits"}
profile_tests = {path = "../../tests/unit/profile"}
script_tests = {path = "../../tests/unit/script"}
script_plugins_tests = {path = "../../tests/unit/script_plugins"}
servo_config_tests = {path = "../../tests/unit/servo_config"}
servo_remutex_tests = {path = "../../tests/unit/servo_remutex"}
style_tests = {path = "../../tests/unit/style"}

[features]
default = ["unstable", "default-except-unstable"]
default-except-unstable = ["webdriver", "max_log_level"]
Expand All @@ -38,7 +22,7 @@ energy-profiling = ["libservo/energy-profiling"]
debugmozjs = ["libservo/debugmozjs"]
googlevr = ["libservo/googlevr"]
oculusvr = ["libservo/oculusvr"]
unstable = ["libservo/unstable", "profile_tests/unstable"]
unstable = ["libservo/unstable"]

[dependencies]
backtrace = "0.3"
Expand Down
6 changes: 2 additions & 4 deletions servo/python/servo/build_commands.py
Expand Up @@ -402,8 +402,7 @@ def build_cef(self, jobs=None, verbose=False, release=False,
self.ensure_clobbered()

ret = None
opts = []
opts += ["--manifest-path", self.cef_manifest()]
opts = ["-p", "embedding"]

if jobs is not None:
opts += ["-j", jobs]
Expand Down Expand Up @@ -458,8 +457,7 @@ def build_geckolib(self, jobs=None, verbose=False, release=False):
env = self.build_env(is_build=True, geckolib=True)

ret = None
opts = []
opts += ["--manifest-path", self.geckolib_manifest()]
opts = ["-p", "geckoservo"]
features = []

if jobs is not None:
Expand Down
2 changes: 1 addition & 1 deletion servo/python/servo/devenv_commands.py
Expand Up @@ -94,7 +94,7 @@ def check(self, params):
'params', default=None, nargs='...',
help="Command-line arguments to be passed through to cargo check")
def check_geckolib(self, params):
return self.run_cargo(params, check=True, geckolib=True)
return self.run_cargo(["-p", "geckoservo"] + (params or []), check=True, geckolib=True)

@Command('cargo-update',
description='Same as update-cargo',
Expand Down
3 changes: 3 additions & 0 deletions servo/python/servo/testing_commands.py
Expand Up @@ -254,6 +254,9 @@ def test_unit(self, test_name=None, package=None, bench=False, nocapture=False):
env = self.build_env()
env["RUST_BACKTRACE"] = "1"

# Work around https://github.com/rust-lang/cargo/issues/4790
del env["RUSTDOCFLAGS"]

if "msvc" in host_triple():
# on MSVC, we need some DLLs in the path. They were copied
# in to the servo.exe build dir, so just point PATH to that.
Expand Down
2 changes: 1 addition & 1 deletion servo/rust-toolchain
@@ -1 +1 @@
nightly-2017-11-14
nightly-2017-12-07
4 changes: 3 additions & 1 deletion servo/tests/unit/gfx/lib.rs
Expand Up @@ -2,6 +2,8 @@
* 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/. */

#![cfg(test)]

extern crate gfx;

#[cfg(test)] mod text_util;
mod text_util;
5 changes: 2 additions & 3 deletions servo/tests/unit/layout/lib.rs
Expand Up @@ -2,7 +2,6 @@
* 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/. */

extern crate layout;
#[macro_use] extern crate size_of_test;

#[cfg(all(test, target_pointer_width = "64"))] extern crate layout;
#[cfg(all(test, target_pointer_width = "64"))] #[macro_use] extern crate size_of_test;
#[cfg(all(test, target_pointer_width = "64"))] mod size_of;
4 changes: 2 additions & 2 deletions servo/tests/unit/metrics/lib.rs
Expand Up @@ -2,6 +2,8 @@
* 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/. */

#![cfg(test)]

extern crate euclid;
extern crate gfx;
extern crate gfx_traits;
Expand All @@ -13,7 +15,5 @@ extern crate profile_traits;
extern crate style;
extern crate time;

#[cfg(test)]
mod interactive_time;
#[cfg(test)]
mod paint_time;
5 changes: 2 additions & 3 deletions servo/tests/unit/msg/lib.rs
Expand Up @@ -2,7 +2,6 @@
* 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/. */

extern crate msg;
#[macro_use] extern crate size_of_test;

#[cfg(all(test, target_pointer_width = "64"))] extern crate msg;
#[cfg(all(test, target_pointer_width = "64"))] #[macro_use] extern crate size_of_test;
#[cfg(all(test, target_pointer_width = "64"))] mod size_of;
26 changes: 14 additions & 12 deletions servo/tests/unit/net/lib.rs
Expand Up @@ -2,6 +2,8 @@
* 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/. */

#![cfg(test)]

extern crate cookie as cookie_rs;
extern crate devtools_traits;
extern crate flate2;
Expand All @@ -19,18 +21,18 @@ extern crate time;
extern crate unicase;
extern crate url;

#[cfg(test)] mod chrome_loader;
#[cfg(test)] mod cookie;
#[cfg(test)] mod cookie_http_state;
#[cfg(test)] mod data_loader;
#[cfg(test)] mod file_loader;
#[cfg(test)] mod fetch;
#[cfg(test)] mod mime_classifier;
#[cfg(test)] mod resource_thread;
#[cfg(test)] mod hsts;
#[cfg(test)] mod http_loader;
#[cfg(test)] mod filemanager_thread;
#[cfg(test)] mod subresource_integrity;
mod chrome_loader;
mod cookie;
mod cookie_http_state;
mod data_loader;
mod fetch;
mod file_loader;
mod filemanager_thread;
mod hsts;
mod http_loader;
mod mime_classifier;
mod resource_thread;
mod subresource_integrity;

use devtools_traits::DevtoolsControlMsg;
use hyper::server::{Handler, Listening, Server};
Expand Down
6 changes: 4 additions & 2 deletions servo/tests/unit/net_traits/lib.rs
Expand Up @@ -2,10 +2,12 @@
* 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/. */

#![cfg(test)]

extern crate net_traits;

#[cfg(test)] mod image;
#[cfg(test)] mod pub_domains;
mod image;
mod pub_domains;

#[test]
fn test_trim_http_whitespace() {
Expand Down
3 changes: 0 additions & 3 deletions servo/tests/unit/profile/Cargo.toml
Expand Up @@ -9,9 +9,6 @@ name = "profile_tests"
path = "lib.rs"
doctest = false

[features]
unstable = ["servo_allocator/unstable"]

[dependencies]
ipc-channel = "0.9"
profile = {path = "../../../components/profile"}
Expand Down
3 changes: 2 additions & 1 deletion servo/tests/unit/profile/lib.rs
Expand Up @@ -2,10 +2,11 @@
* 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/. */

#![cfg(test)]

extern crate ipc_channel;
extern crate profile;
extern crate profile_traits;
extern crate servo_allocator;

#[cfg(test)]
mod time;
2 changes: 1 addition & 1 deletion servo/tests/unit/style/lib.rs
Expand Up @@ -32,7 +32,7 @@ mod parsing;
mod properties;
mod rule_tree;
mod size_of;
#[path = "../stylo/specified_values.rs"]
#[path = "../../../ports/geckolib/tests/specified_values.rs"]
mod specified_values;
mod str;
mod stylesheets;
Expand Down

0 comments on commit d35e64e

Please sign in to comment.