Skip to content

Commit

Permalink
Make tests/units/* compile without warnings in non-test mode
Browse files Browse the repository at this point in the history
(if not usefully)
  • Loading branch information
SimonSapin committed Dec 7, 2017
1 parent 9d898cd commit 2a5c413
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 24 deletions.
4 changes: 3 additions & 1 deletion tests/unit/gfx/lib.rs
Expand Up @@ -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;
5 changes: 2 additions & 3 deletions tests/unit/layout/lib.rs
Expand Up @@ -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;
4 changes: 2 additions & 2 deletions tests/unit/metrics/lib.rs
Expand Up @@ -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;
Expand All @@ -13,7 +15,5 @@ extern crate profile_traits;
extern crate style;
extern crate time;

#[cfg(test)]
mod interactive_time;
#[cfg(test)]
mod paint_time;
5 changes: 2 additions & 3 deletions tests/unit/msg/lib.rs
Expand Up @@ -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;
26 changes: 14 additions & 12 deletions tests/unit/net/lib.rs
Expand Up @@ -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;
Expand All @@ -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};
Expand Down
6 changes: 4 additions & 2 deletions tests/unit/net_traits/lib.rs
Expand Up @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/profile/lib.rs
Expand Up @@ -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;

0 comments on commit 2a5c413

Please sign in to comment.