aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2017-11-30 16:49:57 +0100
committerSimon Sapin <simon.sapin@exyr.org>2017-12-07 13:50:10 +0100
commit2a5c4133f9da508949e875ed41b60a2d041e17c7 (patch)
tree50b79bc608c971b13f549f412caa289be9b15e8a
parent9d898cd460712adbacddcfe45f11173605d6cf7b (diff)
downloadservo-2a5c4133f9da508949e875ed41b60a2d041e17c7.tar.gz
servo-2a5c4133f9da508949e875ed41b60a2d041e17c7.zip
Make tests/units/* compile without warnings in non-test mode
(if not usefully)
-rw-r--r--tests/unit/gfx/lib.rs4
-rw-r--r--tests/unit/layout/lib.rs5
-rw-r--r--tests/unit/metrics/lib.rs4
-rw-r--r--tests/unit/msg/lib.rs5
-rw-r--r--tests/unit/net/lib.rs26
-rw-r--r--tests/unit/net_traits/lib.rs6
-rw-r--r--tests/unit/profile/lib.rs3
7 files changed, 29 insertions, 24 deletions
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/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;