From 6c36aa723c4f5352d279f586278757b35afdc6ad Mon Sep 17 00:00:00 2001 From: Dave Herman Date: Fri, 30 Jul 2010 15:17:14 -0700 Subject: [PATCH] bug 583281, r=jimb: njs should get symlinked into objdir --HG-- rename : js/src/njs => js/src/shell/njs --- js/src/shell/Makefile.in | 6 ++++++ js/src/{ => shell}/njs | 17 ++++++++++------- js/src/tests/narcissus.README | 8 ++++---- 3 files changed, 20 insertions(+), 11 deletions(-) rename js/src/{ => shell}/njs (66%) diff --git a/js/src/shell/Makefile.in b/js/src/shell/Makefile.in index 058b3b20a99..e4bbe04d4cb 100644 --- a/js/src/shell/Makefile.in +++ b/js/src/shell/Makefile.in @@ -41,6 +41,7 @@ DEPTH = .. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ +narcissusdir = $(topsrcdir)/../narcissus include $(DEPTH)/config/autoconf.mk @@ -49,6 +50,7 @@ CPPSRCS = \ js.cpp \ jsworkers.cpp \ $(NULL) +NJS = njs DEFINES += -DEXPORT_JS_API @@ -77,5 +79,9 @@ LDFLAGS += -F/System/Library/PrivateFrameworks -framework CHUD endif # People expect the js shell to wind up in the top-level JS dir. +# The njs script expects to be in the same directory as the js shell as well as +# narcissus/js*.js. libs:: $(INSTALL) $(IFLAGS2) $(PROGRAM) $(DEPTH) + $(INSTALL) $(IFLAGS2) $(narcissusdir) $(DEPTH) + $(INSTALL) $(IFLAGS2) $(srcdir)/$(NJS) $(DEPTH) diff --git a/js/src/njs b/js/src/shell/njs similarity index 66% rename from js/src/njs rename to js/src/shell/njs index a62a09fe11e..91b86abfde7 100755 --- a/js/src/njs +++ b/js/src/shell/njs @@ -1,19 +1,22 @@ #!/usr/bin/python # # Narcissus 'shell' for use with jstests.py -# This must be run from the js/tests directory +# Expects to be in the same directory as ./js +# Expects the Narcissus src files to be in ./narcissus/* import os, re, sys from subprocess import * from optparse import OptionParser -js_cmd="../js" -NARC_JS_DIR = "../../narcissus/" -narc_jsdefs = NARC_JS_DIR + "jsdefs.js" -narc_jslex = NARC_JS_DIR + "jslex.js" -narc_jsparse = NARC_JS_DIR + "jsparse.js" -narc_jsexec = NARC_JS_DIR + "jsexec.js" +THIS_DIR = os.path.dirname(__file__) +NARC_JS_DIR = os.path.abspath(os.path.join(THIS_DIR, 'narcissus')) +js_cmd = os.path.abspath(os.path.join(THIS_DIR, "js")) + +narc_jsdefs = os.path.join(NARC_JS_DIR, "jsdefs.js") +narc_jslex = os.path.join(NARC_JS_DIR, "jslex.js") +narc_jsparse = os.path.join(NARC_JS_DIR, "jsparse.js") +narc_jsexec = os.path.join(NARC_JS_DIR, "jsexec.js") if __name__ == '__main__': diff --git a/js/src/tests/narcissus.README b/js/src/tests/narcissus.README index 4d7368f7c81..8a0e3f3233a 100644 --- a/js/src/tests/narcissus.README +++ b/js/src/tests/narcissus.README @@ -1,12 +1,12 @@ -To run narcissus with jstests.py, make sure that js/src/njs is executable. -Then change to the js/src/tests/ directory and run the following command: +To run narcissus with jstests.py, change to the js/src/tests/ directory and run +the following command: - python jstests.py -d -j 4 ../njs -m narcissus.list + python jstests.py -d -j 4 $OBJDIR/njs -m narcissus.list The js/src/tests/narcissus directory can be used for any tweaks that might be needed to make Narcissus work properly. Currently, Narcissus is failing a number of tests. narcissus-failures.txt can be used to ignore those tests. - python jstests.py -d -j 4 ../njs -m narcissus.list -x narcissus-failures.txt + python jstests.py -d -j 4 $OBJDIR/njs -m narcissus.list -x narcissus-failures.txt