Skip to content

Commit d35e64e

Browse files
committed
servo: Merge #19476 - Use workspace.default-members to specify default 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
1 parent 951cdf9 commit d35e64e

File tree

24 files changed

+51
-70
lines changed

24 files changed

+51
-70
lines changed

servo/Cargo.lock

Lines changed: 0 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

servo/Cargo.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
[workspace]
22
members = [
3-
"ports/cef",
3+
"ports/servo",
4+
"tests/unit/*",
5+
46
"ports/geckolib",
7+
"ports/geckolib/tests",
8+
9+
"ports/cef",
10+
]
11+
default-members = [
512
"ports/servo",
13+
"tests/unit/*",
614
]
715
exclude = [".cargo"]
816

servo/components/dom_struct/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,9 @@ pub fn dom_struct(args: TokenStream, input: TokenStream) -> TokenStream {
1919
#[must_root]
2020
#[repr(C)]
2121
};
22+
23+
// Work around https://github.com/rust-lang/rust/issues/46489
24+
let attributes = attributes.to_string().parse().unwrap();
25+
2226
iter::once(attributes).chain(iter::once(input)).collect()
2327
}

servo/ports/geckolib/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,3 @@ servo_arc = {path = "../../components/servo_arc"}
3131
smallvec = "0.6"
3232
style = {path = "../../components/style", features = ["gecko"]}
3333
style_traits = {path = "../../components/style_traits"}
34-
35-
[dev-dependencies]
36-
stylo_tests = {path = "../../tests/unit/stylo"}
File renamed without changes.
File renamed without changes.

servo/ports/servo/Cargo.toml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,6 @@ path = "main.rs"
1313
test = false
1414
bench = false
1515

16-
[dev-dependencies]
17-
deny_public_fields_tests = {path = "../../tests/unit/deny_public_fields"}
18-
gfx_tests = {path = "../../tests/unit/gfx"}
19-
layout_tests = {path = "../../tests/unit/layout"}
20-
malloc_size_of_tests = {path = "../../tests/unit/malloc_size_of"}
21-
metrics_tests = {path = "../../tests/unit/metrics"}
22-
msg_tests = {path = "../../tests/unit/msg"}
23-
net_tests = {path = "../../tests/unit/net"}
24-
net_traits_tests = {path = "../../tests/unit/net_traits"}
25-
profile_tests = {path = "../../tests/unit/profile"}
26-
script_tests = {path = "../../tests/unit/script"}
27-
script_plugins_tests = {path = "../../tests/unit/script_plugins"}
28-
servo_config_tests = {path = "../../tests/unit/servo_config"}
29-
servo_remutex_tests = {path = "../../tests/unit/servo_remutex"}
30-
style_tests = {path = "../../tests/unit/style"}
31-
3216
[features]
3317
default = ["unstable", "default-except-unstable"]
3418
default-except-unstable = ["webdriver", "max_log_level"]
@@ -38,7 +22,7 @@ energy-profiling = ["libservo/energy-profiling"]
3822
debugmozjs = ["libservo/debugmozjs"]
3923
googlevr = ["libservo/googlevr"]
4024
oculusvr = ["libservo/oculusvr"]
41-
unstable = ["libservo/unstable", "profile_tests/unstable"]
25+
unstable = ["libservo/unstable"]
4226

4327
[dependencies]
4428
backtrace = "0.3"

servo/python/servo/build_commands.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,7 @@ def build_cef(self, jobs=None, verbose=False, release=False,
402402
self.ensure_clobbered()
403403

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

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

460459
ret = None
461-
opts = []
462-
opts += ["--manifest-path", self.geckolib_manifest()]
460+
opts = ["-p", "geckoservo"]
463461
features = []
464462

465463
if jobs is not None:

servo/python/servo/devenv_commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def check(self, params):
9494
'params', default=None, nargs='...',
9595
help="Command-line arguments to be passed through to cargo check")
9696
def check_geckolib(self, params):
97-
return self.run_cargo(params, check=True, geckolib=True)
97+
return self.run_cargo(["-p", "geckoservo"] + (params or []), check=True, geckolib=True)
9898

9999
@Command('cargo-update',
100100
description='Same as update-cargo',

servo/python/servo/testing_commands.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,9 @@ def test_unit(self, test_name=None, package=None, bench=False, nocapture=False):
254254
env = self.build_env()
255255
env["RUST_BACKTRACE"] = "1"
256256

257+
# Work around https://github.com/rust-lang/cargo/issues/4790
258+
del env["RUSTDOCFLAGS"]
259+
257260
if "msvc" in host_triple():
258261
# on MSVC, we need some DLLs in the path. They were copied
259262
# in to the servo.exe build dir, so just point PATH to that.

servo/rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2017-11-14
1+
nightly-2017-12-07

servo/tests/unit/gfx/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5+
#![cfg(test)]
6+
57
extern crate gfx;
68

7-
#[cfg(test)] mod text_util;
9+
mod text_util;

servo/tests/unit/layout/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
extern crate layout;
6-
#[macro_use] extern crate size_of_test;
7-
5+
#[cfg(all(test, target_pointer_width = "64"))] extern crate layout;
6+
#[cfg(all(test, target_pointer_width = "64"))] #[macro_use] extern crate size_of_test;
87
#[cfg(all(test, target_pointer_width = "64"))] mod size_of;

servo/tests/unit/metrics/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5+
#![cfg(test)]
6+
57
extern crate euclid;
68
extern crate gfx;
79
extern crate gfx_traits;
@@ -13,7 +15,5 @@ extern crate profile_traits;
1315
extern crate style;
1416
extern crate time;
1517

16-
#[cfg(test)]
1718
mod interactive_time;
18-
#[cfg(test)]
1919
mod paint_time;

servo/tests/unit/msg/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
extern crate msg;
6-
#[macro_use] extern crate size_of_test;
7-
5+
#[cfg(all(test, target_pointer_width = "64"))] extern crate msg;
6+
#[cfg(all(test, target_pointer_width = "64"))] #[macro_use] extern crate size_of_test;
87
#[cfg(all(test, target_pointer_width = "64"))] mod size_of;

servo/tests/unit/net/lib.rs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5+
#![cfg(test)]
6+
57
extern crate cookie as cookie_rs;
68
extern crate devtools_traits;
79
extern crate flate2;
@@ -19,18 +21,18 @@ extern crate time;
1921
extern crate unicase;
2022
extern crate url;
2123

22-
#[cfg(test)] mod chrome_loader;
23-
#[cfg(test)] mod cookie;
24-
#[cfg(test)] mod cookie_http_state;
25-
#[cfg(test)] mod data_loader;
26-
#[cfg(test)] mod file_loader;
27-
#[cfg(test)] mod fetch;
28-
#[cfg(test)] mod mime_classifier;
29-
#[cfg(test)] mod resource_thread;
30-
#[cfg(test)] mod hsts;
31-
#[cfg(test)] mod http_loader;
32-
#[cfg(test)] mod filemanager_thread;
33-
#[cfg(test)] mod subresource_integrity;
24+
mod chrome_loader;
25+
mod cookie;
26+
mod cookie_http_state;
27+
mod data_loader;
28+
mod fetch;
29+
mod file_loader;
30+
mod filemanager_thread;
31+
mod hsts;
32+
mod http_loader;
33+
mod mime_classifier;
34+
mod resource_thread;
35+
mod subresource_integrity;
3436

3537
use devtools_traits::DevtoolsControlMsg;
3638
use hyper::server::{Handler, Listening, Server};

servo/tests/unit/net_traits/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5+
#![cfg(test)]
6+
57
extern crate net_traits;
68

7-
#[cfg(test)] mod image;
8-
#[cfg(test)] mod pub_domains;
9+
mod image;
10+
mod pub_domains;
911

1012
#[test]
1113
fn test_trim_http_whitespace() {

servo/tests/unit/profile/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ name = "profile_tests"
99
path = "lib.rs"
1010
doctest = false
1111

12-
[features]
13-
unstable = ["servo_allocator/unstable"]
14-
1512
[dependencies]
1613
ipc-channel = "0.9"
1714
profile = {path = "../../../components/profile"}

servo/tests/unit/profile/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5+
#![cfg(test)]
6+
57
extern crate ipc_channel;
68
extern crate profile;
79
extern crate profile_traits;
810
extern crate servo_allocator;
911

10-
#[cfg(test)]
1112
mod time;

servo/tests/unit/style/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ mod parsing;
3232
mod properties;
3333
mod rule_tree;
3434
mod size_of;
35-
#[path = "../stylo/specified_values.rs"]
35+
#[path = "../../../ports/geckolib/tests/specified_values.rs"]
3636
mod specified_values;
3737
mod str;
3838
mod stylesheets;

0 commit comments

Comments
 (0)