mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-29 11:53:23 +08:00
[test] updated: refactored test runner
git-svn-id: https://pykd.svn.codeplex.com/svn@69298 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
4497613fa3
commit
eeac3d5a80
test
@ -5,6 +5,7 @@
|
||||
import sys
|
||||
import os
|
||||
import unittest
|
||||
import fnmatch
|
||||
|
||||
# Dynamically append current pykd.pyd path to PYTHONPATH
|
||||
sys.path.append(os.path.dirname(sys.argv[1]))
|
||||
@ -13,13 +14,23 @@ import pykd
|
||||
import target
|
||||
import basetest
|
||||
import typeinfo
|
||||
import regtest
|
||||
import regtest
|
||||
|
||||
def getTestSuite( singleName = "" ):
|
||||
if singleName == "":
|
||||
return unittest.TestSuite(
|
||||
[ unittest.TestLoader().loadTestsFromTestCase( basetest.BaseTest ),
|
||||
unittest.TestLoader().loadTestsFromTestCase( typeinfo.TypeInfoTest ),
|
||||
unittest.TestLoader().loadTestsFromTestCase( regtest.CpuRegTest )
|
||||
] )
|
||||
else:
|
||||
return unittest.TestSuite( unittest.TestLoader().loadTestsFromName( singleName ) )
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
targetAppPath = sys.argv[1]
|
||||
|
||||
|
||||
target.moduleName = os.path.splitext(os.path.basename(targetAppPath))[0]
|
||||
print "\nTest module: %s" % targetAppPath
|
||||
|
||||
@ -27,11 +38,7 @@ if __name__ == "__main__":
|
||||
pykd.go()
|
||||
|
||||
target.module = pykd.loadModule( target.moduleName )
|
||||
|
||||
suite = getTestSuite()
|
||||
|
||||
suite = unittest.TestSuite( [
|
||||
unittest.TestLoader().loadTestsFromTestCase( basetest.BaseTest ),
|
||||
unittest.TestLoader().loadTestsFromTestCase( typeinfo.TypeInfoTest ),
|
||||
unittest.TestLoader().loadTestsFromTestCase( regtest.CpuRegTest )
|
||||
] )
|
||||
|
||||
unittest.TextTestRunner(stream=sys.stdout, verbosity=2).run( suite )
|
||||
|
@ -150,6 +150,7 @@ private:
|
||||
int field1;
|
||||
Type5 *field2;
|
||||
Type5 *field3[2];
|
||||
Type5 **field4;
|
||||
|
||||
public:
|
||||
|
||||
@ -158,6 +159,8 @@ public:
|
||||
field2 = new Type5;
|
||||
field3[0] = new Type5;
|
||||
field3[1] = new Type5;
|
||||
|
||||
field4 = &field2;
|
||||
}
|
||||
|
||||
~Type6() {
|
||||
|
Loading…
Reference in New Issue
Block a user