[svn-r8100] Purpose:

Added the function ParseTestVerbosity() to be shared by all programs.

Platforms tested:
Eirene.
This commit is contained in:
Albert Cheng 2004-01-23 01:29:57 -05:00
parent 06d17aff4d
commit 72ca2d086f
2 changed files with 19 additions and 8 deletions

View File

@ -169,14 +169,7 @@ void TestParseCmdLine(int argc, char *argv[], int *Summary, int *CleanUp)
for (CLLoop = 1; CLLoop < argc; CLLoop++) {
if ((argc > CLLoop + 1) && ((HDstrcmp(argv[CLLoop], "-verbose") == 0) ||
(HDstrcmp(argv[CLLoop], "-v") == 0))) {
if (argv[CLLoop + 1][0] == 'l')
SetTestVerbosity(VERBO_LO);
else if (argv[CLLoop + 1][0] == 'm')
SetTestVerbosity(VERBO_MED);
else if (argv[CLLoop + 1][0] == 'h')
SetTestVerbosity(VERBO_HI);
else
SetTestVerbosity(atoi(argv[CLLoop + 1]));
ParseTestVerbosity(argv[CLLoop + 1]);
} /* end if */
if ((argc > CLLoop) && ((HDstrcmp(argv[CLLoop], "-summary") == 0) ||
(HDstrcmp(argv[CLLoop], "-s") == 0)))
@ -320,6 +313,23 @@ int SetTestVerbosity(int newval)
return(oldval);
}
/*
* Parse an argument string for verbosity level and set it.
*/
void ParseTestVerbosity(char *argv)
{
printf("argv = %s\n", argv);
if (*argv == 'l')
SetTestVerbosity(VERBO_LO);
else if (*argv == 'm')
SetTestVerbosity(VERBO_MED);
else if (*argv == 'h')
SetTestVerbosity(VERBO_HI);
else
SetTestVerbosity(atoi(argv));
printf("Verbosity = %d\n", GetTestVerbosity());
}
/*
* Retrieve the number of testing errors for the testing framework

View File

@ -188,6 +188,7 @@ H5TEST_DLL void TestCleanup(void);
H5TEST_DLL void TestInit(void);
H5TEST_DLL int GetTestVerbosity(void);
H5TEST_DLL int SetTestVerbosity(int newval);
H5TEST_DLL void ParseTestVerbosity(char *argv);
H5TEST_DLL int GetTestNumErrs(void);
H5TEST_DLL int TestErrPrintf(const char *format, ...);