Function to copy input data from source testing directory for use in unit tests.
327 std::cout <<
"In GetInputData" << std::endl;
332 OrgDir = IRAD::Sys::CWD();
338 if(!IRAD::Sys::FILEEXISTS(DirName)){
339 std::cout <<
"GetInputData Error: Could not find data directory, "
340 << DirName <<
". Exiting (fail)." << std::endl;
346 std::string InFileName;
347 std::string OutFileName;
352 if(!IRAD::Sys::FILEEXISTS(TestDir)){
353 IntDir = IRAD::Sys::CreateDirectory(TestDir);
355 std::cout <<
"GetInputData Error: Could not make directory, "
356 << TestDir <<
". Exiting (fail)." << std::endl;
362 IRAD::Sys::Directory SourceDir(DirName);
365 IntDir = IRAD::Sys::ChDir(TestDir);
367 std::cout <<
"GetInputData Error: Could not change directories to "
368 << TestDir <<
". Exiting (fail)." << std::endl;
373 for(std::vector<std::string>::iterator it = SourceDir.begin();
374 it != SourceDir.end(); ++it){
375 InFileName = DirName +
"/" + *it;
376 OutFileName = IRAD::Sys::CWD() +
"/" + *it;
378 if(IRAD::Sys::ISLINK(InFileName))
380 int IntDir = IRAD::Sys::SymLink(InFileName, OutFileName);
381 else if(IRAD::Sys::ISDIR(InFileName)) {
386 Inf.open(InFileName.c_str());
387 Ouf.open(OutFileName.c_str());
396 IntDir = IRAD::Sys::ChDir(OrgDir);
398 std::cout <<
"GetInputData Error: Could not change directories to "
399 << OrgDir <<
". Exiting (fail)." << std::endl;
std::string SourceDirPath
The string for the testing source directory.
virtual int GetInputData(std::string suffix, std::string TestDir)
Function to copy input data from source testing directory for use in unit tests.