diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2004-01-23 06:29:57 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2004-01-23 06:29:57 (GMT) |
commit | 72ca2d086f1e80ee4c8ca5f4fb1acf508e89f4f0 (patch) | |
tree | c657befe94450c062fe0ecc981c0cbc119ab4c0b /test | |
parent | 06d17aff4d4c801653d2af6983fe2ca60c9e1fe9 (diff) | |
download | hdf5-72ca2d086f1e80ee4c8ca5f4fb1acf508e89f4f0.zip hdf5-72ca2d086f1e80ee4c8ca5f4fb1acf508e89f4f0.tar.gz hdf5-72ca2d086f1e80ee4c8ca5f4fb1acf508e89f4f0.tar.bz2 |
[svn-r8100] Purpose:
Added the function ParseTestVerbosity() to be shared by all programs.
Platforms tested:
Eirene.
Diffstat (limited to 'test')
-rw-r--r-- | test/testframe.c | 26 | ||||
-rw-r--r-- | test/testhdf5.h | 1 |
2 files changed, 19 insertions, 8 deletions
diff --git a/test/testframe.c b/test/testframe.c index e25d3ec..3b24b30 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -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 diff --git a/test/testhdf5.h b/test/testhdf5.h index ad532a9..5a560d9 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -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, ...); |