mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-29 20:03:33 +08:00
[+] pyDia: find[Ex] tests
git-svn-id: https://pykd.svn.codeplex.com/svn@69934 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
056fb1c40a
commit
03e052a418
23
test/scripts/diatest.py
Normal file
23
test/scripts/diatest.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
"""
|
||||||
|
Tests for pyDia
|
||||||
|
"""
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
import target
|
||||||
|
import pykd
|
||||||
|
|
||||||
|
class DiaTest( unittest.TestCase ):
|
||||||
|
def testFind(self):
|
||||||
|
globalScope = pykd.diaOpenPdb( str(target.module.pdb()) )
|
||||||
|
|
||||||
|
self.assertNotEqual(0, len(globalScope))
|
||||||
|
|
||||||
|
symFunction = globalScope.find("FuncWithName0")
|
||||||
|
self.assertTrue(1 == len( symFunction ))
|
||||||
|
|
||||||
|
symFunction = globalScope.findEx(pykd.SymTagNull,
|
||||||
|
"FuNc*Name?",
|
||||||
|
pykd.nsCaseInRegularExpression)
|
||||||
|
self.assertTrue(len(symFunction) > 1)
|
||||||
|
|
||||||
|
|
@ -15,12 +15,14 @@ import basetest
|
|||||||
import typeinfo
|
import typeinfo
|
||||||
import regtest
|
import regtest
|
||||||
import moduletest
|
import moduletest
|
||||||
|
import diatest
|
||||||
|
|
||||||
def getTestSuite( singleName = "" ):
|
def getTestSuite( singleName = "" ):
|
||||||
if singleName == "":
|
if singleName == "":
|
||||||
return unittest.TestSuite(
|
return unittest.TestSuite(
|
||||||
[ unittest.TestLoader().loadTestsFromTestCase( basetest.BaseTest ),
|
[ unittest.TestLoader().loadTestsFromTestCase( basetest.BaseTest ),
|
||||||
unittest.TestLoader().loadTestsFromTestCase( moduletest.ModuleTest ),
|
unittest.TestLoader().loadTestsFromTestCase( moduletest.ModuleTest ),
|
||||||
|
unittest.TestLoader().loadTestsFromTestCase( diatest.DiaTest ),
|
||||||
# unittest.TestLoader().loadTestsFromTestCase( typeinfo.TypeInfoTest ),
|
# unittest.TestLoader().loadTestsFromTestCase( typeinfo.TypeInfoTest ),
|
||||||
# unittest.TestLoader().loadTestsFromTestCase( regtest.CpuRegTest )
|
# unittest.TestLoader().loadTestsFromTestCase( regtest.CpuRegTest )
|
||||||
] )
|
] )
|
||||||
|
@ -6,12 +6,22 @@
|
|||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
|
void FuncWithName0()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void FuncWithName1()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
int _tmain(int argc, _TCHAR* argv[])
|
int _tmain(int argc, _TCHAR* argv[])
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Let test scripts to execute
|
// Let test scripts to execute
|
||||||
__debugbreak();
|
__debugbreak();
|
||||||
|
FuncWithName0();
|
||||||
|
FuncWithName1();
|
||||||
}
|
}
|
||||||
catch(std::exception & ex)
|
catch(std::exception & ex)
|
||||||
{
|
{
|
||||||
|
@ -404,6 +404,10 @@
|
|||||||
RelativePath="..\scripts\basetest.py"
|
RelativePath="..\scripts\basetest.py"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\scripts\diatest.py"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\scripts\moduletest.py"
|
RelativePath="..\scripts\moduletest.py"
|
||||||
>
|
>
|
||||||
|
Loading…
Reference in New Issue
Block a user