about summary refs log tree commit diff
path: root/src/libextra
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2013-09-06 20:29:16 -0700
committerTim Chevalier <chevalier@alum.wellesley.edu>2013-09-08 20:05:12 -0700
commit02a0fb94ee685381b08d138454052b062c8b4f6e (patch)
tree2756bb9fe47d0fc3776bb7f01c46dad8608b5b1d /src/libextra
parentbb30f047f6dbb5c8a73d105b25c2dc23d814b9ba (diff)
downloadrust-02a0fb94ee685381b08d138454052b062c8b4f6e.tar.gz
rust-02a0fb94ee685381b08d138454052b062c8b4f6e.zip
rustpkg: Use workcache
rustpkg now uses the workcache library to avoid recompilation.
Hooray!
Diffstat (limited to 'src/libextra')
-rw-r--r--src/libextra/workcache.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libextra/workcache.rs b/src/libextra/workcache.rs
index bf897e93881..d5d37a30f6b 100644
--- a/src/libextra/workcache.rs
+++ b/src/libextra/workcache.rs
@@ -493,7 +493,7 @@ impl<'self, T:Send +
 #[test]
 fn test() {
     use std::io::WriterUtil;
-    use std::run;
+    use std::{os, run};
 
     let pth = Path("foo.c");
     {
@@ -501,7 +501,12 @@ fn test() {
         r.unwrap().write_str("int main() { return 0; }");
     }
 
-    let cx = Context::new(RWArc::new(Database::new(Path("db.json"))),
+    let db_path = os::self_exe_path().expect("workcache::test failed").pop().push("db.json");
+    if os::path_exists(&db_path) {
+        os::remove_file(&db_path);
+    }
+
+    let cx = Context::new(RWArc::new(Database::new(db_path)),
                           RWArc::new(Logger::new()),
                           Arc::new(TreeMap::new()));