Skip to content

Commit 18bcde4

Browse files
puredangerstuarthalloway
authored andcommitted
update to latest test.generative, add test.check, reorganize test parts of build
Signed-off-by: Stuart Halloway <[email protected]>
1 parent b01adb8 commit 18bcde4

File tree

4 files changed

+46
-4
lines changed

4 files changed

+46
-4
lines changed

build.xml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
<property name="jtestsrc" location="${test}/java"/>
1212
<property name="cljsrc" location="${src}/clj"/>
1313
<property name="cljscript" location="${src}/script"/>
14-
<property name="test-script" location="${cljscript}/run_tests.clj"/>
14+
<property name="test-script" location="${cljscript}/run_test.clj"/>
15+
<property name="test-generative-script" location="${cljscript}/run_test_generative.clj"/>
1516
<property name="compile-script" location="${cljscript}/bootstrap_compile.clj"/>
1617
<property name="target" location="target"/>
1718
<property name="build" location="${target}/classes"/>
@@ -98,7 +99,7 @@
9899
</java>
99100
</target>
100101

101-
<target name="test"
102+
<target name="test-example"
102103
description="Run clojure tests without recompiling clojure."
103104
depends="compile-tests"
104105
unless="maven.test.skip">
@@ -114,6 +115,26 @@
114115
</java>
115116
</target>
116117

118+
<target name="test-generative"
119+
description="Run test generative tests without recompiling clojure."
120+
depends="compile-tests"
121+
unless="maven.test.skip">
122+
<java classname="clojure.main" failonerror="true" fork="true">
123+
<classpath>
124+
<pathelement path="${maven.test.classpath}"/>
125+
<path location="${test-classes}"/>
126+
<path location="${test}"/>
127+
<path location="${build}"/>
128+
<path location="${cljsrc}"/>
129+
</classpath>
130+
<arg value="${test-generative-script}"/>
131+
</java>
132+
</target>
133+
134+
<target name="test"
135+
description="Run all the tests"
136+
depends="test-example,test-generative"/>
137+
117138
<target name="build"
118139
description="Build Clojure (compilation only, no tests)."
119140
depends="compile-java, compile-clojure"/>

pom.xml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,19 @@
4848
<dependency>
4949
<groupId>org.clojure</groupId>
5050
<artifactId>test.generative</artifactId>
51-
<version>0.4.0</version>
51+
<version>0.5.1</version>
52+
<scope>test</scope>
53+
<exclusions>
54+
<exclusion>
55+
<groupId>org.clojure</groupId>
56+
<artifactId>clojure</artifactId>
57+
</exclusion>
58+
</exclusions>
59+
</dependency>
60+
<dependency>
61+
<groupId>org.clojure</groupId>
62+
<artifactId>test.check</artifactId>
63+
<version>0.5.9</version>
5264
<scope>test</scope>
5365
<exclusions>
5466
<exclusion>

src/script/run_test.clj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
(System/setProperty "java.awt.headless" "true")
2+
(require
3+
'[clojure.test :as test]
4+
'[clojure.tools.namespace :as ns])
5+
(def namespaces (ns/find-namespaces-in-dir (java.io.File. "test")))
6+
(doseq [ns namespaces] (require ns))
7+
(let [summary (apply test/run-tests namespaces)]
8+
(System/exit (if (test/successful? summary) 0 -1)))
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
(System/setProperty "clojure.test.generative.msec" "60000")
21
(System/setProperty "java.awt.headless" "true")
2+
(when-not (System/getProperty "clojure.test.generative.msec")
3+
(System/setProperty "clojure.test.generative.msec" "60000"))
34
(require '[clojure.test.generative.runner :as runner])
45
(runner/-main "test")

0 commit comments

Comments
 (0)