summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/h5test.c18
-rw-r--r--test/h5test.h1
-rw-r--r--test/testframe.c15
3 files changed, 26 insertions, 8 deletions
diff --git a/test/h5test.c b/test/h5test.c
index aeeb58f..40d9210 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -145,13 +145,7 @@ h5_cleanup(const char *base_name[], hid_t fapl)
int retval=0;
hid_t driver;
- if (GetTestCleanup() &&
-#ifdef H5_HAVE_PARALLEL
- !getenv_all(MPI_COMM_WORLD, 0, "HDF5_NOCLEANUP")
-#else
- !HDgetenv("HDF5_NOCLEANUP")
-#endif
- ){
+ if (GetTestCleanup()){
for (i = 0; base_name[i]; i++) {
if (h5_fixname(base_name[i], fapl, filename, sizeof(filename)) == NULL)
continue;
@@ -327,6 +321,11 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
prefix = HDF5_PARAPREFIX;
#endif /* HDF5_PARAPREFIX */
}
+
+ /* check NOCLEANUP environment setting. */
+ if (getenv_all(MPI_COMM_WORLD, 0, "HDF5_NOCLEANUP")){
+ SetTestNoCleanup();
+ }
#endif /* H5_HAVE_PARALLEL */
} else {
/*
@@ -339,6 +338,11 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
if (!prefix)
prefix = HDF5_PREFIX;
#endif /* HDF5_PREFIX */
+
+ /* check NOCLEANUP environment setting. */
+ if (HDgetenv("HDF5_NOCLEANUP")){
+ SetTestNoCleanup();
+ }
}
/* Prepend the prefix value to the base name */
diff --git a/test/h5test.h b/test/h5test.h
index d9800a0..fc5c772 100644
--- a/test/h5test.h
+++ b/test/h5test.h
@@ -146,6 +146,7 @@ H5TEST_DLL int GetTestVerbosity(void);
H5TEST_DLL int SetTestVerbosity(int newval);
H5TEST_DLL int GetTestSummary(void);
H5TEST_DLL int GetTestCleanup(void);
+H5TEST_DLL int SetTestNoCleanup(void);
H5TEST_DLL void ParseTestVerbosity(char *argv);
H5TEST_DLL int GetTestNumErrs(void);
H5TEST_DLL void IncTestNumErrs(void);
diff --git a/test/testframe.c b/test/testframe.c
index 4478cb4..f4c19c2 100644
--- a/test/testframe.c
+++ b/test/testframe.c
@@ -266,7 +266,7 @@ void TestParseCmdLine(int argc, char *argv[])
exit(0);
}
else if ((HDstrcmp(*argv, "-cleanoff") == 0) || (HDstrcmp(*argv, "-c") == 0))
- CleanUp = 0;
+ SetTestNoCleanup();
else {
/* non-standard option. Break out. */
break;
@@ -394,6 +394,19 @@ int GetTestCleanup(void)
}
/*
+ * Set cleanup to no.
+ * Return previous cleanup value.
+ */
+int SetTestNoCleanup(void)
+{
+ int oldval;
+
+ oldval = CleanUp;
+ CleanUp = 0;
+ return(oldval);
+}
+
+/*
* Parse an argument string for verbosity level and set it.
*/
void ParseTestVerbosity(char *argv)