A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/unit__test__title__parser_8cpp_source.html below:

NCBI C++ ToolKit: src/objtools/readers/unit_test/unit_test_title_parser.cpp Source File

89  if

( ! dirEntry.

IsFile

() ) {

94  string

name =

file

.GetName();

100  const string

sFileName =

file

.GetName();

101

vector<CTempString> vecFileNamePieces;

102  NStr::Split

( sFileName,

"."

, vecFileNamePieces );

103

BOOST_REQUIRE(vecFileNamePieces.size() == 2);

106

BOOST_REQUIRE(!tsTestName.

empty

());

108

BOOST_REQUIRE(!tsFileType.

empty

());

127

BOOST_FAIL(

"Unknown file type "

<< sFileName <<

"."

);

148

BOOST_FAIL(

"input file "

<<

input

<<

" does not exist."

);

150

cerr <<

"Creating new test case from "

<<

input

<<

" ..."

<< endl;

156  for

(

string

line; getline(ifstr, line);) {

160  for

(

const auto

&

mod

: mods) {

161

ofstr <<

mod

.GetName() <<

" "

<<

mod

.GetValue() << endl;

163  if

(!remainder.empty()) {

164

ofstr << remainder << endl;

171

BOOST_FAIL(

"Error: "

<<

input

<<

" failed during conversion."

);

176

cerr <<

" Produced new Modifier file "

<<

output

<<

"."

<< endl;

186  const

vector<string> kEmptyStringVec;

198  const string

& sName = name_to_info_it->first;

206

cerr <<

"Testing "

<< testInfo.

mInFile

.

GetName

() <<

" against "

<<

217  for

(

string

line; getline(ifstr, line);) {

221  for

(

const auto

&

mod

: mods) {

222

ofstr <<

mod

.GetName() <<

" "

<<

mod

.GetValue() << endl;

224  if

(!remainder.empty()) {

225

ofstr << remainder << endl;

231

BOOST_ERROR(

"Error: "

<< sTestName <<

" failed during conversion."

);

249

BOOST_ERROR(

"Error: "

<< sTestName <<

" failed due to post processing diffs."

);

261

BOOST_ERROR(

"Error: "

<< sTestName <<

" failed due to error handling diffs."

);

272

arg_descrs->AddDefaultKey(

"test-dir"

,

"TEST_FILE_DIRECTORY"

,

273  "Set the root directory under which all test files can be found."

,

276

arg_descrs->AddDefaultKey(

"update-case"

,

"UPDATE_CASE"

,

277  "Produce .asn and .error files from given name for new or updated test case."

,

280

arg_descrs->AddFlag(

"update-all"

,

281  "Update all test cases to current reader code (dangerous)."

,

283

arg_descrs->AddFlag(

"keep-diffs"

,

284  "Keep output files that are different from the expected."

,

296  CDir

test_cases_dir( args[

"test-dir"

].AsDirectory() );

297

BOOST_REQUIRE_MESSAGE( test_cases_dir.

IsDir

(),

298  "Cannot find dir: "

<< test_cases_dir.

GetPath

() );

299  bool

update_all = args[

"update-all"

].AsBoolean();

305  string

update_case = args[

"update-case"

].AsString();

306  if

(!update_case.empty()) {

310  const

vector<string> kEmptyStringVec;

322  const string

& sName = name_to_info_it->first;

323  const STestInfo

& testInfo = name_to_info_it->second;

324

cout <<

"Verifying: "

<< sName << endl;

333  const string

& sName = name_to_info_it->first;

334  const STestInfo

& testInfo = name_to_info_it->second;

336

cout <<

"Running test: "

<< sName << endl;

338

BOOST_CHECK_NO_THROW(

sRunTest

(sName, testInfo, args[

"keep-diffs"

]));

list< CModData > TModList

static CNcbiApplication * Instance(void)

Singleton method.

CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...

TTestNameToInfoMap & m_TestNameToInfoMap

CTestNameToInfoMapLoader(TTestNameToInfoMap &testNameToInfoMap, const string &extInput, const string &extOutput, const string &extErrors)

void operator()(const CDirEntry &dirEntry)

static void Apply(const CTempString &title, TModList &mods, string &remainder)

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

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.

bool empty(void) const

Return true if the represented string is empty (i.e., the length is zero)

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 extErrors("errors")

void sUpdateAll(CDir &test_cases_dir)

map< TTestName, STestInfo > TTestNameToInfoMap

const string extOutput("mods")

const string extInput("defline")

void sUpdateCase(CDir &test_cases_dir, const string &test_name)

const string dirTestFiles("title_parser_test_cases")

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