]> git.parisson.com Git - pdf.js.git/commitdiff
Add unit-test to master Makefile.
authorKalervo Kujala <kkujala@com>
Sat, 26 Nov 2011 18:24:39 +0000 (20:24 +0200)
committerKalervo Kujala <kkujala@com>
Sat, 26 Nov 2011 18:24:39 +0000 (20:24 +0200)
And add unit-test to test-target. Also fetch the paths to browsers that are
going to be used in testing from the browser_manifest.json.

Makefile
test/unit/Makefile

index caeca9b41e0a6b04476de03b8b60f2029cd09ba6..c06ea5ddca77c2a292d9574e7ca438690661e609 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -43,7 +43,10 @@ PDF_JS_FILES = \
 server:
        @cd test; python test.py --port=8888;
 
-test: shell-test browser-test
+# make test
+#
+# This target runs all the tests. This can be used for testing all browsers.
+test: unit-test shell-test browser-test
 
 #
 # Create production output (pdf.js, and corresponding changes to web files)
@@ -68,6 +71,14 @@ bundle: | $(BUILD_DIR)
        rm -f *.tmp; \
        cd ..
 
+# make unit-test
+#
+# This target runs in-browser unit tests with js-test-driver and jasmine unit
+# test framework.
+
+unit-test:
+       @cd test/unit/ ; make ;
+
 # make browser-test
 #
 # This target runs in-browser tests using two primary arguments: a
index 2f5f5e71c4dab459e3ee93727a98821e3dc0b27f..57ae0c80d2ba2d28741b3319b616386574cab285 100644 (file)
@@ -1,7 +1,20 @@
-PROG=java -Xms512m -Xmx1024m -jar ../../external/jsTestDriver/JsTestDriver-1.3.3d.jar --reset --port 4224 --browser firefox --tests all --testOutput ./test_reports/
+# Fetch the paths to browsers that are going to be used in testing.
+MANIFEST=../resources/browser_manifests/browser_manifest.json
+BROWSERS=$(shell echo `sed -n 's/.*"path":\(.*\)/\1,/p' $(MANIFEST) | tr -d '\n'`)
+
+# Command to invoke the unit test.
+PROG=java \
+-Xms512m \
+-Xmx1024m \
+-jar ../../external/jsTestDriver/JsTestDriver-1.3.3d.jar \
+--reset \
+--port 4224 \
+--browser $(BROWSERS) \
+--tests all \
+--testOutput ./test_reports/
 
 test:
-       $(PROG) ; \
+       $(PROG)
 
 .phony:: test