Ghidra Decompiler Analysis Engine
|
Go to the documentation of this file.
18 #ifndef __TESTFUNCTION__
19 #define __TESTFUNCTION__
21 #include "libdecomp.hh"
37 string getName(
void)
const {
return name; }
46 vector<string> commands;
48 virtual void readLine(
string &line);
68 list<FunctionTestProperty> testList;
70 mutable int4 numTestsApplied;
71 mutable int4 numTestsSucceeded;
74 void startTests(
void)
const;
75 void passLineToTests(
const string &line)
const;
76 void evaluateTests(ostream &midStream,list<string> &lateStream)
const;
79 int4 getTestsApplied(
void)
const {
return numTestsApplied; }
80 int4 getTestsSucceeded(
void)
const {
return numTestsSucceeded; }
81 void loadTest(
const string &filename);
84 void runTests(ostream &midStream,list<string> &lateStream);
A console command run as part of a test sequence.
Definition: testfunction.hh:45
virtual bool isStreamFinished(void) const
Return true if the current stream is finished.
Definition: testfunction.hh:52
void restoreXml(const Element *el)
Reconstruct the property from an XML tag.
Definition: testfunction.cc:38
A generic console mode interface and command executor.
Definition: interface.hh:195
An XML element. A node in the DOM tree.
Definition: xml.hh:150
Common data shared by decompiler commands.
Definition: ifacedecomp.hh:42
void reset(void)
Reset console for a new program.
Definition: testfunction.cc:67
void restoreXml(const Element *el)
Reconstruct the command from an XML tag.
Definition: testfunction.cc:77
bool endTest(void) const
Return results of property search.
Definition: testfunction.cc:32
void loadTest(const string &filename)
Load a test program, tests, and script.
Definition: testfunction.cc:179
static void runTestCollections(const string &dirname, set< string > &testNames)
Run test files in a whole directory.
Definition: testfunction.cc:290
void runTests(ostream &midStream, list< string > &lateStream)
Run the script and perform the tests.
Definition: testfunction.cc:244
FunctionTestCollection(void)
Constructor.
Definition: testfunction.cc:167
ConsoleCommands(void)
Constructor.
Definition: testfunction.cc:60
void restoreXmlOldForm(DocumentStorage &store, const Element *el)
Load tests from <binaryimage> tag.
Definition: testfunction.cc:232
void processLine(const string &line) const
Search thru line, update state if match found.
Definition: testfunction.cc:25
A container for parsed XML documents.
Definition: xml.hh:249
void startTest(void) const
Reset "state", counting number of matching lines.
Definition: testfunction.cc:19
A collection of tests around a single program/function.
Definition: testfunction.hh:65
A single property to be searched for in the output of a function decompilation.
Definition: testfunction.hh:30
void restoreXml(DocumentStorage &store, const Element *el)
Load tests from a <decompilertest> tag.
Definition: testfunction.cc:194