зеркало из https://github.com/mozilla/pjs.git
Create shell for Narcissus JS (bug 572879, r=gal)
This commit is contained in:
Родитель
093e16b714
Коммит
18110e4101
|
@ -141,7 +141,8 @@ var global = {
|
|||
|
||||
evaluate(snarf(s), s, 1)
|
||||
},
|
||||
print: print, version: null
|
||||
print: print,
|
||||
version: function() { return 185; }
|
||||
};
|
||||
|
||||
// Helper to avoid Object.prototype.hasOwnProperty polluting scope objects.
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
#!/usr/bin/python
|
||||
#
|
||||
# Narcissus 'shell' for use with jstests.py
|
||||
# This must be run from the js/tests directory
|
||||
|
||||
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"
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
op = OptionParser(usage='%prog [TEST-SPECS]')
|
||||
op.add_option('-f', '--file', dest='js_files', action='append',
|
||||
help='JS file to load', metavar='FILE')
|
||||
op.add_option('-e', '--expression', dest='js_exps', action='append',
|
||||
help='JS expression to evaluate')
|
||||
|
||||
(options, args) = op.parse_args()
|
||||
|
||||
cmd = 'evaluate("__NARCISSUS__=true;"); '
|
||||
if options.js_exps:
|
||||
for exp in options.js_exps:
|
||||
cmd += 'evaluate("%s"); ' % exp.replace('"', '\\"')
|
||||
|
||||
if options.js_files:
|
||||
for file in options.js_files:
|
||||
cmd += 'evaluate(snarf("%(file)s"), "%(file)s", 1); ' % {'file':file }
|
||||
|
||||
Popen([js_cmd, '-f', narc_jsdefs, '-f', narc_jslex, '-f', narc_jsparse, '-f', narc_jsexec, '-e', cmd]).wait()
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +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:
|
||||
|
||||
python jstests.py -d -j 4 ../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
|
||||
|
|
@ -0,0 +1 @@
|
|||
include narcissus/jstests.list
|
|
@ -0,0 +1 @@
|
|||
include ../jstests.list
|
|
@ -0,0 +1,7 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/**
|
||||
* Hacks to work around Narcissus-specific problems
|
||||
*/
|
||||
|
||||
// Default for gTestfile for cases relying on __define{GS}etter__
|
||||
gTestfile = "Unspecified";
|
Загрузка…
Ссылка в новой задаче