From 75ec33f0d403215980119dac2946ae8514d5c3f1 Mon Sep 17 00:00:00 2001 From: Phil Hagelberg Date: Sun, 13 Nov 2011 11:20:29 -0800 Subject: [PATCH] Add :offline test selector. --- project.clj | 1 + test/leiningen/test/deps.clj | 12 ++++++------ test/leiningen/test/install.clj | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/project.clj b/project.clj index 7224851b..43d7cffe 100644 --- a/project.clj +++ b/project.clj @@ -13,5 +13,6 @@ [jline "0.9.94" :exclusions [junit]] [robert/hooke "1.1.2"] [org.apache.maven/maven-ant-tasks "2.1.3" :exclusions [ant]]] + :test-selectors {:offline (complement :online)} :disable-implicit-clean true :eval-in-leiningen true) diff --git a/test/leiningen/test/deps.clj b/test/leiningen/test/deps.clj index 1a666cf6..d13a4791 100644 --- a/test/leiningen/test/deps.clj +++ b/test/leiningen/test/deps.clj @@ -12,7 +12,7 @@ (some #(re-find re (.getName %)) (file-seq (file (:library-path project))))) -(deftest test-deps +(deftest ^{:online true} test-deps (delete-file-recursively (:library-path sample-project) true) (deps sample-project) (let [jars (set (map #(.getName %) @@ -20,7 +20,7 @@ (doseq [j ["jdom-1.0.jar" "tagsoup-1.2.jar" "rome-0.9.jar"]] (is (jars j))))) -(deftest test-dev-deps-only +(deftest ^{:online true} test-dev-deps-only (delete-file-recursively (:library-path dev-deps-project) true) (deps dev-deps-project) (let [jars (set (map #(.getName %) @@ -28,7 +28,7 @@ "lib" "dev"))))] (is (contains? jars "clojure-1.2.0.jar")))) -(deftest test-snapshots-releases +(deftest ^{:online true} test-snapshots-releases (try (let [pr (assoc sample-project :omit-default-repositories true :repositories {"clojars" {:url "http://clojars.org/repo/" @@ -88,7 +88,7 @@ :solaris {:x86 #{"liblwjgl.so" "libopenal.so"} :x86_64 #{"liblwjgl64.so" "libopenal.so"}}}) -(deftest test-native-deps +(deftest ^{:online true} test-native-deps (delete-file-recursively (:library-path native-project) true) (delete-file-recursively (:native-path native-project) true) (deps native-project) @@ -96,7 +96,7 @@ (set (for [f (rest (file-seq (native-arch-path native-project)))] (.getName f)))))) -(deftest test-checksum-deps +(deftest ^{:online true} test-checksum-deps (delete-file-recursively (:library-path sample-project) true) (deps (assoc sample-project :checksum-deps true)) (let [deps-ran (atom false)] @@ -104,7 +104,7 @@ (deps (assoc sample-project :checksum-deps true)) (is (not @deps-ran))))) -(deftest test-explicit-checksum-deps +(deftest ^{:online true} test-explicit-checksum-deps (delete-file-recursively (:library-path sample-project) true) (deps (assoc sample-project :checksum-deps true)) (let [deps-ran (atom false)] diff --git a/test/leiningen/test/install.clj b/test/leiningen/test/install.clj index de44e4c3..779941e8 100644 --- a/test/leiningen/test/install.clj +++ b/test/leiningen/test/install.clj @@ -26,7 +26,7 @@ (def jdom-dir (file local-repo "jdom" "jdom" "1.0")) -(deftest test-standalone-install +(deftest ^{:online true} test-standalone-install (delete-file-recursively jdom-dir true) (delete-shell-wrappers) (install "nomnomnom" "0.5.0-SNAPSHOT")