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/test-tds100_8cpp_source.html below:

NCBI C++ ToolKit: src/dbapi/driver/ftds100/freetds/tds/unittests/test-tds100.cpp Source File

62

arg_desc->SetUsageContext(

GetArguments

().GetProgramBasename(),

63  "Wrapper for upstream FreeTDS tests"

);

65

arg_desc->AddDefaultKey

66

(

"-ms-ver"

,

"TDSVersion"

,

67  "TDS protocol version to use for MS SQL servers"

,

69

arg_desc->AddOptionalKey

70

(

"-syb-ver"

,

"TDSVersion"

,

71  "TDS protocol version to use for Sybase servers"

,

73

arg_desc->AddOptionalKey

74

(

"-set-env"

,

"Setting"

,

75  "Set a custom environment variable; format: NAME=value; " 80  "Skip in automated runs due to use of non-temporary objects."

);

82

arg_desc->AddPositional

95  if

(args[

"-no-auto"

]) {

97  env

.Get(

"NCBI_AUTOMATED_BUILD"

, &is_automated);

99  NcbiCout

<<

"NCBI_UNITTEST_SKIPPED\n"

;

105  if

(sybase_dir.

Exists

() ||

env

.Get(

"SYBASE"

).empty()) {

108  if

(args[

"-set-env"

]) {

117  string cmd

= args[

"test-command"

].AsString(),

118

cmdline =

env

.Get(

"CHECK_EXEC"

);

119  if

( !cmdline.empty() ) {

122

cmdline =

"sh "

+ cmdline;

131  _TRACE

(

"PATH: "

<<

env

.Get(

"PATH"

));

132  _TRACE

(

"Command: "

<< cmdline);

136  string

prefix =

cmd

.substr(0,

cmd

.find(

'_'

) + 1),

137

base =

cmd

.substr(prefix.size());

138  if

(

CFile

(base +

".sql"

).Exists() ||

CFile

(base +

".in"

).Exists()) {

139

vector<string> dirs(1,

"."

), masks, found;

140

masks.push_back(base +

".??*"

);

141

masks.push_back(base +

"_*.??*"

);

143  ITERATE

(vector<string>, it, found) {

145  f

.Copy(prefix +

f

.GetName(),

151  if

(

CFile

(

"odbc.ini"

).Exists()) {

152  env

.Set(

"ODBCINI"

,

"odbc.ini"

);

153  env

.Set(

"SYSODBCINI"

,

"odbc.ini"

);

157  bool

succeeded_anywhere =

false

;

160  for

(

const char

*

const

* s =

kServers

; *s !=

NULL

; ++s) {

161  if

(strstr(*s,

"MS"

) !=

NULL

) {

162  env

.Set(

"TDSVER"

, args[

"-ms-ver"

].AsString());

163

}

else if

(args[

"-syb-ver"

]) {

164  env

.Set(

"TDSVER"

, args[

"-syb-ver"

].AsString());

166  env

.Unset(

"TDSVER"

);

169  string

tdspwdfile =

string

(

"login-info-"

) + *s +

".txt"

;

172

<<

"\nUID=DBAPI_test\nPWD=allowed\nDB=DBAPI_Sample\n"

;

173  env

.Set(

"TDSPWDFILE"

, tdspwdfile);

175  NcbiCout

<< *s <<

"\n--------------------"

<< endl;

177  if

(this_status == 0) {

178  NcbiCout

<<

"... SUCCEEDED on "

<< *s <<

'\n'

;

179

succeeded_anywhere =

true

;

180

}

else if

(this_status == 77) {

181  NcbiCout

<<

"... SKIPPED on "

<< *s <<

'\n'

;

183

status = this_status;

184  NcbiCout

<<

"... FAILED on "

<< *s <<

", with status "

<< status

186

failures <<

' '

<< *s <<

" ("

<< status <<

')'

;

194

}

else if

( !succeeded_anywhere ) {

195  NcbiCout

<<

"NCBI_UNITTEST_SKIPPED\n"

;

204 int main

(

int

argc,

char

** argv)

CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:

void Init(void)

Initialize the application.

int Run(void)

Run the application.

Include a standard set of the NCBI C++ Toolkit most basic headers.

CNcbiEnvironment & SetEnvironment(void)

Get a non-const copy of the application's cached environment.

virtual const CArgs & GetArgs(void) const

Get parsed command line arguments.

int AppMain(int argc, const char *const *argv, const char *const *envp=0, EAppDiagStream diag=eDS_Default, const char *conf=NcbiEmptyCStr, const string &name=NcbiEmptyString)

Main function (entry point) for the NCBI application.

virtual void SetupArgDescriptions(CArgDescriptions *arg_desc)

Setup the command line argument descriptions.

#define ITERATE(Type, Var, Cont)

ITERATE macro to sequence through container elements.

const CNcbiArguments & GetArguments(void) const

Get the application's cached unprocessed command-line arguments.

vector< string > TStringArray

Some values types can contain several value lists.

size_t GetNExtra(void) const

Get the number of unnamed positional (a.k.a. extra) args.

@ fAllowMultiple

Repeated key arguments are legal (use with AddKey)

@ eString

An arbitrary string.

static TExitCode System(const char *cmdline)

Execute the specified command.

static string QuoteArg(const string &arg)

Quote argument.

void FindFiles(TPathIterator path_begin, TPathIterator path_end, const vector< string > &masks, TFindFunc &find_func, TFindFiles flags=fFF_Default)

Generic algorithm for file search.

virtual bool Exists(void) const

Check if directory "dirname" exists.

const string & GetPath(void) const

Get entry path.

@ fCF_Overwrite

The following flags define what to do when the destination entry already exists:

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

IO_PREFIX::ofstream CNcbiOfstream

Portable alias for ofstream.

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.

static bool SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)

Split a string into two pieces using the specified delimiters.

const GenericPointer< typename T::ValueType > T2 value

Defines the CNcbiApplication and CAppException classes for creating NCBI applications.

Defines command line argument related classes.

Defines access to miscellaneous global configuration settings.

const char * NCBI_GetDefaultSybasePath(void)

Get default Sybase client installation path.

Defines unified interface to application:

Defines a portable execute class.

Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...

int main(int argc, char **argv)

static const char * kServers[]


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