diff --git a/.travis.yml b/.travis.yml index 8c2b2d3a..d0800de2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,5 @@ install: before_script: - ./travis/setup.sh script: - - rustc --lib --out-dir . src/postgres/lib.rs - - rustc --test --out-dir . -L. --cfg travis src/postgres/test.rs + - rustc --test --cfg travis -o test lib.rs - ./test -# - rustpkg test postgres diff --git a/src/postgres/error.rs b/error.rs similarity index 100% rename from src/postgres/error.rs rename to error.rs diff --git a/src/postgres/lib.rs b/lib.rs similarity index 99% rename from src/postgres/lib.rs rename to lib.rs index c7f36a29..110cd143 100644 --- a/src/postgres/lib.rs +++ b/lib.rs @@ -126,6 +126,9 @@ pub mod pool; mod message; pub mod types; +#[cfg(test)] +mod test; + /// Trait for types that can handle Postgres notice messages pub trait PostgresNoticeHandler { /// Handle a Postgres notice message diff --git a/src/postgres/message.rs b/message.rs similarity index 100% rename from src/postgres/message.rs rename to message.rs diff --git a/src/postgres/pool.rs b/pool.rs similarity index 100% rename from src/postgres/pool.rs rename to pool.rs diff --git a/src/postgres/test.rs b/test.rs similarity index 97% rename from src/postgres/test.rs rename to test.rs index 7df8d18f..027e969f 100644 --- a/src/postgres/test.rs +++ b/test.rs @@ -1,5 +1,4 @@ extern mod extra; -extern mod postgres; use extra::comm::DuplexStream; use extra::future::Future; @@ -11,20 +10,19 @@ use extra::uuid::Uuid; use std::f32; use std::f64; -use postgres::{PostgresNoticeHandler, - PostgresNotification, - DbError, - DnsError, - MissingPassword, - Position, - PostgresConnection, - PostgresDbError, - PostgresStatement, - ResultDescription}; -use postgres::error::hack::{SyntaxError, InvalidPassword}; -use postgres::types::{ToSql, FromSql, PgInt4, PgVarchar}; -use postgres::pool::PostgresConnectionPool; - +use super::{PostgresNoticeHandler, + PostgresNotification, + DbError, + DnsError, + MissingPassword, + Position, + PostgresConnection, + PostgresDbError, + PostgresStatement, + ResultDescription}; +use super::error::hack::{SyntaxError, InvalidPassword}; +use super::types::{ToSql, FromSql, PgInt4, PgVarchar}; +use super::pool::PostgresConnectionPool; #[test] // Make sure we can take both connections at once and can still get one after diff --git a/src/postgres/types.rs b/types.rs similarity index 100% rename from src/postgres/types.rs rename to types.rs