1 #include <gtest/gtest.h>
2 #include <Poco/SharedPtr.h>
27 extern Poco::SharedPtr<SphinxFunctionalObject>
pObj;
36 struct dirent* d =
nullptr;
37 DIR* dir = opendir(sourceDir.c_str());
42 while((d = readdir(dir)))
45 if (fileName !=
"." && fileName !=
"..")
46 files.push_back(fileName);
48 if (closedir(dir)==-1)
55 error = strerror(errno);
63 std::string
fileName, srcFile, dstFile;
65 for (;i<files.size();++i)
69 size_t pos = fileName.find_last_of(
'.');
70 if (pos!=std::string::npos)
71 fileName.resize(pos+1);
74 std::stringstream outMsg, errMsg;
75 ProcExec procExec(
"cp "+srcFile+
" "+dstFile);
76 if (!procExec.
exec(outMsg, errMsg))
105 ASSERT_FALSE(
pObj.isNull());