diff options
Diffstat (limited to 'src/mongo/unittest')
-rw-r--r-- | src/mongo/unittest/unittest-inl.h | 13 | ||||
-rw-r--r-- | src/mongo/unittest/unittest.h | 6 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/mongo/unittest/unittest-inl.h b/src/mongo/unittest/unittest-inl.h index e0076f41751..3fb31cd0a42 100644 --- a/src/mongo/unittest/unittest-inl.h +++ b/src/mongo/unittest/unittest-inl.h @@ -33,9 +33,20 @@ namespace unittest { template <typename T> Test::RegistrationAgent<T>::RegistrationAgent(const std::string& suiteName, - const std::string& testName) { + const std::string& testName) + : _suiteName(suiteName), _testName(testName) { Suite::getSuite(suiteName)->add<T>(testName); } +template <typename T> +std::string Test::RegistrationAgent<T>::getSuiteName() const { + return _suiteName; +} + +template <typename T> +std::string Test::RegistrationAgent<T>::getTestName() const { + return _testName; +} + } // namespace mongo } // namespace unittest diff --git a/src/mongo/unittest/unittest.h b/src/mongo/unittest/unittest.h index 51cfde2391b..f385e0d7356 100644 --- a/src/mongo/unittest/unittest.h +++ b/src/mongo/unittest/unittest.h @@ -299,6 +299,12 @@ protected: public: RegistrationAgent(const std::string& suiteName, const std::string& testName); + std::string getSuiteName() const; + std::string getTestName() const; + + private: + const std::string _suiteName; + const std::string _testName; }; /** |