From 627b7d2d90c7cfcec2c8bb6e5b5e2b53ea60d217 Mon Sep 17 00:00:00 2001 From: Paul Joseph Davis Date: Thu, 26 Nov 2009 19:32:08 +0000 Subject: Setup JavaScript command line runner. All JS tests can now be run from the command line using the cURL adapter. In the future I would like to rework this and provide better TAP output. For now, each test is a single TAP assert. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@884675 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/priv/couch_js/main.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/couchdb/priv/couch_js/main.c') diff --git a/src/couchdb/priv/couch_js/main.c b/src/couchdb/priv/couch_js/main.c index ee0e42c9..f8578375 100644 --- a/src/couchdb/priv/couch_js/main.c +++ b/src/couchdb/priv/couch_js/main.c @@ -306,13 +306,21 @@ main(int argc, const char * argv[]) JS_SetGlobalObject(cx, global); - if(argc != 2) { + if(argc > 2) + { fprintf(stderr, "incorrect number of arguments\n\n"); fprintf(stderr, "usage: %s \n", argv[0]); return 2; } - execute_script(cx, global, argv[1]); + if(argc == 0) + { + execute_script(cx, global, NULL); + } + else + { + execute_script(cx, global, argv[1]); + } FINISH_REQUEST(cx); -- cgit v1.2.3