Changeset 11
- Timestamp:
- 10/10/2007 12:01:42 AM (15 months ago)
- Location:
- trunk
- Files:
-
- 3 modified
-
functest/__init__.py (modified) (1 diff)
-
functest/bin.py (modified) (4 diffs)
-
scripts/functest (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/functest/__init__.py
r1 r11 1 import bin, collector, formatter, frame, global_settings, reports, runner 2 import os 3 from time import sleep 4 5 def configure(settings_module=global_settings, registry={}): 6 """Configure the framework""" 7 import functest 8 functest.registry = registry 9 functest.modules_passed = [] 10 11 def run_framework(test_args=[], test_runner=None): 12 13 if test_runner is None: 14 test_runner = runner.CLIRunner() 15 16 tests = [] 17 test_runner.start() 18 if len(test_args) is not 0: 19 for arg in test_args: 20 tests.append( [ collector.create_test_module(arg), collector.create_module_chain(arg) ] ) 21 else: 22 tests.append([collector.create_test_module(os.path.curdir), collector.create_module_chain(os.path.curdir) ]) 23 24 test_runner.wrap_stdout(global_settings.wrap_stdout, global_settings.wrap_stderr) 25 global_settings.test_runner = test_runner 26 totals = frame.execute(tests) 27 test_runner.summary(totals) 28 sleep(.5) -
trunk/functest/bin.py
r10 r11 13 13 # limitations under the License. 14 14 15 import collector16 import frame17 15 import global_settings 18 import runner19 from time import sleep20 16 21 import os,sys17 import sys 22 18 23 19 usage = """functest test framework. … … 35 31 (filter=) Only run tests where the name contains this filter.""" 36 32 37 def main(args): 33 def main(test_args): 34 # tests = [] 35 # cli_runner = runner.CLIRunner() 36 # cli_runner.start() 37 # if len(args) is not 0: 38 # for arg in args: 39 # tests.append( [ collector.create_test_module(arg), collector.create_module_chain(arg) ] ) 40 # else: 41 # tests.append([collector.create_test_module(os.path.curdir), collector.create_module_chain(os.path.curdir) ]) 42 # cli_runner.wrap_stdout(global_settings.wrap_stdout, global_settings.wrap_stderr) 43 # global_settings.test_runner = cli_runner 44 # totals = frame.execute(tests) 45 # cli_runner.summary(totals) 46 # sleep(.5) 47 48 import functest 49 functest.run_framework(test_args) 38 50 39 tests = []40 cli_runner = runner.CLIRunner()41 cli_runner.start()42 if len(args) is not 0:43 for arg in args:44 tests.append( [ collector.create_test_module(arg), collector.create_module_chain(arg) ] )45 else:46 tests.append([collector.create_test_module(os.path.curdir), collector.create_module_chain(os.path.curdir) ])47 cli_runner.wrap_stdout(global_settings.wrap_stdout, global_settings.wrap_stderr)48 global_settings.test_runner = cli_runner49 totals = frame.execute(tests)50 cli_runner.summary(totals)51 sleep(.5)52 51 53 52 def process_args(): 53 import functest 54 functest.configure() 55 54 56 args = list(sys.argv) 55 57 if args[0].endswith('functest') or args[0].endswith('functest.py') or args[0].endswith('functest.exe'): … … 68 70 options = [ x.replace('--', '') for x in args ] 69 71 70 import functest71 functest.registry = {}72 functest.modules_passed = []73 72 for option in options: 74 73 if option.find('=') is not -1: … … 85 84 return functest.modules_passed 86 85 87 if __name__ == "__main__": 88 main() 86 -
trunk/scripts/functest
r10 r11 14 14 # limitations under the License. 15 15 16 from functest import bin 16 import functest 17 17 18 18 if __name__ == '__main__': 19 bin.main(bin.process_args())19 functest.bin.main(functest.bin.process_args()) 20 20 21 21
