forked from jeresig/env-js
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added a basic skepeton for checkout of prototype development head to …
…begin unit test integration
- Loading branch information
thatcher
committed
May 21, 2009
1 parent
ff986ea
commit 87c8d20
Showing
2 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|