summaryrefslogtreecommitdiffstats
path: root/test/testframe.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2004-08-08 02:26:44 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2004-08-08 02:26:44 (GMT)
commit7464e1fb1dea31ea9b3211a7b52585eea4a8b496 (patch)
treea23f69c76fcc5421a5ed1cbfca358fdbf7d0f927 /test/testframe.c
parente6266dd7a1977a8328ff456c2d7451c1af9a96dc (diff)
downloadhdf5-7464e1fb1dea31ea9b3211a7b52585eea4a8b496.zip
hdf5-7464e1fb1dea31ea9b3211a7b52585eea4a8b496.tar.gz
hdf5-7464e1fb1dea31ea9b3211a7b52585eea4a8b496.tar.bz2
[svn-r9050] Purpose:
Feature Description: Added a feature such that if the test name starts with '-', do not run it by default. Platforms tested: Eirene both serial and parallel. Misc. update:
Diffstat (limited to 'test/testframe.c')
-rw-r--r--test/testframe.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/test/testframe.c b/test/testframe.c
index b00bff0..a8b4d00 100644
--- a/test/testframe.c
+++ b/test/testframe.c
@@ -36,7 +36,7 @@ typedef struct TestStruct {
char Name[MAXTESTNAME];
void (*Call)(void);
void (*Cleanup)(void);
- void *Parameters;
+ const void *Parameters;
} TestStruct;
@@ -47,16 +47,17 @@ static int num_errs = 0; /* Total number of errors during testing */
static int Verbosity = VERBO_DEF; /* Default Verbosity is Low */
static TestStruct Test[MAXNUMOFTESTS];
static int Index = 0;
-static void *Test_parameters = NULL;
+static const void *Test_parameters = NULL;
/*
* Setup a test function and add it to the list of tests.
* It must have no parameters and returns void.
- * TheName--short test name
- * TheCall--the test routine
- * Cleanup--the cleanup routine for the test
- * TheDescr--Long description of the test
+ * TheName--short test name.
+ * If the name starts with '-', do not run it by default.
+ * TheCall--the test routine.
+ * Cleanup--the cleanup routine for the test.
+ * TheDescr--Long description of the test.
* Parameters--pointer to extra parameters. Use NULL if none used.
* Since only the pointer is copied, the contents should not change.
*/
@@ -82,11 +83,17 @@ AddTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), con
/* Set up test function */
HDstrcpy(Test[Index].Description, TheDescr);
- HDstrcpy(Test[Index].Name, TheName);
+ if (*TheName != '-'){
+ HDstrcpy(Test[Index].Name, TheName);
+ Test[Index].SkipFlag = 0;
+ }
+ else { /* skip test by default */
+ HDstrcpy(Test[Index].Name, TheName+1);
+ Test[Index].SkipFlag = 1;
+ }
Test[Index].Call = TheCall;
Test[Index].Cleanup = Cleanup;
Test[Index].NumErrors = -1;
- Test[Index].SkipFlag = 0;
Test[Index].Parameters = Parameters;
/* Increment test count */
@@ -343,7 +350,7 @@ int GetTestNumErrs(void)
/*
* Retrieve the current Test Parameters pointer.
*/
-void *GetTestParameters(void)
+const void *GetTestParameters(void)
{
return(Test_parameters);
}