Changeset 74
- Timestamp:
- 10/09/06 09:34:44 (2 years ago)
- Files:
-
- branches/experimental/jsolait/jsolait.js (modified) (2 diffs)
- branches/experimental/jsolait/jsolait.wsf (modified) (1 diff)
- branches/experimental/jsolait/lib/testing.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/experimental/jsolait/jsolait.js
r73 r74 646 646 } 647 647 }else{ 648 attachTo[name] = m; 648 var finalModuleName=name.split('.'); 649 finalModuleName=finalModuleName.pop(); 650 attachTo[finalModuleName] = m; 649 651 } 650 652 }; … … 754 756 args.push(locals[key]); 755 757 } 756 758 757 759 var modFn = new Function(argNames.join(","), source); 758 760 branches/experimental/jsolait/jsolait.wsf
r73 r74 96 96 //get the base of the file to execute 97 97 var fileBase= fs.getParentFolderName(fileName); 98 99 98 //make sure the search path is updated to include the fileBase 100 99 jsolait.moduleSearchURIs = [fileBase, "%(baseURI)s/lib"]; 101 100 101 102 //see if there are any jsolait config files in any of the parent folders 103 var parentFolder= fileBase; 104 while(parentFolder){ 105 try{ 106 var src = jsolait.loadURI(parentFolder+'/.jsolait'); 107 try{ 108 var f = new Function('__baseURI__',src); 109 f(parentFolder); 110 break; 111 }catch(e){ 112 print('error in .jsolait', parentFolder); 113 break; 114 } 115 }catch(e){ 116 } 117 parentFolder=fs.getParentFolderName(parentFolder); 118 } 119 120 102 121 //change working dir to the file's location 103 122 //todo:is it OK to change cwd? branches/experimental/jsolait/lib/testing.js
r73 r74 144 144 145 145 /** 146 Tests a module by running each of the modules test_ methods; 147 **/ 148 mod.testModule=function(modObj){ 149 150 for(var key in modObj){ 151 if(key.slice(0,5)=='test_'){ 152 print(mod.test(modObj.__name__+'.'+key, modObj[key])); 153 } 154 } 155 }; 156 157 /** 146 158 Raised when an assertion fails. 147 159 **/
