mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-29 11:53:23 +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 regtest
|
||||
import moduletest
|
||||
import diatest
|
||||
|
||||
def getTestSuite( singleName = "" ):
|
||||
if singleName == "":
|
||||
return unittest.TestSuite(
|
||||
[ unittest.TestLoader().loadTestsFromTestCase( basetest.BaseTest ),
|
||||
unittest.TestLoader().loadTestsFromTestCase( moduletest.ModuleTest ),
|
||||
unittest.TestLoader().loadTestsFromTestCase( diatest.DiaTest ),
|
||||
# unittest.TestLoader().loadTestsFromTestCase( typeinfo.TypeInfoTest ),
|
||||
# unittest.TestLoader().loadTestsFromTestCase( regtest.CpuRegTest )
|
||||
] )
|
||||
|
@ -6,12 +6,22 @@
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
void FuncWithName0()
|
||||
{
|
||||
}
|
||||
|
||||
void FuncWithName1()
|
||||
{
|
||||
}
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
try
|
||||
{
|
||||
// Let test scripts to execute
|
||||
__debugbreak();
|
||||
FuncWithName0();
|
||||
FuncWithName1();
|
||||
}
|
||||
catch(std::exception & ex)
|
||||
{
|
||||
|
@ -404,6 +404,10 @@
|
||||
RelativePath="..\scripts\basetest.py"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\diatest.py"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\moduletest.py"
|
||||
>
|
||||
|
Loading…
Reference in New Issue
Block a user