Commits

Paudi Moriarty committed 1a590b2

Add bootstrapFilename option to clojureTest

Allows a clojure file to be required prior to the tests

Comments (0)

Files changed (4)

 .gradle*
 .idea/*
 *.iml
+*.ipr
+buildscript {
+    repositories {
+        mavenCentral()
+        maven { url "http://clojars.org/repo" }
+    }
+
+    dependencies {
+        classpath "de.kotka.gradle:gradle-plugin:1.1.0"
+    }
+}
+
 subprojects {
     group = 'clojuresque'
-    version = '1.6.0-SNAPSHOT'
+    version = '1.6.0-annadale-2'
 
     ext.kotka = [
         repository:     "clojuresque/clojuresque",
     repositories {
         mavenCentral()
     }
+    
 }
 
 project(':clojuresque') {

clojuresque-runtime/src/main/resources/clojuresque/tasks/test_junit.clj

   "Run all tests in the namespaces of the given files by virtue of clojure.test with additional junit output.
    Writes test output to a file called <namespace>.xml in <output-dir>
    XML escapes *out* so that it's safe for inclusion in the JUnit XML report file." 
-  [[output-dir o "Directory to wirite JUnit XML result files."]
+  [[output-dir o "Directory to write JUnit XML result files."]
+   [bootstrap-filename b "Name of file to load before running tests."]
    files]
+  (when bootstrap-filename
+    (load-file bootstrap-filename))
   (.mkdir (java.io.File. output-dir))
   (let [namespaces (namespaces files)]
     (apply require namespaces)

clojuresque/src/main/groovy/clojuresque/tasks/ClojureTestTask.groovy

     def junitOutputDir
 
     def List<String> tests = []
+    
+    def bootstrapFilename
 
     @TaskAction
     public void runTests() {
             )
             if (junit) {
                 main = "clojuresque.tasks.test-junit/test-namespaces"
-                args = ["-o", this.junitOutputDir] + this.source.files
+                args = ["-o", this.junitOutputDir]
+                if (bootstrapFilename) {
+                    args += ["-b", this.bootstrapFilename]
+                }
+                args += this.source.files
             } else {
                 if (tests.size() == 0) {
                     main = "clojuresque.tasks.test/test-namespaces"