summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2004-01-22 23:05:47 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2004-01-22 23:05:47 (GMT)
commitc84e2ff653a5889ae07f913f4b770f13ed84c1bb (patch)
treeda7a1489f803cdebc705c93e3866991df64a0f93 /test
parent493394bc17969cab5ff9bbb814fde83037b6e5ff (diff)
downloadhdf5-c84e2ff653a5889ae07f913f4b770f13ed84c1bb.zip
hdf5-c84e2ff653a5889ae07f913f4b770f13ed84c1bb.tar.gz
hdf5-c84e2ff653a5889ae07f913f4b770f13ed84c1bb.tar.bz2
[svn-r8093] Purpose:
New feature. Description: Added function SetTestVerbosity() so that other applications can set the verbosity explicitedly without the whole testframe taking over. Added Verbose queries shorthands to make code more readable and easier to change the levels of low, medium and high. Platforms tested: Eirene (both serial and parallel). Misc. update:
Diffstat (limited to 'test')
-rw-r--r--test/h5test.h10
-rw-r--r--test/testframe.c21
-rw-r--r--test/testhdf5.h1
3 files changed, 28 insertions, 4 deletions
diff --git a/test/h5test.h b/test/h5test.h
index bdbe869..e78559b 100644
--- a/test/h5test.h
+++ b/test/h5test.h
@@ -58,6 +58,16 @@
#define VERBO_HI 9 /* High */
/*
+ * Verbose queries
+ * Only None needs an exact match. The rest are at least as much.
+ */
+#define VERBOSE_NONE (GetTestVerbosity()==VERBO_NONE)
+#define VERBOSE_DEF (GetTestVerbosity()>=VERBO_DEF)
+#define VERBOSE_LO (GetTestVerbosity()>=VERBO_LO)
+#define VERBOSE_MED (GetTestVerbosity()>=VERBO_MED)
+#define VERBOSE_HI (GetTestVerbosity()>=VERBO_HI)
+
+/*
* This contains the filename prefix specificied as command line option for
* the parallel test files.
*/
diff --git a/test/testframe.c b/test/testframe.c
index f138889..31bb4a1 100644
--- a/test/testframe.c
+++ b/test/testframe.c
@@ -165,13 +165,13 @@ void TestParseCmdLine(int argc, char *argv[], int *Summary, int *CleanUp)
if ((argc > CLLoop + 1) && ((HDstrcmp(argv[CLLoop], "-verbose") == 0) ||
(HDstrcmp(argv[CLLoop], "-v") == 0))) {
if (argv[CLLoop + 1][0] == 'l')
- Verbosity = VERBO_LO;
+ SetTestVerbosity(VERBO_LO);
else if (argv[CLLoop + 1][0] == 'm')
- Verbosity = VERBO_MED;
+ SetTestVerbosity(VERBO_MED);
else if (argv[CLLoop + 1][0] == 'h')
- Verbosity = VERBO_HI;
+ SetTestVerbosity(VERBO_HI);
else
- Verbosity = atoi(argv[CLLoop + 1]);
+ SetTestVerbosity(atoi(argv[CLLoop + 1]));
} /* end if */
if ((argc > CLLoop) && ((HDstrcmp(argv[CLLoop], "-summary") == 0) ||
(HDstrcmp(argv[CLLoop], "-s") == 0)))
@@ -302,6 +302,19 @@ int GetTestVerbosity(void)
return(Verbosity);
}
+/*
+ * Set the verbosity level for the testing framework.
+ * Return previous verbosity level.
+ */
+int SetTestVerbosity(int new)
+{
+ int old;
+
+ old = Verbosity;
+ Verbosity = new;
+ return(old);
+}
+
/*
* Retrieve the number of testing errors for the testing framework
diff --git a/test/testhdf5.h b/test/testhdf5.h
index 755c96e..74465b1 100644
--- a/test/testhdf5.h
+++ b/test/testhdf5.h
@@ -118,6 +118,7 @@ H5TEST_DLL void TestSummary(void);
H5TEST_DLL void TestCleanup(void);
H5TEST_DLL void TestInit(void);
H5TEST_DLL int GetTestVerbosity(void);
+H5TEST_DLL int SetTestVerbosity(int new);
H5TEST_DLL int GetTestNumErrs(void);
H5TEST_DLL int TestErrPrintf(const char *format, ...);