You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2014/02/05 15:51:08 UTC
[46/49] couchdb commit: updated refs/heads/1843-feature-bigcouch to
3069c01
Make the JavaScript test runner work
This is currently removing a bunch of stuff that we normally use during
the test suite so that I can get the test runner going. I full intend to
undo these changes in the future.
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/0bb58f51
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/0bb58f51
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/0bb58f51
Branch: refs/heads/1843-feature-bigcouch
Commit: 0bb58f51e68cb58d215d53088a0839f595512b7a
Parents: 03ea534
Author: Paul J. Davis <pa...@gmail.com>
Authored: Tue Feb 4 22:06:00 2014 -0600
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Wed Feb 5 08:34:52 2014 -0600
----------------------------------------------------------------------
.gitignore | 2 ++
configure | 4 +++
test/javascript/run.tpl | 68 ++++----------------------------------------
3 files changed, 11 insertions(+), 63 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/0bb58f51/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 902035d..8ea2016 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,3 +15,5 @@ share/server/main.js
src/couch/priv/couch_js/config.h
src/couch/priv/couchjs
src/couch/priv/couchspawnkillable
+
+test/javascript/run
http://git-wip-us.apache.org/repos/asf/couchdb/blob/0bb58f51/configure
----------------------------------------------------------------------
diff --git a/configure b/configure
index 7036d7c..24c7cea 100755
--- a/configure
+++ b/configure
@@ -104,6 +104,10 @@ cat > $rootdir/config.erl << EOF
{with_curl, $WITH_CURL}.
EOF
+# Write out the JavaScript test command
+sed -e "s|%rootdir%|$rootdir|" < test/javascript/run.tpl > test/javascript/run
+chmod +x test/javascript/run
+
# finally, a few config files for local development nodes
for i in 1 2 3; do
cat > rel/dev$i.config << EOF
http://git-wip-us.apache.org/repos/asf/couchdb/blob/0bb58f51/test/javascript/run.tpl
----------------------------------------------------------------------
diff --git a/test/javascript/run.tpl b/test/javascript/run.tpl
index 75192da..c0fd693 100644
--- a/test/javascript/run.tpl
+++ b/test/javascript/run.tpl
@@ -12,73 +12,26 @@
# License for the specific language governing permissions and limitations under
# the License.
-SRC_DIR=%abs_top_srcdir%
-BUILD_DIR=%abs_top_builddir%
+SRC_DIR=%rootdir%
+BUILD_DIR=%rootdir%
SCRIPT_DIR=$SRC_DIR/share/www/script
JS_TEST_DIR=$SRC_DIR/test/javascript
+COUCHJS=%rootdir%/src/couch/priv/couchjs
-COUCHJS=%abs_top_builddir%/src/couchdb/priv/couchjs
-COUCH_URI_FILE=%localstaterundir%/couch.uri
-
-# make check-js calls us with MAKE=$(MAKE) so BSDish `gmake` invocations
-# will get passed on correctly. If $0 gets run manually, default to
-# `make`
-if [ -z "$MAKE" ]; then
- MAKE=make
-fi
-
-trap 'abort' EXIT INT
-
-start() {
- ./utils/run -b -r 0 -n \
- -a $BUILD_DIR/etc/couchdb/default_dev.ini \
- -a $SRC_DIR/test/random_port.ini \
- -a $BUILD_DIR/etc/couchdb/local_dev.ini 1>/dev/null
-}
-
-stop() {
- ./utils/run -d 1>/dev/null
-}
-
-restart() {
- stop
- start
-}
-
-abort() {
- trap - 0
- stop
- exit 2
-}
-
-process_response() {
- while read data
- do
- if [ $data = 'restart' ];
- then
- if [ -z $COUCHDB_NO_START ]; then
- restart
- fi
- else
- echo "$data"
- fi
- done
-}
run() {
# start the tests
/bin/echo -n "$1 ... "
- $COUCHJS -H -u $COUCH_URI_FILE \
+ $COUCHJS -H \
$SCRIPT_DIR/json2.js \
$SCRIPT_DIR/sha1.js \
$SCRIPT_DIR/oauth.js \
$SCRIPT_DIR/couch.js \
- $SCRIPT_DIR/replicator_db_inc.js \
$SCRIPT_DIR/couch_test_runner.js \
$JS_TEST_DIR/couch_http.js \
$JS_TEST_DIR/test_setup.js \
$1 \
- $JS_TEST_DIR/cli_runner.js | process_response
+ $JS_TEST_DIR/cli_runner.js
if [ -z $RESULT ]; then
RESULT=$?
@@ -100,12 +53,6 @@ run_files() {
done
}
-# start CouchDB
-if [ -z $COUCHDB_NO_START ]; then
- $MAKE dev
- start
-fi
-
echo "Running javascript tests ..."
if [ "$#" -eq 0 ];
@@ -130,9 +77,4 @@ else
run $TEST_SRC
fi
-if [ -z $COUCHDB_NO_START ]; then
- stop
-fi
-
-trap - 0
exit $RESULT