]>
git.saurik.com Git - apple/dyld.git/blob - testing/kernel-cache-tests/testall.py
11 sys
.dont_write_bytecode
= True
13 import KernelCollection
16 if __name__
== "__main__":
17 test_dir
= os
.path
.realpath(os
.path
.dirname(__file__
))
18 sys
.path
.append(test_dir
)
19 all_tests
= os
.listdir(test_dir
)
22 if len(sys
.argv
) == 2:
23 test_to_run
= sys
.argv
[1]
24 all_tests
= [ test_to_run
]
26 test_case
= test_dir
+ "/" + f
+ "/test.py"
27 if os
.path
.isfile(test_case
):
28 py_mod
= imp
.load_source(f
, test_case
)
29 check_func
= getattr(py_mod
, "check", 0)
31 print "FAIL: " + f
+ ", missing check() function";
34 kernelCollection
= KernelCollection
.KernelCollection(test_to_run
!= "")
35 check_func(kernelCollection
)
37 except AssertionError, e
:
38 _
, _
, tb
= sys
.exc_info()
39 tb_info
= traceback
.extract_tb(tb
)
40 filename
, line
, func
, text
= tb_info
[-1]
41 print "FAIL: " + f
+ ", " + text
43 _
, _
, tb
= sys
.exc_info()
44 tb_info
= traceback
.extract_tb(tb
)
45 filename
, line
, func
, text
= tb_info
[-1]
46 print "FAIL: " + f
+ ", " + text