From ea924e398faafc29fafa83312e87410a3575f723 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Fri, 19 Jan 2018 13:18:56 +0100 Subject: [PATCH] Merge net_traits and net_traits_tests --- Cargo.lock | 7 ------- components/net_traits/Cargo.toml | 2 ++ .../net_traits/tests}/image.rs | 2 ++ .../net_traits/tests}/pub_domains.rs | 2 ++ .../net_traits/tests/whitespace.rs | 5 ----- python/servo/testing_commands.py | 2 +- tests/unit/net_traits/Cargo.toml | 13 ------------- 7 files changed, 7 insertions(+), 26 deletions(-) rename {tests/unit/net_traits => components/net_traits/tests}/image.rs (97%) rename {tests/unit/net_traits => components/net_traits/tests}/pub_domains.rs (99%) rename tests/unit/net_traits/lib.rs => components/net_traits/tests/whitespace.rs (94%) delete mode 100644 tests/unit/net_traits/Cargo.toml diff --git a/Cargo.lock b/Cargo.lock index 0c1218d2f7f..a20a0b57080 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1975,13 +1975,6 @@ dependencies = [ "webrender_api 0.56.1 (git+https://github.com/servo/webrender)", ] -[[package]] -name = "net_traits_tests" -version = "0.0.1" -dependencies = [ - "net_traits 0.0.1", -] - [[package]] name = "nodrop" version = "0.1.12" diff --git a/components/net_traits/Cargo.toml b/components/net_traits/Cargo.toml index 82ca26c6b9c..eb1774c6106 100644 --- a/components/net_traits/Cargo.toml +++ b/components/net_traits/Cargo.toml @@ -8,6 +8,8 @@ publish = false [lib] name = "net_traits" path = "lib.rs" +test = false +doctest = false [dependencies] cookie = "0.10" diff --git a/tests/unit/net_traits/image.rs b/components/net_traits/tests/image.rs similarity index 97% rename from tests/unit/net_traits/image.rs rename to components/net_traits/tests/image.rs index e7d2d460d7e..238fae97050 100644 --- a/tests/unit/net_traits/image.rs +++ b/components/net_traits/tests/image.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/. */ +extern crate net_traits; + use net_traits::image::base::detect_image_format; #[test] diff --git a/tests/unit/net_traits/pub_domains.rs b/components/net_traits/tests/pub_domains.rs similarity index 99% rename from tests/unit/net_traits/pub_domains.rs rename to components/net_traits/tests/pub_domains.rs index d18ecb06e0c..36e70cd39a8 100644 --- a/tests/unit/net_traits/pub_domains.rs +++ b/components/net_traits/tests/pub_domains.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/. */ +extern crate net_traits; + use net_traits::pub_domains::{is_pub_domain, is_reg_domain, pub_suffix, reg_suffix}; // These tests may need to be updated if the PSL changes. diff --git a/tests/unit/net_traits/lib.rs b/components/net_traits/tests/whitespace.rs similarity index 94% rename from tests/unit/net_traits/lib.rs rename to components/net_traits/tests/whitespace.rs index 64135a6a2d4..4954e0f67f4 100644 --- a/tests/unit/net_traits/lib.rs +++ b/components/net_traits/tests/whitespace.rs @@ -2,13 +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 net_traits; -mod image; -mod pub_domains; - #[test] fn test_trim_http_whitespace() { fn test_trim(in_: &[u8], out: &[u8]) { diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index 907f6fa531b..0739501a42f 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -231,7 +231,7 @@ class MachCommands(CommandBase): else: test_patterns.append(test) - self_contained_tests = ["gfx", "layout", "msg", "net", "selectors"] + self_contained_tests = ["gfx", "layout", "msg", "net", "net_traits", "selectors"] if not packages: packages = set(os.listdir(path.join(self.context.topdir, "tests", "unit"))) - set(['.DS_Store']) packages |= set(self_contained_tests) diff --git a/tests/unit/net_traits/Cargo.toml b/tests/unit/net_traits/Cargo.toml deleted file mode 100644 index 28da0a1d7c0..00000000000 --- a/tests/unit/net_traits/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "net_traits_tests" -version = "0.0.1" -authors = ["The Servo Project Developers"] -license = "MPL-2.0" - -[lib] -name = "net_traits_tests" -path = "lib.rs" -doctest = false - -[dependencies] -net_traits = {path = "../../../components/net_traits"}