41 m_preprocessTestList(),
43 m_templateModeActive(false),
49 typedef std::map<ossim_uint32, std::string>::value_type map_item;
66 if ( (ap.
argc() == 1) || ap.
read(
"-h") || ap.
read(
"--help") )
75 #if defined(_WIN32) || defined(_MSC_VER) && !defined(__CYGWIN__) && !defined(__MWERKS__) 76 _putenv(
"DEL_CMD=del /Q");
77 _putenv(
"DIFF_CMD=fc /W");
78 _putenv(
"COPY_CMD=copy /Y");
79 _putenv(
"MKDIR_CMD=mkdir");
80 _putenv(
"RM_CMD=del /Q");
81 _putenv(
"RMDIR_CMD=rmdir /S /Q");
84 setenv(
"DEL_CMD",
"rm -rf", 1);
85 setenv(
"DIFF_CMD",
"diff -w", 1);
86 setenv(
"COPY_CMD",
"cp", 1);
87 setenv(
"MKDIR_CMD",
"mkdir -p", 1);
88 setenv(
"RM_CMD",
"rm -f", 1);
89 setenv(
"RMDIR_CMD",
"rm -rf", 1);
93 std::string tempString;
96 if (ap.
read(
"-W", stringParam) || ap.
read(
"-W"))
99 if (templateFile.empty())
100 templateFile =
"obt_config_long_template.kwl";
105 if (ap.
read(
"-w", stringParam) || ap.
read(
"-w"))
108 if (templateFile.empty())
109 templateFile =
"obt_config_short_template.kwl";
115 while ( ap.
read(
"-a", stringParam) || ap.
read(
"--accept-test", stringParam) )
117 if ( tempString.size() )
121 std::vector<ossimString> result;
122 os.
split(result, separatorList);
123 std::vector<ossimString>::const_iterator i = result.begin();
124 while ( i != result.end() )
132 while ( ap.
read(
"-c", stringParam) || ap.
read(
"--clean-test", stringParam) )
134 if ( tempString.size() )
138 std::vector<ossimString> result;
139 os.
split(result, separatorList);
140 std::vector<ossimString>::const_iterator i = result.begin();
141 while ( i != result.end() )
149 while ( ap.
read(
"-p", stringParam) || ap.
read(
"--preprocess-test", stringParam) )
151 if ( tempString.size() )
155 std::vector<ossimString> result;
156 os.
split(result, separatorList);
157 std::vector<ossimString>::const_iterator i = result.begin();
158 while ( i != result.end() )
166 while ( ap.
read(
"-r", stringParam) || ap.
read(
"--run-test", stringParam) )
168 if ( tempString.size() )
172 std::vector<ossimString> result;
173 os.
split(result, separatorList);
174 std::vector<ossimString>::const_iterator i = result.begin();
175 while ( i != result.end() )
219 if (templateFile.
exists())
222 del_cmd += templateFile;
224 if (system(del_cmd.
chars()) != 0)
226 cerr <<
"ERROR: Could not delete existing template file before writing new template." 227 " Please delete the existing and rerun the command."<< endl;
236 <<
"Could not open: " << templateFile.
c_str() << std::endl;
242 out<<
"//===================================================================================\n" 244 <<
"// File: " << templateFile.
c_str() <<
"\n" 245 <<
"// Generated by command: ossim-batch-test -W " << templateFile.
c_str() <<
"\n" 246 <<
"// Description: ossim-batch-test template config file.\n" 248 <<
"// Control flags:\n" 249 <<
"// Use 1 or true, 0 or false to turn on and off sections.\n" 250 <<
"// Typically preprocess and expected results only turned on for first run.\n" 251 <<
"// Clean commands should erase anything created by this test.\n" 252 <<
"// Command order if flag turned on:\n" 253 <<
"// 1) clean, 2) pre-process, 3) expected, 4) test, 5) post-process\n" 256 <<
"// * The following environment variables must be set before running batch test:\n" 257 <<
"// OSSIM_BATCH_TEST_DATA Top-level dir containing all test source data\n" 258 <<
"// OSSIM_BATCH_TEST_EXPECTED Top-level dir containing all test expected results \n" 259 <<
"// OSSIM_BATCH_TEST_RESULTS Top-level dir containing all test results and logging output \n" 261 <<
"// * The variables OBT_EXP_DIR and OBT_OUT_DIR are assigned during run-time to\n" 262 <<
"// the proper paths according to the config filename. It isn't required to replace\n" 263 <<
"// these nor predefine them in the environment. You can leave them as is or modify\n" 264 <<
"// the paths to your unconventional file paths.\n" 266 <<
"// * In order to preserve platform independence, please utilize the following \n" 267 <<
"// variables for the common OS commands when adding new commands to the test\n" 268 <<
"// configuration KWL file. Examples are provided in this template\n" 269 <<
"// $(DIFF_CMD) Use this var for windows \"fc\" or linux \"diff\"\n" 270 <<
"// $(COPY_CMD) Use this var for windows \"copy\" or linux \"cp\"\n" 271 <<
"// $(MKDIR_CMD) Use this var for windows \"mkdir\" or linux \"mkdir\"\n" 272 <<
"// $(RM_CMD) Use this var for windows \"del /Q\" or linux \"rm -f\"\n" 273 <<
"// $(RMDIR_CMD) Use this var for windows \"rmdir /S /Q\" or linux \"rm -rf\"\n" 274 <<
"// This application will set the environment variables to the proper values at \n" 275 <<
"// runtime, so no need to worry about defining these.\n" 277 <<
"// * Use forward slashes \"//\", at beginning of line for comments.\n" 279 <<
"// * You can use existing environment variables as $(YOUR_VARIABLE). They will be \n" 280 <<
"// expanded at run time if valid.\n" 282 <<
"// * Clean, preprocess, run, and accept test sections can be switched on or off\n" 283 <<
"// at run time. These override config file flags. Optional arguments are the \n" 284 <<
"// the following: \n" 285 <<
"// -c or --clean-test \n" 286 <<
"// -p or --preprocess-test\n" 287 <<
"// -r or --run-test \n" 288 <<
"// -a or --accept-test \n" 289 <<
"// Multiple tests can be entered by quoting string of space-separated\n" 290 <<
"// test names, e.g. \"test1 test2\". To do all tests use \"all\" or leave blank.\n" 292 <<
"//===================================================================================\n" 294 <<
"// If the config file will contain only a list of subordinate config files to be\n" 295 <<
"// run as one consolidated \"super-test\", then use only the following suffixed\n" 296 <<
"// keywords. Otherwise, REMOVE THESE:\n" 297 <<
"test_config_file1: <my_first_test_config.kwl>\n" 298 <<
"test_config_file2: <my_second_test_config.kwl>\n" 301 <<
"// The remaining keywords are used exclusive of \"test_config_fileX\" above. The\n" 302 <<
"// config files must be either a list of subordinate configs, or a concrete, \n" 303 <<
"// low-level config file.\n" 305 <<
"// Where you want the top-level (inter-test) log files to go:\n" 306 <<
"log_directory: $(OBT_OUT_DIR)\\..\\log\n" 308 <<
"//===================================================================================\n" 309 <<
"// Begin Test 1\n" 310 <<
"// NOTE: If the config file contains just a single test, then the use of the \"test1\"\n" 311 <<
"// prefix is optional. Make sure the results directory spec reflects the proper path.\n" 313 <<
"test1.name: <YOUR_TEST_NAME>\n" 314 <<
"test1.description: Test height for the center of the image for test2 and test3.\n" 316 <<
"// Controls/turns on/off whole test (all sections):\n" 317 <<
"test1.enabled: 1\n" 319 <<
"// Individual control flags:\n" 320 <<
"test1.run_clean_commands: 0\n" 321 <<
"test1.run_preprocessing_commands: 0\n" 322 <<
"test1.run_expected_results_commands: 0\n" 323 <<
"test1.run_test_commands: 1\n" 324 <<
"test1.run_postprocessing_commands: 1\n" 326 <<
"// Temp file to catch diff output.\n" 327 <<
"test1.temp_file: $(TEMP)\\tmp.txt\n" 329 <<
"// Clean up commands\n" 330 <<
"test1.clean_command1: $(RMDIR_CMD) $(OBT_OUT_DIR)\n" 332 <<
"// Pre-process commands\n" 333 <<
"test1.preprocess_command1: $(MKDIR_CMD) $(OBT_OUT_DIR)\n" 334 <<
"test1.preprocess_command1: $(MKDIR_CMD) $(OBT_OUT_DIR)\\..\\log\n" 336 <<
"//---------------------------------------\n" 337 <<
"// Commands to generate expected results\n" 338 <<
"//---------------------------------------\n" 339 <<
"// Since test2 and test3 are dependent on elevation test the center of the image.\n" 340 <<
"test1.expected_results_command0: ossim-info --height -42.8508 147.2537 > $(OBT_EXP_DIR)\\height.txt\n" 341 <<
"test1.expected_results_command1: $(COPY_CMD) $(OBT_OUT_DIR)\\height.txt $(OBT_EXP_DIR)\\height.txt\n" 343 <<
"//---------------------------------------\n" 344 <<
"// The actual commands to test\n" 345 <<
"//---------------------------------------\n" 346 <<
"test1.test_command0: ossim-info --height -42.8508 147.2537 > $(OBT_OUT_DIR)\\height.txt\n" 348 <<
"//-------------------------------------------\n" 349 <<
"// Post process commands for diffs, etc.\n" 350 <<
"//-------------------------------------------\n" 351 <<
"test1.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)\\height.txt $(OBT_OUT_DIR)\\height.txt\n" 354 <<
"// End <TEST_NAME>\n" 355 <<
"//===================================================================================\n" 356 <<
"// Begin <TEST2_NAME>...\n" 358 <<
"// You can specify additional tests by copying the test1 keywords and changing the\n" 359 <<
"// prefix indices to be unique. It is not necessary to be consecutive.\n" 365 out<<
"//===================================================================================\n" 367 <<
"// File: " << templateFile.
c_str() <<
"\n" 368 <<
"// Generated by command: ossim-batch-test -w " << templateFile.
c_str() <<
"\n" 369 <<
"// Description: ossim-batch-test template config file.\n" 372 <<
"// * The following environment variables must be set before running batch test:\n" 373 <<
"// OSSIM_BATCH_TEST_DATA Top-level dir containing all test source data\n" 374 <<
"// OSSIM_BATCH_TEST_EXPECTED Top-level dir containing all test expected results \n" 375 <<
"// OSSIM_BATCH_TEST_RESULTS Top-level dir containing all test results and logging output \n" 377 <<
"// * You can use existing environment variables as $(YOUR_VARIABLE). They will be \n" 378 <<
"// expanded at run time if valid.\n" 380 <<
"// * If the config file contains more than a single test, then it will be necessary \n" 381 <<
"// to prefix all test-specific keywords with \"testN.\"\n" 383 <<
"// * The variables OBT_EXP_DIR and OBT_OUT_DIR are assigned during runtime to\n" 384 <<
"// the proper paths according to the config filename. It isn't required to replace\n" 385 <<
"// these nor predefine them in the environment. You can leave them as is or modify\n" 386 <<
"// the paths to your unconventional file paths.\n" 388 <<
"//===================================================================================\n" 390 <<
"description: Test height for the center of the image for test2 and test3.\n" 392 <<
"//---------------------------------------\n" 393 <<
"// Commands to generate expected results.\n" 394 <<
"//---------------------------------------\n" 395 <<
"expected_results_command0: ossim-info --height -42.8508 147.2537 > $(OBT_OUT_DIR)\\height.txt\n" 396 <<
"expected_results_command1: $(COPY_CMD) $(OBT_OUT_DIR)\\height.txt $(OBT_EXP_DIR)\\height.txt\n" 398 <<
"//---------------------------------------\n" 399 <<
"// The actual commands to test.\n" 400 <<
"//---------------------------------------\n" 401 <<
"test_command0: ossim-info --height -42.8508 147.2537 > $(OBT_OUT_DIR)\\height.txt\n" 403 <<
"//---------------------------------------\n" 404 <<
"// The post-processing (comparison) commands. Typically these involve a file \n" 405 <<
"// comparison of last run command against expected results.\n" 406 <<
"//---------------------------------------\n" 407 <<
"postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)\\height.txt $(OBT_OUT_DIR)\\height.txt\n" 428 cout <<
"\nExecuting batch test for config: <" << configName <<
">" << endl;
437 if (base_output_dir.
empty())
440 cout<<
"\nossimBatchTest WARNING: The environment variable OSSIM_BATCH_TEST_RESULTS is not " 441 "defined. Results will be written relative to the current working directory."<<endl;
448 base_output_dir = base_output_dir.
dirCat(configName);
470 errmsg <<
"Error encountered reading test config at <"<<
m_configFileName<<
">."<<endl;
479 cout<<
"\nossimBatchTest: Exiting <"<<configName<<
"> with overall status = " 488 std::string testCommand =
"run_clean_commands";
494 std::string testCommand =
"run_preprocessing_commands";
500 std::string testCommand =
"run_expected_results_commands";
506 std::string testCommand =
"run_test_commands";
511 const char* lookup = kwl.
find(
"log_directory");
521 errmsg <<
"Could not create: <" << logDir <<
">."<< endl;
528 logFile = logDir.
dirCat(logFile);
535 errmsg <<
"Could not open: <" << logFile <<
">."<< endl;
539 cout <<
"Logging to file: " << logFile <<
"\n";
544 <<
"// ossim-batch-test log:\n" 545 <<
"// date format = yyyymmddhhmmss\n" 547 <<
"start_time: " << date <<
"\n" 556 std::vector<ossimString> prefixes;
560 if (prefixes.empty())
561 prefixes.push_back(
"");
567 status |= individual_test_status;
571 m_logStr <<
"\nstop_time: " << date <<
"\n";
573 m_logStr <<
"total elapsed time in seconds: " 574 << std::setiosflags(ios::fixed) << std::setprecision(4)
575 << (stopTime-startTime)
579 cout <<
"\ntotal elapsed time in seconds: " 580 << std::setiosflags(ios::fixed) << std::setprecision(4)
581 << (stopTime-startTime)
582 <<
"\nWrote log: " << logFile <<
"\n" << endl;
587 cerr <<
"\nossimBatchTest::execute() caught exception: " << e.
what() << endl;
591 cerr <<
"\nossimBatchTest::execute() caught unhandled exception: " << endl;
594 cout<<
"ossimBatchTest: Exiting <"<<configName<<
"> with status = " 608 ossimString keywordRegEx =
"test_config_file[0-9]+";
609 std::vector<ossimString> keywords;
631 overall_test_status |=
execute();
635 return overall_test_status;
647 std::string frmt =
"%Y%m%d%H%M%S";
650 size_t count = strftime(s, 15, frmt.c_str(), lt);
651 if ( count && (count < 15) )
663 logFile =
"obt-log-";
683 const char* lookup = kwl.
find( prefix,
"name" );
688 if (testName.
empty())
693 testName = prefix.
trim(
".");
696 m_logStr <<
"\n----------------------------------------------------------------------\n";
701 lookup = kwl.
find( prefix,
"enabled" );
717 statusString =
"test: disabled";
719 cout <<
"test_name: " << testName <<
"\n" << statusString << endl;
720 m_logStr <<
"test_name: " << testName <<
"\n" << statusString << endl;
724 cout <<
"\n\nbegin_test:\n" << prefix <<
"name: " << testName <<
"\n";
725 m_logStr <<
"\n\nbegin_test:\n" << prefix <<
"name: " << testName <<
"\n";
726 lookup = kwl.
find( prefix,
"description" );
728 m_logStr <<
"description: " << lookup <<
"\n";
730 bool preProcessFlag =
false;
731 bool expectedFlag =
false;
732 bool testFlag =
false;
733 bool postProcessFlag =
false;
734 bool cleanFlag =
false;
737 lookup = kwl.
find(prefix.
c_str(),
"run_clean_commands");
743 lookup = kwl.
find(prefix.
c_str(),
"run_preprocessing_commands");
749 lookup = kwl.
find(prefix.
c_str(),
"run_expected_results_commands");
755 lookup = kwl.
find(prefix.
c_str(),
"run_test_commands");
761 lookup = kwl.
find(prefix.
c_str(),
"run_postprocessing_commands");
767 m_logStr <<
"preProcessFlag: " << preProcessFlag
768 <<
"\nexpectedFlag: " <<expectedFlag
769 <<
"\ntestFlag: " <<testFlag
770 <<
"\npostProcessFlag: " <<postProcessFlag
771 <<
"\ncleanFlag: " <<cleanFlag
781 if ( preProcessFlag && !(testStatus &
TEST_ERROR))
783 ossimString prefixBase = prefix +
"preprocess_command";
786 if ( expectedFlag && !(testStatus &
TEST_ERROR))
788 ossimString prefixBase = prefix +
"expected_results_command";
796 if ( postProcessFlag && !(testStatus &
TEST_ERROR))
802 ossimString prefixBase = prefix +
"postprocess_command";
803 testStatus |=
processCommands( prefixBase, kwl, testName,
false, tempFile );
807 m_logStr << testName <<
": ERROR temp file could not be derived..." << endl;
812 cout <<
"end_test:\n";
815 m_logStr <<
"----------------------------------------------------------------------\n";
842 if (num_commands == 0)
845 if (prefixBase.
contains(
"preprocess"))
863 const char* lookup = 0;
865 bool postprocessing =
false;
866 if (prefixBase.
contains(
"postprocess"))
867 postprocessing =
true;
869 while ( processedIndexes < num_commands )
872 lookup = kwl.
find( cmd_kw );
876 if ( tempFileName.
size() )
878 command_line +=
" > " + tempFileName;
881 m_logStr <<
"executing command: " << command_line <<
"\n";
886 m_logStr <<
"begin: " << date <<
"\n";
893 int status = system(command_line.chars());
896 else if (postprocessing)
907 << testName <<
"[" << index <<
"]: elapsed time in seconds: " 908 << std::setiosflags(ios::fixed)
909 << std::setprecision(4)
910 << (stopTime-startTime) <<
"\n";
918 if ( prefixBase.
size() )
920 statusString << prefixBase;
924 statusString <<
"test";
926 statusString <<
"[" << index <<
"]: ";
931 if ( postprocessing )
933 statusString <<
"FAILED";
937 statusString <<
"ERROR";
940 cout << statusString.str() << endl;
941 m_logStr << statusString.str() << endl;
942 m_logStr << command <<
"\noutput follows:\n";
944 if (!tempFileName.
empty())
946 in.open(tempFileName.
c_str(), ios::in | ios::binary);
950 while ( in.get(ch) )
m_logStr.put(ch);
958 statusString <<
"PASSED";
959 cout << statusString.str() << endl;
960 m_logStr << statusString.str() << endl;
967 if ( index >= MAX_INDEX )
975 const std::string& testCommand,
978 if ( testList.empty() || testCommand.empty() || (kwl.
getSize()==0) )
982 std::vector<std::string>::const_iterator testIter = testList.begin();
983 bool enableAllTestFlag =
false;
986 if ( firstTest ==
"all" )
988 enableAllTestFlag =
true;
991 while ( testIter != testList.end() )
1002 bool is_single_test =
false;
1005 regExpStr =
"test_command[0-9]+";
1010 is_single_test =
true;
1016 while ( processedIndexes < num_tests )
1019 bool test_name_matches =
true;
1020 bool test_exists =
true;
1022 if (!is_single_test)
1026 test_name_matches = (prefix == (*testIter).
c_str());
1031 regExpStr = prefix +
"test_command[0-9]+";
1033 test_exists = cmd_count > 0;
1038 if ( test_name_matches || enableAllTestFlag )
1045 kwl.
add(prefix.
c_str(), testCommand.c_str(),
"1",
true);
1046 if ( testCommand ==
"run_expected_results_commands" )
1049 kwl.
add(prefix.
c_str(),
"run_preprocessing_commands",
"1",
true);
1051 if ( testCommand ==
"run_test_commands" )
1054 kwl.
add(prefix.
c_str(),
"run_preprocessing_commands",
"1",
true);
1055 kwl.
add(prefix.
c_str(),
"run_postprocessing_commands",
"1",
true);
1061 if ( index >= MAX_INDEX )
break;
1077 cerr <<
"Could not create: " <<
m_outDir << endl;
1082 cerr <<
"Could not create: " <<
m_expDir << endl;
1101 command_line = del_cmd +
" " +
m_outDir;
1102 m_logStr <<
"executing command: " << command_line <<
"\n";
1103 if (system(command_line) != 0)
1105 m_logStr <<
"ERROR: execution failed!\n";
1106 cerr <<
"ERROR: Could not delete <"<<
m_outDir<<
">. Clean operation failed."<< endl;
1116 command_line = del_cmd +
" " + tmpDir;
1117 m_logStr <<
"executing command: " << command_line <<
"\n";
1118 if (system(command_line) != 0)
1120 m_logStr <<
"ERROR: execution failed!\n";
1121 cerr <<
"ERROR: Could not delete <"<<
m_outDir<<
">. Clean operation failed."<< endl;
1134 const char* lookup = kwl.
find(prefix.
c_str(),
"temp_file");
1139 tempFile = tempFile.
expand();
1148 tempFile = tempFile.
dirCat(
"tmp.txt");
1156 return ( tempFile.
size() > 0 );
1164 if (!tempFile.
empty())
1165 tempFile = tempFile.
dirCat(
"tmp");
1168 return ( tempFile.
size() > 0 );
1176 "<testX> Runs \"run_expected_results_commands\" portion from test configuration file for " 1177 "testX where X is some test number, i.e. 1, 2, 3... This will turn off all other test in " 1178 "the test config file. Notes: Multiple tests can be entered by quoting string of space " 1179 "separated test, e.g. \"test1 test2\". To accept all tests use \"all\" for test.");
1182 "from test configuration file for testX where X is some test number, i.e. 1, 2, 3... This " 1183 "will turn off all other test in the test config file. Notes: Multiple tests can be entered " 1184 "by quoting string of space separated test, e.g. \"test1 test2\". To clean all tests use " 1185 "\"all\" for test.");
1188 "<testX> Runs \"run_preprocessing_commands\" portion from test configuration file for testX " 1189 "where X is some test number, i.e. 1, 2, 3... This will turn off all other test in the test " 1190 "config file. Notes: Multiple tests can be entered by quoting string of space separated " 1191 "test, e.g. \"test1 test2\". To preprocess all tests use \"all\" for test.");
1194 "<testX> Runs \"run_test_commands\" portion from test configuration file for testX where X " 1195 "is some test number, i.e. 1, 2, 3... This will turn off all other test in the test config " 1196 "file. Notes: Multiple tests can be entered by quoting string of space separated test, e.g. " 1197 "\"test1 test2\". To run all tests use \"all\" for test.");
1202 "<template_name.kwl> Writes a long-form (-W) or a short-form (-w) template test " 1203 "configuration file.");
1216 const std::string::size_type SIZE = s.size();
1217 std::string::size_type i = 0;
1227 bool replace =
true;
1230 if ( (s[i+1] ==
'Q') || (s[i+1] ==
'W') || (s[i+1] ==
'Y') )
1232 if ( s[i+2] ==
' ' )
void clear()
Erases the entire container.
void write(std::ostream &output, const UsageMap &um, unsigned int widthOfOutput=80)
void addCommandLineOption(const ossimString &option, const ossimString &explanation)
ossim_uint8 processTest(const ossimString &prefix, const ossimKeywordlist &kwl)
Within a single config file can be multiple tests, distinguished by the "test*." prefix.
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
ossim_uint32 getNumberOfSubstringKeys(const ossimString ®ularExpression) const
void setStartTick()
Set the start.
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.
void usage(ossimArgumentParser &ap)
Initializes arg parser and outputs usage.
Represents serializable keyword/value map.
bool addFile(const char *file)
const std::string & findKey(const std::string &key) const
Find methods that take std::string(s).
std::basic_ifstream< char > ifstream
Class for char input file streams.
const char * find(const char *key) const
ossimFilename expand() const
Method to do file name expansion.
ossim_uint8 processConfigList(const ossimKeywordlist &kwl)
When the config file consists of a list of subordinate test config files, this method manages process...
bool read(const std::string &str)
search for an occurance of a string in the argument list, on sucess remove that occurance from the li...
std::vector< std::string > m_cleanTestList
bool contains(char aChar) const
ossimFilename & setPath(const ossimString &p)
static ossimString toString(bool aValue)
Numeric to string methods.
void split(std::vector< ossimString > &result, const ossimString &separatorList, bool skipBlankFields=false) const
Splits this string into a vector of strings (fields) using the delimiter list specified.
ossim_uint8 execute()
Performs the actual test with the config filename previously set in initialize() or processConfigList...
ossimApplicationUsage * getApplicationUsage()
std::vector< std::string > m_runTestList
void reportRemainingOptionsAsUnrecognized(ossimErrorSeverity severity=OSSIM_BENIGN)
for each remaining option report it as an unrecongnized.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
ossimFilename getCurrentWorkingDir() const
void preprocessKwl(const std::vector< std::string > &testList, const std::string &testCommand, ossimKeywordlist &kwl)
Modifies the config's KWL to explicitly declare implied keywords.
bool getTempFileName(const ossimString &prefix, const ossimKeywordlist &kwl, ossimFilename &tempFile) const
Gets the temp file name.
ossimString expandEnvironmentVariable() const
If the variable "$(env_var_name)" is found in the string, where "env_var_name" is any system environm...
bool errors(ossimErrorSeverity severity=OSSIM_BENIGN) const
std::vector< std::string > m_acceptTestList
static ossimTimer * instance()
ossimFilename m_configFileName
virtual const char * what() const
Returns the error message.
std::string::size_type size() const
void getLogFilename(ossimFilename &logFile)
Establishes name of output log file.
bool toBool() const
String to numeric methods.
double time_s() const
Get elapsed time in seconds.
unsigned int ossim_uint32
const char * chars() const
For backward compatibility.
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
void writeTemplate(const ossimFilename &templateFile, bool long_form)
Writes template test config file, either exhaustive long form for flexibility, or simple short-form f...
ossimBatchTest()
This constructor only initializes data members to null/defaults.
static ossimString downcase(const ossimString &aString)
std::vector< ossimString > getSubstringKeyList(const ossimString ®ularExpression) const
std::map< ossim_uint32, std::string > m_statusLabels
static ossimEnvironmentUtility * instance()
bool getDefaultTempFileDir(ossimFilename &tempDir) const
Gets the default temp directory /data1/test/results/linux/tmp.
bool makeDefaultResultsDir()
Default preprocessing step makes expected and output results directories.
bool doDefaultClean()
Default clean step deletes all files in out and exp dirs.
std::vector< std::string > m_preprocessTestList
ossimFilename fileNoExtension() const
OSSIMDLLEXPORT void ossimSetLogFilename(const ossimFilename &filename)
std::string convertToNative(const char *lookup) const
Converts string slashes to either forward or backward taking into account that windows commands with ...
ossimFilename dirCat(const ossimFilename &file) const
ossim_uint32 getSize() const
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
ossimString getEnvironmentVariable(const ossimString &variable) const
bool m_templateModeActive
std::basic_ofstream< char > ofstream
Class for char output file streams.
bool initialize(ossimArgumentParser &ap)
Initializes the test session given the command line.
void setEnvironmentVariable(const char *variable, const char *value) const
char ** argv()
return the argument array.
bool createDirectory(bool recurseFlag=true, int perm=0775) const
void getDateString(ossimString &date)
Fetches string from OS for naming and tagging the log file.
int & argc()
return the argument count.
void setExpandEnvVarsFlag(bool flag)
ossimFilename path() const
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
void writeErrorMessages(std::ostream &output, ossimErrorSeverity sevrity=OSSIM_BENIGN)
write out error messages at an above specified .