ns-3
|
encapsulates test code More...
#include <test.h>
Protected Member Functions | |
TestCase (std::string name) | |
void | AddTestCase (TestCase *testCase) |
Add an individual test case to this test suite. | |
void | SetDataDir (std::string directory) |
bool | GetErrorStatus (void) const NS_DEPRECATED |
bool | IsStatusFailure (void) const |
bool | IsStatusSuccess (void) const |
void | ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line) |
bool | MustAssertOnFailure (void) const |
bool | MustContinueOnFailure (void) const |
std::string | CreateDataDirFilename (std::string filename) |
std::string | CreateTempDirFilename (std::string filename) |
Friends | |
class | TestRunnerImpl |
encapsulates test code
To allow a new test to be run within the ns-3 test framework, users need to create subclasses of this base class, override the DoRun method, and use the NS_TEST_* macros within DoRun.
ns3::TestCase::TestCase | ( | std::string | name | ) | [protected] |
name | the name of the new test created |
void ns3::TestCase::AddTestCase | ( | TestCase * | testCase | ) | [protected] |
Add an individual test case to this test suite.
testCase | Pointer to the test case object to be added. |
References NS_FATAL_ERROR.
bool ns3::TestCase::GetErrorStatus | ( | void | ) | const [protected] |
This method is deprecated. IsStatusFailure replaces it.
References IsStatusFailure().
bool ns3::TestCase::IsStatusFailure | ( | void | ) | const [protected] |
References IsStatusSuccess().
Referenced by GetErrorStatus().
bool ns3::TestCase::IsStatusSuccess | ( | void | ) | const [protected] |
Referenced by IsStatusFailure().
void ns3::TestCase::SetDataDir | ( | std::string | directory | ) | [protected] |
directory | the directory where the test data is located |
In general, this method is invoked as SetDataDir (NS_TEST_SOURCEDIR); However, if a module contains a test directory with subdirectories (e.g. src/mesh/test), and the test data (e.g. pcap traces) is located in one of these subdirectories, then the variable NS_TEST_SOURCEDIR may not work and the user may want to explicitly pass in a directory string.
Note that NS_TEST_SOURCEDIR is set in src/wscript for each module