(
"find_its_output.tab");
80 if( ! dirEntry.
IsFile() ) {
85 stringname =
file.GetName();
91 const stringsFileName =
file.GetName();
92vector<string> vecFileNamePieces;
94BOOST_REQUIRE(vecFileNamePieces.size() == 3);
96 stringtsTestName = vecFileNamePieces[0];
97BOOST_REQUIRE(!tsTestName.empty());
98 stringtsFileType = vecFileNamePieces[1] +
"."+ vecFileNamePieces[2];
99BOOST_REQUIRE(!tsFileType.empty());
102(*m_pTestNameToInfoMap)[vecFileNamePieces[0]];
118BOOST_FAIL(
"Unknown file type "<< sFileName <<
".");
133BOOST_FAIL(
"input file "<<
input<<
" does not exist.");
135cerr <<
"Creating new test case from "<<
input<<
" ..."<< endl;
147edit::CFindITSParser parser(
input.c_str(), tse);
153}
while( !parser.AtEOF() );
157BOOST_FAIL(
"Error: "<<
input<<
" failed during conversion.");
161cerr <<
" Produced new ASN1 file "<<
output<<
"."<< endl;
163cerr <<
" ... Done."<< endl;
168 constvector<string> kEmptyStringVec;
179 const string& sName = name_to_info_it->first;
186cerr <<
"Testing "<< testInfo.
mInFile.
GetName() <<
" against "<<
201edit::CFindITSParser parser(testInfo.
mInFile.
GetPath().c_str(), tse);
207}
while( !parser.AtEOF() );
211BOOST_FAIL(
"Error: "<< sTestName <<
" failed during conversion.");
223BOOST_ERROR(
"Error: "<< sTestName <<
" failed due to post processing diffs.");
235arg_descrs->AddDefaultKey(
"test-dir",
"TEST_FILE_DIRECTORY",
236 "Set the root directory under which all test files can be found.",
239arg_descrs->AddDefaultKey(
"update-case",
"UPDATE_CASE",
240 "Produce .asn and .error files from given name for new or updated test case.",
243arg_descrs->AddFlag(
"update-all",
244 "Update all test cases to current reader code (dangerous).",
246arg_descrs->AddFlag(
"keep-diffs",
247 "Keep output files that are different from the expected.",
259 CDirtest_cases_dir( args[
"test-dir"].AsDirectory() );
260BOOST_REQUIRE_MESSAGE( test_cases_dir.
IsDir(),
261 "Cannot find dir: "<< test_cases_dir.
GetPath() );
263 boolupdate_all = args[
"update-all"].AsBoolean();
269 stringupdate_case = args[
"update-case"].AsString();
270 if(!update_case.empty()) {
275 constvector<string> kEmptyStringVec;
281 const string& sName = name_to_info_it->first;
282 const STestInfo& testInfo = name_to_info_it->second;
283cout <<
"Verifying: "<< sName << endl;
289 const string& sName = name_to_info_it->first;
290 const STestInfo& testInfo = name_to_info_it->second;
292cout <<
"Running test: "<< sName << endl;
294BOOST_CHECK_NO_THROW(
sRunTest(sName, testInfo, args[
"keep-diffs"]));
static CNcbiApplication * Instance(void)
Singleton method.
CTestNameToInfoMapLoader(TTestNameToInfoMap *pTestNameToInfoMap)
TTestNameToInfoMap * m_pTestNameToInfoMap
void operator()(const CDirEntry &dirEntry)
static SQLCHAR output[256]
static int RunTests(void)
Code to iterate through all tests to run.
static char test_name[128]
virtual const CArgs & GetArgs(void) const
Get parsed command line arguments.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
@ eString
An arbitrary string.
@ 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.
virtual bool Remove(TRemoveFlags flags=eRecursive) const
Remove a directory entry.
bool IsDir(EFollowLinks follow=eFollowLinks) const
Check whether a directory entry is a directory.
bool CompareTextContents(const string &file, ECompareText mode, size_t buf_size=0) const
Compare files contents in text form.
bool IsFile(EFollowLinks follow=eFollowLinks) const
Check whether a directory entry is a file.
static string GetTmpName(ETmpFileCreationMode mode=eTmpFileGetName)
Get temporary file name.
static string ConcatPath(const string &first, const string &second)
Concatenate two parts of the path for the current OS.
string GetName(void) const
Get the base entry name with extension (if any).
const string & GetPath(void) const
Get entry path.
virtual bool Copy(const string &new_path, TCopyFlags flags=fCF_Default, size_t buf_size=0) const
Copy the entry to a location specified by "new_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 â.
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
CSeq_entry_Handle AddTopLevelSeqEntry(CSeq_entry &top_entry, TPriority pri=kPriority_Default, EExist action=eExist_Default)
Add seq_entry, default priority is higher than for defaults or loaders Add object to the score with p...
IO_PREFIX::ofstream CNcbiOfstream
Portable alias for ofstream.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
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 EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)
Check if a string ends with a specified suffix value.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
Utility stuff for more convenient using of Boost.Test library.
BOOST_AUTO_TEST_CASE(RunTests)
const string dirTestFiles("rna_edit_test_cases")
void sUpdateAll(CDir &test_cases_dir)
map< TTestName, STestInfo > TTestNameToInfoMap
const string extOrigInput("input.asn")
const string extOutput("output.asn")
void sUpdateCase(CDir &test_cases_dir, const string &test_name)
const string extInput("find_its_output.tab")
const string extKeep("new")
void sRunTest(const string &sTestName, const STestInfo &testInfo, bool keep)
NCBITEST_INIT_CMDLINE(arg_descrs)
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