ifstream in_file(filename.c_str());
59BOOST_REQUIRE(in_file.good());
70 returnfeat1.
Equals(feat2);
87vector<string> vecRange;
89BOOST_REQUIRE(vecRange.size() == 2);
100 const string& extBaseline) :
108 if(!dirEntry.
IsFile()) {
114 const stringfileName =
file.GetName();
119vector<string> vecFilenamePieces;
121BOOST_REQUIRE(vecFilenamePieces.size() == 3);
123 const stringtestRange = vecFilenamePieces[1];
124BOOST_REQUIRE(!testRange.empty());
126 const stringtestName = vecFilenamePieces[0] +
"."+ testRange ;
127BOOST_REQUIRE(!testName.empty());
129 const stringfileType = vecFilenamePieces[2];
130BOOST_REQUIRE(!fileType.empty());
133(*m_pTestNameToInfoMap)[testName];
149BOOST_FAIL(
"Unknown file type "<< fileName <<
".");
164cout <<
"Running feature-trim test\n";
166 if(!testName.empty()) {
167cerr <<
"Running "<< testName <<
"\n";
176 const boolsuccess = trimmed_feat->
Equals(*baseline);
184BOOST_ERROR(
"Error: "<< testName <<
" failed.");
198arg_descrs->AddDefaultKey(
"test-dir",
"TEST_FILE_DIRECTORY",
199 "Set the root directory under which all test files can be found.",
203arg_descrs->AddFlag(
"keep-diffs",
204 "Keep output files that differ from expected baseline.",
217 const stringextBaseline(
"baseline");
221 CDirtest_cases_dir(args[
"test-dir"].AsDirectory());
222BOOST_REQUIRE_MESSAGE(test_cases_dir.
IsDir(),
223 "Cannot find dir: "<< test_cases_dir.
GetPath());
226 constvector<string> kEmptyStringVec;
229&testNameToInfoMap,
extInput, extBaseline);
239 const string& testName = name_to_info_it->first;
240 const STestInfo& testInfo = name_to_info_it->second;
241cout <<
"Verifying: "<< testName << endl;
249 const string& testName = name_to_info_it->first;
250 const STestInfo& testInfo = name_to_info_it->second;
static CNcbiApplication * Instance(void)
Singleton method.
namespace ncbi::objects::
CTestNameToInfoMapLoader(TTestNameToInfoMap *pTestNameToInfoMap, const string &extInput, const string &extBaseline)
TTestNameToInfoMap * m_pTestNameToInfoMap
void operator()(const CDirEntry &dirEntry)
static int RunTests(void)
Code to iterate through all tests to run.
unsigned int TSeqPos
Type for sequence locations and lengths.
virtual const CArgs & GetArgs(void) const
Get parsed command line arguments.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
@ eDirectory
Name of file directory.
void FindFilesInDir(const CDir &dir, const vector< string > &masks, const vector< string > &masks_subdir, TFindFunc &find_func, TFindFiles flags=fFF_Default)
Find files in the specified directory.
bool IsDir(EFollowLinks follow=eFollowLinks) const
Check whether a directory entry is a directory.
bool IsFile(EFollowLinks follow=eFollowLinks) const
Check whether a directory entry is a file.
const string & GetPath(void) const
Get entry path.
virtual bool Exists(void) const
Check existence of file.
@ fFF_Recursive
descend into sub-dirs
@ fFF_Default
default behavior
#define MSerial_AsnText
I/O stream manipulators â.
virtual bool Equals(const CSerialObject &object, ESerialRecursionMode how=eRecursive) const
Check if both objects contain the same values.
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
IO_PREFIX::ofstream CNcbiOfstream
Portable alias for ofstream.
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
CRange< TSeqPos > m_Range
Utility stuff for more convenient using of Boost.Test library.
BOOST_AUTO_TEST_CASE(RunTests)
CRef< CSeq_feat > s_ReadFeat(const string &filename)
void sRunFeatureTrimTest(const string &testName, const STestInfo &testInfo, const bool keep)
CRange< TSeqPos > s_GetRangeFromString(const string &rangeString)
bool s_AreFeatsEqual(const CSeq_feat &feat1, const CSeq_feat &feat2)
const string dirTestFiles("feature_edit_test_cases")
NCBITEST_INIT_CMDLINE(arg_descrs)
const string extInput("find_its_output.tab")
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4