Skip to content

Commit

Permalink
this commit adds support for the rhino debugger. if you want to run t…
Browse files Browse the repository at this point in the history
…ests just use bin/test-jquery or bin/test-jquery (version). if you want to run the debugger do bin/test-jquery -d 1.3.2
  • Loading branch information
thatcher committed May 15, 2009
1 parent dabdc17 commit 6210191
Show file tree
Hide file tree
Showing 4 changed files with 835 additions and 31 deletions.
54 changes: 27 additions & 27 deletions bin/jquery-1.3.2-test.js
@@ -1,33 +1,33 @@
// Init
//debugger;
load("build/runtest/env.js");

var isLocal;
window.onload = function(){
isLocal = !!(window.location.protocol == 'file:');
(function($env){

// Load the test runner
load("dist/jquery.js",
"build/runtest/testrunner.js");
//let it load the script from the html
$env.scriptTypes = {
"text/javascript" :true
};

// Load the tests
load(
"test/unit/core.js",
"test/unit/selector.js",
"test/unit/event.js",
"test/unit/fx.js",
"test/unit/dimensions.js",
"test/unit/data.js",

// offset relies on window.open, which is currently unimplemented in env.js
//"test/unit/offset.js",
var count = 0;
window.log = function(result, message){
$env.log('(' + (count++) + ')[' + ((!!result) ? 'PASS' : 'FAIL') + '] ' + message);
};

window.onload = function(){
$env.warn('Defining QUnit.done');
QUnit.done = function(pass, fail){
$env.warn('Writing Results to File');
jQuery('script').each(function(){
this.type = 'text/envjs';
});
$env.writeToFile(
document.documentElement.xml,
$env.location('jqenv.html')
);
};

// these tests require hitting a server, so we will need some clever env.js
// way of testing them
"test/unit/ajax.js"
);
}

// Display the results
results();
};

window.location = "test/index.html";
window.location = "test/index.html";

})(__env__);
25 changes: 21 additions & 4 deletions bin/test-jquery.sh
Expand Up @@ -7,8 +7,18 @@
# massage the testing scripts as necessary, copy our latest version of env.js into place,
# and then run the test scripts.

if [ -n "$1" ]; then VERSION="$1"; else VERSION="1.3.2"; fi
JQUERY_DIR="test/vendor/jQuery/$VERSION"

if [ -n "$2" ]; then
echo 'debug'
if [ -n "$2" ]; then VERSION="$2"; else VERSION="1.3.2"; fi
DEBUG=1
else
echo 'jquery'
if [ -n "$1" ]; then VERSION="$1"; else VERSION="1.3.2"; fi
DEBUG=0
fi

JQUERY_DIR="test/vendor/jQuery/$VERSION";

ant concat

Expand All @@ -20,8 +30,15 @@ cp dist/env.rhino.js $JQUERY_DIR/build/runtest/env.js
cp rhino/js.jar $JQUERY_DIR/build/js.jar
cp bin/jquery-$VERSION-test.js $JQUERY_DIR/build/runtest/test.js

cp test/testrunner.js $JQUERY_DIR/build/runtest/testrunner.js
perl -pi~ -e "s/^JAR(.*)\.jar$/JAR\1.jar -w -debug/" $JQUERY_DIR/Makefile
cp test/qunit.js $JQUERY_DIR/test/qunit/testrunner.js
#perl -pi~ -e "s/^JAR(.*)\.jar$/JAR\1.jar -w -debug/" $JQUERY_DIR/Makefile
if [ $DEBUG -eq 1 ]; then
echo 'enabling rhino debugger'
perl -pi~ -e "s/^JAR(.*)(-jar.*|-cp.*)/JAR\1 -cp \\$\{BUILD_DIR}\/js.jar org.mozilla.javascript.tools.debugger.Main/" $JQUERY_DIR/Makefile;
else
echo 'running with rhino'
perl -pi~ -e "s/^JAR(.*)(-jar.*|-cp.*)/JAR\1 -jar \\$\{BUILD_DIR}\/js.jar -w -debug/" $JQUERY_DIR/Makefile;
fi

cd $JQUERY_DIR
make runtest

0 comments on commit 6210191

Please sign in to comment.