summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/h5test.c8
-rw-r--r--testpar/testphdf5.c8
2 files changed, 9 insertions, 7 deletions
diff --git a/test/h5test.c b/test/h5test.c
index e2caea9..aeeb58f 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -145,7 +145,13 @@ h5_cleanup(const char *base_name[], hid_t fapl)
int retval=0;
hid_t driver;
- if (!HDgetenv("HDF5_NOCLEANUP")) {
+ if (GetTestCleanup() &&
+#ifdef H5_HAVE_PARALLEL
+ !getenv_all(MPI_COMM_WORLD, 0, "HDF5_NOCLEANUP")
+#else
+ !HDgetenv("HDF5_NOCLEANUP")
+#endif
+ ){
for (i = 0; base_name[i]; i++) {
if (h5_fixname(base_name[i], fapl, filename, sizeof(filename)) == NULL)
continue;
diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c
index a07ac4a..f607d8f 100644
--- a/testpar/testphdf5.c
+++ b/testpar/testphdf5.c
@@ -516,12 +516,8 @@ int main(int argc, char **argv)
if (MAINPROCESS && GetTestSummary())
TestSummary();
- /* Clean up test files, if allowed */
- if (GetTestCleanup() && !getenv("HDF5_NOCLEANUP"))
- h5_cleanup(FILENAME, fapl);
- else
- /* h5_cleanup would have closed fapl. Now must do it explicitedly */
- H5Pclose(fapl);
+ /* Clean up test files */
+ h5_cleanup(FILENAME, fapl);
nerrors += GetTestNumErrs();