diff --git a/components/servo/Cargo.toml b/components/servo/Cargo.toml index f8d3fa3aa3ef..24ab504b3033 100644 --- a/components/servo/Cargo.toml +++ b/components/servo/Cargo.toml @@ -16,8 +16,20 @@ test = false doc = false bench = false -[dev-dependencies.unit_tests] -path = "../../tests/unit" +[dev-dependencies.gfx_tests] +path = "../../tests/unit/gfx" + +[dev-dependencies.net_tests] +path = "../../tests/unit/net" + +[dev-dependencies.script_tests] +path = "../../tests/unit/script" + +[dev-dependencies.style_tests] +path = "../../tests/unit/style" + +[dev-dependencies.util_tests] +path = "../../tests/unit/util" [[test]] name = "reftest" diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index b93d3689700f..62f4f213fbf8 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -110,8 +110,9 @@ def test_unit(self, test_name=None, component=None, package=None): self.ensure_bootstrapped() return 0 != subprocess.call( - ["cargo", "test", "-p", "unit_tests"] - + test_name, env=self.build_env(), cwd=self.servo_crate()) + ["cargo", "test", "-p", "gfx_tests", "net_tests", "script_tests", + "style_tests", "util_tests"] + test_name, + env=self.build_env(), cwd=self.servo_crate()) @Command('test-ref', description='Run the reference tests', diff --git a/tests/unit/gfx/Cargo.toml b/tests/unit/gfx/Cargo.toml new file mode 100644 index 000000000000..2817c0dc7a8d --- /dev/null +++ b/tests/unit/gfx/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "gfx_tests" +version = "0.0.1" +authors = ["The Servo Project Developers"] + +[lib] +name = "gfx_tests" +path = "lib.rs" +doctest = false + +[dependencies.gfx] +path = "../../components/gfx" + +[dependencies.profile] +path = "../../components/profile" + +[dependencies.geom] +git = "https://github.com/servo/rust-geom" + +[dependencies.string_cache] +git = "https://github.com/servo/string-cache" + +[dependencies.string_cache_plugin] +git = "https://github.com/servo/string-cache" + +[dependencies] +cookie = "*" +url = "*" +hyper = "0.3" diff --git a/tests/unit/lib.rs b/tests/unit/lib.rs deleted file mode 100644 index 05542a17840a..000000000000 --- a/tests/unit/lib.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* 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/. */ - -#![feature(plugin)] -#![cfg_attr(test, feature(net, alloc, path, io))] - -#![plugin(string_cache_plugin)] - -extern crate cssparser; -extern crate geom; -extern crate gfx; -extern crate net; -extern crate net_traits; -extern crate profile; -extern crate script; -extern crate selectors; -extern crate string_cache; -extern crate style; -extern crate util; -extern crate url; - -#[cfg(test)] #[path="gfx/mod.rs"] mod gfx_tests; -#[cfg(test)] #[path="net/mod.rs"] mod net_tests; -#[cfg(test)] #[path="script/mod.rs"] mod script_tests; -#[cfg(test)] #[path="style/mod.rs"] mod style_tests; -#[cfg(test)] #[path="util/mod.rs"] mod util_tests; diff --git a/tests/unit/net/Cargo.toml b/tests/unit/net/Cargo.toml new file mode 100644 index 000000000000..ac655c9941bd --- /dev/null +++ b/tests/unit/net/Cargo.toml @@ -0,0 +1,32 @@ +[package] +name = "net_tests" +version = "0.0.1" +authors = ["The Servo Project Developers"] + +[lib] +name = "net_tests" +path = "lib.rs" +doctest = false + +[dependencies.net] +path = "../../components/net" + +[dependencies.net_traits] +path = "../../components/net_traits" + +[dependencies.cssparser] +git = "https://github.com/servo/rust-cssparser" + +[dependencies.selectors] +git = "https://github.com/servo/rust-selectors" + +[dependencies.string_cache] +git = "https://github.com/servo/string-cache" + +[dependencies.string_cache_plugin] +git = "https://github.com/servo/string-cache" + +[dependencies] +cookie = "*" +url = "*" +hyper = "0.3" diff --git a/tests/unit/Cargo.toml b/tests/unit/script/Cargo.toml similarity index 61% rename from tests/unit/Cargo.toml rename to tests/unit/script/Cargo.toml index 3c3c80a3e4bf..ee219fab74e0 100644 --- a/tests/unit/Cargo.toml +++ b/tests/unit/script/Cargo.toml @@ -1,31 +1,13 @@ [package] -name = "unit_tests" +name = "script_tests" version = "0.0.1" authors = ["The Servo Project Developers"] [lib] -name = "unit_tests" +name = "script_tests" path = "lib.rs" doctest = false -[dependencies.util] -path = "../../components/util" - -[dependencies.gfx] -path = "../../components/gfx" - -[dependencies.net] -path = "../../components/net" - -[dependencies.net_traits] -path = "../../components/net_traits" - -[dependencies.profile] -path = "../../components/profile" - -[dependencies.style] -path = "../../components/style" - [dependencies.script] path = "../../components/script" diff --git a/tests/unit/style/Cargo.toml b/tests/unit/style/Cargo.toml new file mode 100644 index 000000000000..fbebb5e5a94a --- /dev/null +++ b/tests/unit/style/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "style_tests" +version = "0.0.1" +authors = ["The Servo Project Developers"] + +[lib] +name = "style_tests" +path = "lib.rs" +doctest = false + +[dependencies.script] +path = "../../components/script" + +[dependencies.selectors] +git = "https://github.com/servo/rust-selectors" + +[dependencies.string_cache] +git = "https://github.com/servo/string-cache" + +[dependencies.string_cache_plugin] +git = "https://github.com/servo/string-cache" + +[dependencies] +cookie = "*" +url = "*" +hyper = "0.3" diff --git a/tests/unit/util/Cargo.toml b/tests/unit/util/Cargo.toml new file mode 100644 index 000000000000..af6dcd23f633 --- /dev/null +++ b/tests/unit/util/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "util_tests" +version = "0.0.1" +authors = ["The Servo Project Developers"] + +[lib] +name = "util_tests" +path = "lib.rs" +doctest = false + +[dependencies.util] +path = "../../components/util" + +[dependencies.cssparser] +git = "https://github.com/servo/rust-cssparser" + +[dependencies.selectors] +git = "https://github.com/servo/rust-selectors" + +[dependencies.string_cache] +git = "https://github.com/servo/string-cache" + +[dependencies.string_cache_plugin] +git = "https://github.com/servo/string-cache" + +[dependencies] +cookie = "*" +url = "*" +hyper = "0.3"