summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2004-01-23 06:29:55 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2004-01-23 06:29:55 (GMT)
commitbe0a322db3a240c507c495659da764434832d9be (patch)
tree183bd99241341214bcdc190f48d6b47bcaf8c473 /test
parent36ad158dd24cea007575246ee86a24e8994dcf41 (diff)
downloadhdf5-be0a322db3a240c507c495659da764434832d9be.zip
hdf5-be0a322db3a240c507c495659da764434832d9be.tar.gz
hdf5-be0a322db3a240c507c495659da764434832d9be.tar.bz2
[svn-r8099] Purpose:
Added the function ParseTestVerbosity() to be shared by all programs. Platforms tested: Eirene.
Diffstat (limited to 'test')
-rw-r--r--test/testframe.c26
-rw-r--r--test/testhdf5.h1
2 files changed, 19 insertions, 8 deletions
diff --git a/test/testframe.c b/test/testframe.c
index 569695c..af47dab 100644
--- a/test/testframe.c
+++ b/test/testframe.c
@@ -164,14 +164,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)))
@@ -315,6 +308,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 15006b3..dc8b390 100644
--- a/test/testhdf5.h
+++ b/test/testhdf5.h
@@ -119,6 +119,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, ...);