Skip to content

Commit

Permalink
added a basic skepeton for checkout of prototype development head to …
Browse files Browse the repository at this point in the history
…begin unit test integration
  • Loading branch information
thatcher committed May 21, 2009
1 parent ff986ea commit 87c8d20
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
34 changes: 34 additions & 0 deletions bin/prototype-1.6.0.3-test.js
@@ -0,0 +1,34 @@
//debugger;
load("build/runtest/env.js");

(function($env){

$env("test/index.html", {
//let it load the script from the html
scriptTypes: {
"text/javascript" :true
},
afterload:{
'qunit/testrunner.js': function(){
//hook into qunit.log
var count = 0;
QUnit.log = function(result, message){
$env.log('(' + (count++) + ')[' +
((!!result) ? 'PASS' : 'FAIL') + '] ' + message);
};
//hook into 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')
);
};
}
}
});

})(Envjs);
48 changes: 48 additions & 0 deletions bin/test-prototype.sh
@@ -0,0 +1,48 @@
#!/bin/sh

# Usage: test-prototype.sh [version]
# Currently supported versions: 1.6.0.3
#
# This script will check out the Prototype development tree from Github if necessary,
# massage the testing scripts as necessary, copy our latest version of env.js into place,
# and then run the test scripts.


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

PROTOTYPE_DIR="test/vendor/Prototype/$VERSION";

ant concat

if [ ! -d "$PROTOTYPE_DIR" ]; then
git clone git://github.com/sstephenson/prototype.git $PROTOTYPE_DIR
cd $PROTOTYPE_DIR
rake test #prepares tests
cd -
fi

cp dist/env.rhino.js $PROTOTYPE_DIR/test/env.js
cp rhino/js.jar $PROTOTYPE_DIR/test/js.jar
cp bin/prototype-$VERSION-test.js $PROTOTYPE_DIR/test/test.js

cd $PROTOTYPE_DIR
git submodule init
git submodule update


#if [ $DEBUG -eq 1 ]; then
# echo 'running with rhino debugger'
# java -cp js.jar org.mozilla.javascript.tools.debugger.Main test.js;
#else
# echo 'running with rhino'
# java -jar js.jar -w -debug test.js;
#fi

0 comments on commit 87c8d20

Please sign in to comment.