couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r1086775 - /couchdb/trunk/test/javascript/run.tpl
Date Tue, 29 Mar 2011 22:05:34 GMT
Author: davisp
Date: Tue Mar 29 22:05:34 2011
New Revision: 1086775

URL: http://svn.apache.org/viewvc?rev=1086775&view=rev
Log:
Allow JS test runner to run individual tests.

You can now do the following:

    $ ./test/javascript/run
    $ ./test/javascript/run basics
    $ ./test/javascript/run basics.js
    $ ./test/javascript/run share/www/script/test/basics.js

Thanks to Dale Harvey for the patch.

Closes COUCHDB-1112


Modified:
    couchdb/trunk/test/javascript/run.tpl

Modified: couchdb/trunk/test/javascript/run.tpl
URL: http://svn.apache.org/viewvc/couchdb/trunk/test/javascript/run.tpl?rev=1086775&r1=1086774&r2=1086775&view=diff
==============================================================================
--- couchdb/trunk/test/javascript/run.tpl (original)
+++ couchdb/trunk/test/javascript/run.tpl Tue Mar 29 22:05:34 2011
@@ -18,13 +18,30 @@ JS_TEST_DIR=$SRC_DIR/test/javascript
 
 COUCHJS=%abs_top_builddir%/src/couchdb/priv/couchjs
 
+if [ "$#" -eq 0 ];
+then
+    TEST_SRC="$SCRIPT_DIR/test/*.js"
+else
+    TEST_SRC="$1"
+    if [ ! -f $TEST_SRC ]; then
+        TEST_SRC="$SCRIPT_DIR/test/$1"
+        if [ ! -f $TEST_SRC ]; then
+            TEST_SRC="$SCRIPT_DIR/test/$1.js"
+            if [ ! -f $TEST_SRC ]; then
+                echo "file $1 does not exist"
+                exit
+            fi
+        fi
+    fi
+fi
+
 cat $SCRIPT_DIR/json2.js \
 	$SCRIPT_DIR/sha1.js \
 	$SCRIPT_DIR/oauth.js \
 	$SCRIPT_DIR/couch.js \
 	$SCRIPT_DIR/couch_test_runner.js \
 	$SCRIPT_DIR/couch_tests.js \
-	$SCRIPT_DIR/test/*.js \
+	$TEST_SRC \
 	$JS_TEST_DIR/couch_http.js \
 	$JS_TEST_DIR/cli_runner.js \
     | $COUCHJS -H -



Mime
View raw message