diff --git a/Cargo.lock b/Cargo.lock index 3f7834fc5ff..acf8dfff8ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1050,7 +1050,6 @@ dependencies = [ "smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "style 0.0.1", "style_traits 0.0.1", - "stylo_tests 0.0.1", ] [[package]] @@ -2807,24 +2806,10 @@ dependencies = [ "android_injected_glue 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "browserhtml 0.1.17 (git+https://github.com/browserhtml/browserhtml?branch=crate)", - "deny_public_fields_tests 0.0.1", - "gfx_tests 0.0.1", "glutin_app 0.0.1", - "layout_tests 0.0.1", "libservo 0.0.1", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "malloc_size_of_tests 0.0.1", - "metrics_tests 0.0.1", - "msg_tests 0.0.1", - "net_tests 0.0.1", - "net_traits_tests 0.0.1", - "profile_tests 0.0.1", - "script_plugins_tests 0.0.1", - "script_tests 0.0.1", - "servo_config_tests 0.0.1", - "servo_remutex_tests 0.0.1", "sig 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "style_tests 0.0.1", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 4dc921c54e6..3bde2968df8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,16 @@ [workspace] members = [ - "ports/cef", - "ports/geckolib", "ports/servo", + "tests/unit/*", + + "ports/geckolib", + "ports/geckolib/tests", + + "ports/cef", +] +default-members = [ + "ports/servo", + "tests/unit/*", ] exclude = [".cargo"] diff --git a/components/dom_struct/lib.rs b/components/dom_struct/lib.rs index a955f00ce87..41cf4a67527 100644 --- a/components/dom_struct/lib.rs +++ b/components/dom_struct/lib.rs @@ -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() } diff --git a/ports/geckolib/Cargo.toml b/ports/geckolib/Cargo.toml index 70ffc615d9b..9fbe688571a 100644 --- a/ports/geckolib/Cargo.toml +++ b/ports/geckolib/Cargo.toml @@ -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"} diff --git a/tests/unit/stylo/Cargo.toml b/ports/geckolib/tests/Cargo.toml similarity index 100% rename from tests/unit/stylo/Cargo.toml rename to ports/geckolib/tests/Cargo.toml diff --git a/tests/unit/stylo/build.rs b/ports/geckolib/tests/build.rs similarity index 100% rename from tests/unit/stylo/build.rs rename to ports/geckolib/tests/build.rs diff --git a/tests/unit/stylo/lib.rs b/ports/geckolib/tests/lib.rs similarity index 100% rename from tests/unit/stylo/lib.rs rename to ports/geckolib/tests/lib.rs diff --git a/tests/unit/stylo/servo_function_signatures.rs b/ports/geckolib/tests/servo_function_signatures.rs similarity index 100% rename from tests/unit/stylo/servo_function_signatures.rs rename to ports/geckolib/tests/servo_function_signatures.rs diff --git a/tests/unit/stylo/size_of.rs b/ports/geckolib/tests/size_of.rs similarity index 100% rename from tests/unit/stylo/size_of.rs rename to ports/geckolib/tests/size_of.rs diff --git a/tests/unit/stylo/specified_values.rs b/ports/geckolib/tests/specified_values.rs similarity index 100% rename from tests/unit/stylo/specified_values.rs rename to ports/geckolib/tests/specified_values.rs diff --git a/ports/servo/Cargo.toml b/ports/servo/Cargo.toml index 489b6f63515..e872da5fe11 100644 --- a/ports/servo/Cargo.toml +++ b/ports/servo/Cargo.toml @@ -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"] @@ -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" diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index 2ec27f00364..ea6ddca8725 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -402,8 +402,7 @@ class MachCommands(CommandBase): self.ensure_clobbered() ret = None - opts = [] - opts += ["--manifest-path", self.cef_manifest()] + opts = ["-p", "embedding"] if jobs is not None: opts += ["-j", jobs] @@ -458,8 +457,7 @@ class MachCommands(CommandBase): 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: diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py index e6cb91bd20a..1ddba4af445 100644 --- a/python/servo/devenv_commands.py +++ b/python/servo/devenv_commands.py @@ -94,7 +94,7 @@ class MachCommands(CommandBase): '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', diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index a72b6ef8f70..e0b9a4e7b28 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -254,6 +254,9 @@ class MachCommands(CommandBase): 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. diff --git a/rust-toolchain b/rust-toolchain index 45c170f9e3f..3e5d257a285 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2017-11-14 +nightly-2017-12-07 diff --git a/tests/unit/gfx/lib.rs b/tests/unit/gfx/lib.rs index 9a5040b6fe1..a8120a50138 100644 --- a/tests/unit/gfx/lib.rs +++ b/tests/unit/gfx/lib.rs @@ -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; diff --git a/tests/unit/layout/lib.rs b/tests/unit/layout/lib.rs index a763135260a..d9e72841199 100644 --- a/tests/unit/layout/lib.rs +++ b/tests/unit/layout/lib.rs @@ -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; diff --git a/tests/unit/metrics/lib.rs b/tests/unit/metrics/lib.rs index abd6970f848..d773a632867 100644 --- a/tests/unit/metrics/lib.rs +++ b/tests/unit/metrics/lib.rs @@ -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; @@ -13,7 +15,5 @@ extern crate profile_traits; extern crate style; extern crate time; -#[cfg(test)] mod interactive_time; -#[cfg(test)] mod paint_time; diff --git a/tests/unit/msg/lib.rs b/tests/unit/msg/lib.rs index c1bc9a119d9..62e591ef800 100644 --- a/tests/unit/msg/lib.rs +++ b/tests/unit/msg/lib.rs @@ -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; diff --git a/tests/unit/net/lib.rs b/tests/unit/net/lib.rs index 1d34d700a60..773b7f387f8 100644 --- a/tests/unit/net/lib.rs +++ b/tests/unit/net/lib.rs @@ -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; @@ -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}; diff --git a/tests/unit/net_traits/lib.rs b/tests/unit/net_traits/lib.rs index 3f722e5fc63..64135a6a2d4 100644 --- a/tests/unit/net_traits/lib.rs +++ b/tests/unit/net_traits/lib.rs @@ -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() { diff --git a/tests/unit/profile/Cargo.toml b/tests/unit/profile/Cargo.toml index 0d04fba813f..026593d80fa 100644 --- a/tests/unit/profile/Cargo.toml +++ b/tests/unit/profile/Cargo.toml @@ -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"} diff --git a/tests/unit/profile/lib.rs b/tests/unit/profile/lib.rs index 110d8adedb4..2b97cd68cb3 100644 --- a/tests/unit/profile/lib.rs +++ b/tests/unit/profile/lib.rs @@ -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; diff --git a/tests/unit/style/lib.rs b/tests/unit/style/lib.rs index 07d83afa261..9bcc92965e8 100644 --- a/tests/unit/style/lib.rs +++ b/tests/unit/style/lib.rs @@ -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;