Allow accessing application path from TestApplication

Make it static because when this function becomes useful,
the (singleton) instance is likely not available.
experiment/srcref_basic_cfg
Martchus 5 years ago
parent cb02d5c733
commit 2ec3df889f
  1. 9
      tests/testutils.h

@ -33,6 +33,7 @@ public:
bool unitsSpecified() const;
const std::vector<const char *> &units() const;
static const TestApplication *instance();
static const char *appPath();
private:
ApplicationUtilities::ArgumentParser m_parser;
@ -67,6 +68,14 @@ inline const TestApplication *TestApplication::instance()
return TestApplication::m_instance;
}
/*!
* \brief Returns the application path or an empty string if no application path has been set.
*/
inline const char *TestApplication::appPath()
{
return m_instance && m_instance->m_applicationPathArg.firstValue() ? m_instance->m_applicationPathArg.firstValue() : "";
}
/*!
* \brief Returns whether particular units have been specified.
*/

Loading…
Cancel
Save