Skip to content

Commit 4d1bfbf

Browse files
wip: move tests into their own directory, run them with script/test
1 parent bbe37dd commit 4d1bfbf

File tree

9 files changed

+667
-627
lines changed

9 files changed

+667
-627
lines changed

devnotes/testing

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Definitely a work-in-progress.
2+
3+
To run tests before you commit:
4+
5+
script/test
6+
7+
To add tests:
8+
9+
* Create test fiels in the test/cljs directory.
10+
* Write fns that throw an exception on failure.
11+
* Call those fns from test/cljs/cljs/test_runner.cljs
12+
13+

script/repl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
2-
java -server -Xmx2G -Xms2G -Xmn256m -cp 'lib/*:src/clj:src/cljs' clojure.main
2+
java -server -Xmx2G -Xms2G -Xmn256m -cp 'lib/*:src/clj:src/cljs:test/cljs' clojure.main
33

script/repljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
java -server -Xmx2G -Xms2G -Xmn256m -cp 'lib/*:src/clj:src/cljs' clojure.main -e \
2+
java -server -Xmx2G -Xms2G -Xmn256m -cp 'lib/*:src/clj:src/cljs:test/cljs' clojure.main -e \
33
"(require '[cljs.compiler :as comp])
44
(def jse (comp/repl-env))
55
(comp/repl jse)"

script/test

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
mkdir -p out
2+
3+
bin/cljsc test > out/core-test.js
4+
bin/cljsc test {:optimizations :advanced} > out/core-advanced-test.js
5+
6+
if [ "$V8_HOME" == "" ]; then
7+
echo "V8_HOME not set, skipping V8 tests"
8+
else
9+
${V8_HOME}/d8 out/core-advanced-test.js
10+
# TODO: figure out path problem when not in advanced mode
11+
# ${V8_HOME}/d8 out/core-test.js
12+
fi
13+
14+
# TODO : run tests with rhino if available

0 commit comments

Comments
 (0)