diff --git a/.travis.yml b/.travis.yml index f0e0916..c691293 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ sudo: true os: - linux - osx +- windows rust: - stable @@ -26,3 +27,6 @@ script: - cargo test cache: cargo +before_cache: + - rm -rfv target/ + \ No newline at end of file diff --git a/librocksdb-sys/Cargo.toml b/librocksdb-sys/Cargo.toml index 7d08b87..44facbf 100644 --- a/librocksdb-sys/Cargo.toml +++ b/librocksdb-sys/Cargo.toml @@ -20,6 +20,7 @@ libc = "0.2" [dev-dependencies] const-cstr = "0.2" +uuid = { version = "0.7", features = ["v4"] } [build-dependencies] cc = { version = "^1.0", features = ["parallel"] } diff --git a/librocksdb-sys/build.rs b/librocksdb-sys/build.rs index 08262d9..dd072d4 100644 --- a/librocksdb-sys/build.rs +++ b/librocksdb-sys/build.rs @@ -83,8 +83,9 @@ fn build_rocksdb() { config.define("ROCKSDB_LIB_IO_POSIX", Some("1")); } - if cfg!(windows) { + if cfg!(target_os = "windows") { link("rpcrt4", false); + link("shlwapi", false); config.define("OS_WIN", Some("1")); // Remove POSIX-specific sources diff --git a/librocksdb-sys/tests/ffi.rs b/librocksdb-sys/tests/ffi.rs index e5face9..13a1a98 100644 --- a/librocksdb-sys/tests/ffi.rs +++ b/librocksdb-sys/tests/ffi.rs @@ -21,6 +21,7 @@ extern crate const_cstr; extern crate libc; extern crate librocksdb_sys as ffi; +extern crate uuid; use ::ffi::*; use ::libc::*; @@ -33,6 +34,7 @@ use ::std::path::PathBuf; use ::std::ptr; use ::std::slice; use ::std::str; +use ::uuid::Uuid; macro_rules! err_println { ($($arg:tt)*) => (writeln!(&mut ::std::io::stderr(), $($arg)*).expect("failed printing to stderr")); @@ -392,15 +394,17 @@ fn ffi() { let mut err: *mut c_char = ptr::null_mut(); let run: c_int = -1; + let test_uuid = Uuid::new_v4().to_simple(); + let dbname = { let mut dir = GetTempDir(); - dir.push(format!("rocksdb_c_test-{}", geteuid())); + dir.push(format!("rocksdb_c_test-{}", test_uuid)); let path = dir.to_str().unwrap(); CString::new(path).unwrap() }; let dbbackupname = { let mut dir = GetTempDir(); - dir.push(format!("rocksdb_c_test-{}-backup", geteuid())); + dir.push(format!("rocksdb_c_test-{}-backup", test_uuid)); let path = dir.to_str().unwrap(); CString::new(path).unwrap() };