Moved MemberBuilder-MethodTest into MemberBuilder subdir
- Altered combine script to support subdirs (note that the dir names aren't included in the combined file)closure/master
parent
a36a69e1ff
commit
c1207eb3d5
|
@ -13,6 +13,6 @@ default: $(tests) combine
|
||||||
combine: $(tests_combine)
|
combine: $(tests_combine)
|
||||||
|
|
||||||
%.js: FORCE
|
%.js: FORCE
|
||||||
node --stack_trace_limit=20 $@
|
NODE_PATH=".:$(NODE_PATH)" node --stack_trace_limit=20 "$@"
|
||||||
test-%: FORCE
|
test-%: FORCE
|
||||||
./$@
|
./$@
|
||||||
|
|
|
@ -22,9 +22,9 @@
|
||||||
* @package test
|
* @package test
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var common = require( './common' ),
|
var common = require( 'common' ),
|
||||||
assert = require( 'assert' ),
|
assert = require( 'assert' ),
|
||||||
mb_common = require( __dirname + '/inc-member_builder-common' ),
|
mb_common = require( __dirname + '/../inc-member_builder-common' ),
|
||||||
util = common.require( 'util' ),
|
util = common.require( 'util' ),
|
||||||
|
|
||||||
// stub factories used for testing
|
// stub factories used for testing
|
|
@ -132,11 +132,11 @@ done
|
||||||
# include tests?
|
# include tests?
|
||||||
if [ "$INC_TEST" ]; then
|
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=$( cd "$PATH_TEST"; find . \
|
||||||
\( -name 'test-*.js' \
|
\( -name 'test-*.js' \
|
||||||
-o -name '*Test*.js' \
|
-o -name '*Test*.js' \
|
||||||
\) \
|
\) \
|
||||||
-exec basename {} \; \
|
| sed 's/^.\///' \
|
||||||
| sort \
|
| sort \
|
||||||
| grep -v 'test-\(combine\(-pre-es5\)\?\|index\).js' \
|
| grep -v 'test-\(combine\(-pre-es5\)\?\|index\).js' \
|
||||||
)
|
)
|
||||||
|
@ -157,7 +157,7 @@ if [ "$INC_TEST" ]; then
|
||||||
# generate the module name by removing path and extension, then
|
# generate the module name by removing path and extension, then
|
||||||
# prefixing it with "test/"
|
# prefixing it with "test/"
|
||||||
module="${filename%.*}"
|
module="${filename%.*}"
|
||||||
module="test/${module##*/}"
|
module="test/${module##*test/}"
|
||||||
|
|
||||||
# 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 **/"
|
||||||
|
|
|
@ -41,8 +41,9 @@ var easejs = {};
|
||||||
var require = function( module_id )
|
var require = function( module_id )
|
||||||
{
|
{
|
||||||
// remove the './' directory prefix (every module is currently included
|
// remove the './' directory prefix (every module is currently included
|
||||||
// via a relative path)
|
// via a relative path) and stupidly remove single ../'s (combine script
|
||||||
var id_clean = module_id.replace( /^\.?\//, '' );
|
// doesn't include true paths, so they're not necessary to resolve)
|
||||||
|
var id_clean = module_id.replace( /^\.?\/|\.\.\//, '' );
|
||||||
|
|
||||||
// attempt to retrieve the module
|
// attempt to retrieve the module
|
||||||
var mod = module[ id_clean ];
|
var mod = module[ id_clean ];
|
||||||
|
|
Loading…
Reference in New Issue