1
0
Fork 0

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
Mike Gerwitz 2011-10-20 23:40:30 -04:00
parent a36a69e1ff
commit c1207eb3d5
4 changed files with 9 additions and 8 deletions

View File

@ -13,6 +13,6 @@ default: $(tests) combine
combine: $(tests_combine)
%.js: FORCE
node --stack_trace_limit=20 $@
NODE_PATH=".:$(NODE_PATH)" node --stack_trace_limit=20 "$@"
test-%: FORCE
./$@

View File

@ -22,9 +22,9 @@
* @package test
*/
var common = require( './common' ),
var common = require( 'common' ),
assert = require( 'assert' ),
mb_common = require( __dirname + '/inc-member_builder-common' ),
mb_common = require( __dirname + '/../inc-member_builder-common' ),
util = common.require( 'util' ),
// stub factories used for testing

View File

@ -132,11 +132,11 @@ done
# include tests?
if [ "$INC_TEST" ]; then
# note that not all tests are included
TEST_CASES=$( find $PATH_TEST \
TEST_CASES=$( cd "$PATH_TEST"; find . \
\( -name 'test-*.js' \
-o -name '*Test*.js' \
\) \
-exec basename {} \; \
| sed 's/^.\///' \
| sort \
| 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
# prefixing it with "test/"
module="${filename%.*}"
module="test/${module##*/}"
module="test/${module##*test/}"
# each module must be enclosed in a closure to emulate a module
echo "/** TEST CASE: $testcase **/"

View File

@ -41,8 +41,9 @@ var easejs = {};
var require = function( module_id )
{
// remove the './' directory prefix (every module is currently included
// via a relative path)
var id_clean = module_id.replace( /^\.?\//, '' );
// via a relative path) and stupidly remove single ../'s (combine script
// doesn't include true paths, so they're not necessary to resolve)
var id_clean = module_id.replace( /^\.?\/|\.\.\//, '' );
// attempt to retrieve the module
var mod = module[ id_clean ];