From 44bd9fc05ecfb26720d1c8e96689d8e9a3fd796e Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Mon, 8 Aug 2011 08:33:29 -0700 Subject: [PATCH] bug 1232: NS_TEST_SOURCEDIR does not handle test subdirectories --- src/core/model/test.h | 7 +++++++ src/mesh/test/dot11s/regression.cc | 4 +++- src/mesh/test/flame/regression.cc | 4 +++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/core/model/test.h b/src/core/model/test.h index c903d5e53..e5be0f3c1 100644 --- a/src/core/model/test.h +++ b/src/core/model/test.h @@ -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); diff --git a/src/mesh/test/dot11s/regression.cc b/src/mesh/test/dot11s/regression.cc index cfab88a7c..6e1b82319 100644 --- a/src/mesh/test/dot11s/regression.cc +++ b/src/mesh/test/dot11s/regression.cc @@ -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); diff --git a/src/mesh/test/flame/regression.cc b/src/mesh/test/flame/regression.cc index 72c8ad62f..bab62d2f4 100644 --- a/src/mesh/test/flame/regression.cc +++ b/src/mesh/test/flame/regression.cc @@ -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;