bug 1232: NS_TEST_SOURCEDIR does not handle test subdirectories

This commit is contained in:
Tom Henderson
2011-08-08 08:33:29 -07:00
parent 27e6fcc4fc
commit 44bd9fc05e
3 changed files with 13 additions and 2 deletions

View File

@@ -853,6 +853,13 @@ protected:
* \param 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
*/
void SetDataDir (std::string directory);

View File

@@ -31,7 +31,9 @@ class Dot11sRegressionSuite : public TestSuite
public:
Dot11sRegressionSuite () : TestSuite ("devices-mesh-dot11s-regression", SYSTEM)
{
SetDataDir (NS_TEST_SOURCEDIR);
// We do not use NS_TEST_SOURCEDIR variable here since mesh/test has
// subdirectories
SetDataDir (std::string ("src/mesh/test/dot11s"));
AddTestCase (new PeerManagementProtocolRegressionTest);
AddTestCase (new HwmpSimplestRegressionTest);
AddTestCase (new HwmpReactiveRegressionTest);

View File

@@ -27,7 +27,9 @@ class FlameRegressionSuite : public TestSuite
public:
FlameRegressionSuite () : TestSuite ("devices-mesh-flame-regression", SYSTEM)
{
SetDataDir (NS_TEST_SOURCEDIR);
// We do not use NS_TEST_SOURCEDIR variable here since mesh/test has
// subdirectories
SetDataDir (std::string ("src/mesh/test/flame"));
AddTestCase (new FlameRegressionTest);
}
} g_flameRegressionSuite;