OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
|
#include <ossimBatchTest.h>
Public Types | |
enum | TEST_STATUS { TEST_TBD = 0x00, TEST_PASSED = 0x01, TEST_FAILED = 0x02, TEST_ERROR = 0x04, TEST_DISABLED = 0x08 } |
Public Member Functions | |
ossimBatchTest () | |
This constructor only initializes data members to null/defaults. More... | |
bool | initialize (ossimArgumentParser &ap) |
Initializes the test session given the command line. More... | |
ossim_uint8 | execute () |
Performs the actual test with the config filename previously set in initialize() or processConfigList() when config is a list of subordinate test config files. More... | |
![]() | |
ossimReferenced () | |
ossimReferenced (const ossimReferenced &) | |
ossimReferenced & | operator= (const ossimReferenced &) |
void | ref () const |
increment the reference count by one, indicating that this object has another pointer which is referencing it. More... | |
void | unref () const |
decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
void | unref_nodelete () const |
decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
int | referenceCount () const |
Private Member Functions | |
void | writeTemplate (const ossimFilename &templateFile, bool long_form) |
Writes template test config file, either exhaustive long form for flexibility, or simple short-form for easier test creation. More... | |
void | getDateString (ossimString &date) |
Fetches string from OS for naming and tagging the log file. More... | |
void | getLogFilename (ossimFilename &logFile) |
Establishes name of output log file. More... | |
ossim_uint8 | processConfigList (const ossimKeywordlist &kwl) |
When the config file consists of a list of subordinate test config files, this method manages processing multiple configs. More... | |
ossim_uint8 | processTest (const ossimString &prefix, const ossimKeywordlist &kwl) |
Within a single config file can be multiple tests, distinguished by the "test*." prefix. More... | |
ossim_uint8 | processCommands (const ossimString &prefix, const ossimKeywordlist &kwl, const ossimString &testName, bool logTime, const ossimFilename &tempFile=ossimFilename("")) |
Runs a single command within a test. More... | |
void | preprocessKwl (const std::vector< std::string > &testList, const std::string &testCommand, ossimKeywordlist &kwl) |
Modifies the config's KWL to explicitly declare implied keywords. More... | |
bool | makeDefaultResultsDir () |
Default preprocessing step makes expected and output results directories. More... | |
bool | doDefaultClean () |
Default clean step deletes all files in out and exp dirs. More... | |
bool | getTempFileName (const ossimString &prefix, const ossimKeywordlist &kwl, ossimFilename &tempFile) const |
Gets the temp file name. More... | |
bool | getDefaultTempFileDir (ossimFilename &tempDir) const |
Gets the default temp directory /data1/test/results/linux/tmp. More... | |
void | usage (ossimArgumentParser &ap) |
Initializes arg parser and outputs usage. More... | |
std::string | convertToNative (const char *lookup) const |
Converts string slashes to either forward or backward taking into account that windows commands with forward slashes in them. More... | |
Private Attributes | |
std::vector< std::string > | m_acceptTestList |
std::vector< std::string > | m_cleanTestList |
std::vector< std::string > | m_preprocessTestList |
std::vector< std::string > | m_runTestList |
std::map< ossim_uint32, std::string > | m_statusLabels |
bool | m_templateModeActive |
ossimFilename | m_configFileName |
ossimFilename | m_outDir |
ossimFilename | m_expDir |
std::ofstream | m_logStr |
Additional Inherited Members | |
![]() | |
virtual | ~ossimReferenced () |
Definition at line 34 of file ossimBatchTest.h.
Enumerator | |
---|---|
TEST_TBD | |
TEST_PASSED | |
TEST_FAILED | |
TEST_ERROR | |
TEST_DISABLED |
Definition at line 37 of file ossimBatchTest.h.
ossimBatchTest::ossimBatchTest | ( | ) |
This constructor only initializes data members to null/defaults.
Definition at line 37 of file ossimBatchTest.cpp.
References m_statusLabels, TEST_DISABLED, TEST_ERROR, TEST_FAILED, TEST_PASSED, and TEST_TBD.
|
private |
Converts string slashes to either forward or backward taking into account that windows commands with forward slashes in them.
s | String to convert. |
Definition at line 1209 of file ossimBatchTest.cpp.
Referenced by execute(), and processCommands().
|
private |
Default clean step deletes all files in out and exp dirs.
Default clean step deletes all files in out and exp dirs. Returns TRUE if successful.
Definition at line 1091 of file ossimBatchTest.cpp.
References ossimFilename::exists(), getDefaultTempFileDir(), ossimEnvironmentUtility::getEnvironmentVariable(), ossimEnvironmentUtility::instance(), m_logStr, and m_outDir.
Referenced by processCommands().
ossim_uint8 ossimBatchTest::execute | ( | ) |
Performs the actual test with the config filename previously set in initialize() or processConfigList() when config is a list of subordinate test config files.
Definition at line 418 of file ossimBatchTest.cpp.
References ossimKeywordlist::addFile(), ossimString::c_str(), ossimString::chars(), convertToNative(), ossimFilename::createDirectory(), ossimFilename::dirCat(), ossimString::empty(), ossimFilename::exists(), ossimFilename::fileNoExtension(), ossimKeywordlist::find(), ossimEnvironmentUtility::getCurrentWorkingDir(), getDateString(), ossimEnvironmentUtility::getEnvironmentVariable(), getLogFilename(), ossimKeywordlist::getSubstringKeyList(), ossimEnvironmentUtility::instance(), ossimTimer::instance(), m_acceptTestList, m_cleanTestList, m_configFileName, m_expDir, m_logStr, m_outDir, m_preprocessTestList, m_runTestList, m_statusLabels, m_templateModeActive, ossimSetLogFilename(), preprocessKwl(), processConfigList(), processTest(), ossimEnvironmentUtility::setEnvironmentVariable(), ossimKeywordlist::setExpandEnvVarsFlag(), ossimTimer::setStartTick(), status, TEST_ERROR, TEST_PASSED, TEST_TBD, ossimTimer::time_s(), and ossimException::what().
Referenced by processConfigList().
|
private |
Fetches string from OS for naming and tagging the log file.
Definition at line 641 of file ossimBatchTest.cpp.
References ossimString::clear().
Referenced by execute(), getLogFilename(), and processCommands().
|
private |
Gets the default temp directory /data1/test/results/linux/tmp.
tempDir | Initialized by this. |
Definition at line 1159 of file ossimBatchTest.cpp.
References ossimFilename::dirCat(), ossimString::empty(), ossimEnvironmentUtility::getEnvironmentVariable(), ossimEnvironmentUtility::instance(), and ossimString::size().
Referenced by doDefaultClean(), and getTempFileName().
|
private |
Establishes name of output log file.
Definition at line 661 of file ossimBatchTest.cpp.
References getDateString().
Referenced by execute().
|
private |
Gets the temp file name.
This will either be from the config file lookup of "temp_file" or derived under /data1/test/results/linux/tmp if the lookup fails. Note that this will create the /data1/test/results/linux/tmp directory if needed.
prefix | Like "test1." |
kwl | Keyword list to look for temp_file in. |
tempFile | Initialized by this. |
Definition at line 1130 of file ossimBatchTest.cpp.
References ossimString::c_str(), ossimString::clear(), ossimString::contains(), ossimFilename::createDirectory(), ossimFilename::dirCat(), ossimFilename::expand(), ossimKeywordlist::find(), getDefaultTempFileDir(), and ossimString::size().
Referenced by processTest().
bool ossimBatchTest::initialize | ( | ossimArgumentParser & | ap | ) |
Initializes the test session given the command line.
Definition at line 64 of file ossimBatchTest.cpp.
References ossimArgumentParser::argc(), ossimArgumentParser::argv(), ossimArgumentParser::errors(), m_acceptTestList, m_cleanTestList, m_configFileName, m_preprocessTestList, m_runTestList, m_templateModeActive, ossimNotify(), ossimNotifyLevel_NOTICE, ossimArgumentParser::read(), ossimArgumentParser::reportRemainingOptionsAsUnrecognized(), ossimString::size(), ossimString::split(), usage(), ossimArgumentParser::writeErrorMessages(), and writeTemplate().
|
private |
Default preprocessing step makes expected and output results directories.
Returns
Returns TRUE if successful.
Definition at line 1073 of file ossimBatchTest.cpp.
References ossimFilename::createDirectory(), ossimFilename::exists(), m_expDir, and m_outDir.
Referenced by processCommands().
|
private |
Modifies the config's KWL to explicitly declare implied keywords.
Definition at line 974 of file ossimBatchTest.cpp.
References ossimKeywordlist::add(), ossimString::c_str(), ossimString::downcase(), ossimKeywordlist::getNumberOfSubstringKeys(), ossimKeywordlist::getSize(), and ossimString::toString().
Referenced by execute().
|
private |
Runs a single command within a test.
Definition at line 820 of file ossimBatchTest.cpp.
References ossimString::c_str(), ossimString::contains(), convertToNative(), doDefaultClean(), ossimString::empty(), ossimKeywordlist::find(), getDateString(), ossimKeywordlist::getNumberOfSubstringKeys(), ossimTimer::instance(), m_logStr, makeDefaultResultsDir(), ossimString::size(), status, TEST_ERROR, TEST_FAILED, TEST_PASSED, TEST_TBD, ossimTimer::time_s(), and ossimString::toString().
Referenced by processTest().
|
private |
When the config file consists of a list of subordinate test config files, this method manages processing multiple configs.
Definition at line 603 of file ossimBatchTest.cpp.
References ossimString::contains(), ossimString::empty(), execute(), ossimFilename::expand(), ossimKeywordlist::findKey(), ossimKeywordlist::getSubstringKeyList(), ossimFilename::isReadable(), m_configFileName, ossimFilename::path(), ossimFilename::setPath(), and TEST_TBD.
Referenced by execute().
|
private |
Within a single config file can be multiple tests, distinguished by the "test*." prefix.
This method manages the execution of a single test.
This method manages the execution of a single test.
Definition at line 674 of file ossimBatchTest.cpp.
References ossimString::c_str(), ossimString::empty(), ossimFilename::fileNoExtension(), ossimKeywordlist::find(), ossimKeywordlist::getNumberOfSubstringKeys(), getTempFileName(), m_configFileName, m_logStr, processCommands(), ossimString::size(), TEST_DISABLED, TEST_ERROR, TEST_TBD, ossimString::toBool(), and ossimString::trim().
Referenced by execute().
|
private |
Initializes arg parser and outputs usage.
Definition at line 1171 of file ossimBatchTest.cpp.
References ossimApplicationUsage::addCommandLineOption(), ossimArgumentParser::getApplicationUsage(), ossimNotify(), ossimNotifyLevel_INFO, and ossimApplicationUsage::write().
Referenced by initialize().
|
private |
Writes template test config file, either exhaustive long form for flexibility, or simple short-form for easier test creation.
Definition at line 217 of file ossimBatchTest.cpp.
References ossimString::c_str(), ossimString::chars(), ossimFilename::exists(), ossimString::expandEnvironmentVariable(), ossimNotify(), and ossimNotifyLevel_NOTICE.
Referenced by initialize().
|
private |
Definition at line 135 of file ossimBatchTest.h.
Referenced by execute(), and initialize().
|
private |
Definition at line 136 of file ossimBatchTest.h.
Referenced by execute(), and initialize().
|
private |
Definition at line 142 of file ossimBatchTest.h.
Referenced by execute(), initialize(), processConfigList(), and processTest().
|
private |
Definition at line 144 of file ossimBatchTest.h.
Referenced by execute(), and makeDefaultResultsDir().
|
private |
Definition at line 145 of file ossimBatchTest.h.
Referenced by doDefaultClean(), execute(), processCommands(), and processTest().
|
private |
Definition at line 143 of file ossimBatchTest.h.
Referenced by doDefaultClean(), execute(), and makeDefaultResultsDir().
|
private |
Definition at line 137 of file ossimBatchTest.h.
Referenced by execute(), and initialize().
|
private |
Definition at line 138 of file ossimBatchTest.h.
Referenced by execute(), and initialize().
|
private |
Definition at line 139 of file ossimBatchTest.h.
Referenced by execute(), and ossimBatchTest().
|
private |
Definition at line 141 of file ossimBatchTest.h.
Referenced by execute(), and initialize().