1
0
Fork 0

Corrected test combine process; was not including tests in ease-full.js

closure/master
Mike Gerwitz 2011-03-06 10:15:32 -05:00
parent d6cca75093
commit 0ccab4f8d9
3 changed files with 14 additions and 8 deletions

View File

@ -24,7 +24,7 @@
var common = require( './common' ), var common = require( './common' ),
assert = require( 'assert' ), assert = require( 'assert' ),
mb_common = require( './inc-member_builder-common' ) mb_common = require( __dirname + '/inc-member_builder-common' )
; ;
mb_common.value = function() {}; mb_common.value = function() {};

View File

@ -24,7 +24,7 @@
var common = require( './common' ), var common = require( './common' ),
assert = require( 'assert' ), assert = require( 'assert' ),
mb_common = require( './inc-member_builder-common' ) mb_common = require( __dirname + '/inc-member_builder-common' )
; ;
mb_common.value = { bar: 'baz' }; mb_common.value = { bar: 'baz' };

View File

@ -99,32 +99,38 @@ if [ "$INC_TEST" ]; then
# note that not all tests are included # note that not all tests are included
TEST_CASES=$( find $PATH_TEST \ TEST_CASES=$( find $PATH_TEST \
\( -name 'test-*.js' \ \( -name 'test-*.js' \
-name 'inc-*.js' \ -o -name 'inc-*.js' \
! -name 'test-combine.js' \
! -name 'test-index.js' \
\) \ \) \
-exec basename {} \; \ -exec basename {} \; \
| sort \
| grep -v 'test-\(combine\|index\).js' \
) )
# include test combine template # include test combine template
cat "$TPL_TEST_PATH" | grep -v '^#' | $RMTRAIL cat "$TPL_TEST_PATH" | grep -v '^#' | $RMTRAIL
echo "/** TEST CASES **/" echo "/** TEST CASES **/"
echo "ns_exports.runTests = function ()" echo "ns_exports.runTests = function()"
echo "{" echo "{"
for testcase in $TEST_CASES; do for testcase in $TEST_CASES; do
filename="$PATH_TEST/$testcase" filename="$PATH_TEST/$testcase"
# generate the module name by removing path and extension, then
# prefixing it with "test/"
module="${filename%.*}"
module="test/${module##*/}"
# each module must be enclosed in a closure to emulate a module # each module must be enclosed in a closure to emulate a module
echo "/** TEST CASE: $testcase **/" echo "/** TEST CASE: $testcase **/"
echo "( function()" echo "( function( module, __dirname )"
echo "{" echo "{"
echo " var exports = module.exports = {};"
# add the module, removing trailing commas # add the module, removing trailing commas
cat $filename | $RMTRAIL cat $filename | $RMTRAIL
echo "} )();" echo "} )( module['$module'] = {}, 'test' );"
done done
echo "};" echo "};"