Ghidra Decompiler Analysis Engine
|
A collection of tests around a single program/function. More...
#include <testfunction.hh>
Public Member Functions | |
FunctionTestCollection (void) | |
Constructor. | |
void | loadTest (const string &filename) |
Load a test program, tests, and script. More... | |
void | restoreXml (DocumentStorage &store, const Element *el) |
Load tests from a <decompilertest> tag. | |
void | restoreXmlOldForm (DocumentStorage &store, const Element *el) |
Load tests from <binaryimage> tag. More... | |
void | runTests (ostream &midStream, list< string > &lateStream) |
Run the script and perform the tests. More... | |
Static Public Member Functions | |
static void | runTestCollections (const string &dirname, set< string > &testNames) |
Run test files in a whole directory. More... | |
A collection of tests around a single program/function.
The collection of tests is loaded from a single XML file via loadTest(), and the tests are run by calling runTests(). An entire program is loaded and possibly annotated by a series of console command lines. Decompiler output is also triggered by a command, and then the output is scanned for by the test objects (FunctionTestProperty). Results of passed/failed tests are collected. If the command line script does not complete properly, this is considered a special kind of failure.
void FunctionTestCollection::loadTest | ( | const string & | filename | ) |
Load a test program, tests, and script.
Load the architecture based on the discovered <binaryimage> tag. Collect the script commands and the specific tests.
filename | is the XML file holding the test data |
void FunctionTestCollection::restoreXmlOldForm | ( | DocumentStorage & | store, |
const Element * | el | ||
) |
Load tests from <binaryimage> tag.
Pull the script and tests from a comment in <binaryimage>
|
static |
Run test files in a whole directory.
Run through all XML files in the given directory, processing each in turn.
dirname | is a directory containing the XML test files |
testNames | (if not empty) specifies particular tests to run |
void FunctionTestCollection::runTests | ( | ostream & | midStream, |
list< string > & | lateStream | ||
) |
Run the script and perform the tests.
Run the script commands on the current program. Collect any bulk output, and run tests over the output. Report test failures back to the caller
midStream | is the output stream to write to during the test |
lateStream | collects messages for a final summary |