Corrected test combine process; was not including tests in ease-full.js
parent
d6cca75093
commit
0ccab4f8d9
|
@ -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() {};
|
||||||
|
|
|
@ -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' };
|
||||||
|
|
|
@ -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 "};"
|
||||||
|
|
Loading…
Reference in New Issue