summaryrefslogtreecommitdiffstats
path: root/test/testhdf5.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>1998-07-03 00:57:00 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>1998-07-03 00:57:00 (GMT)
commitb81abe336d5ab6498fc6e382822a9f85be1af8e9 (patch)
tree65b9c658f2f0ceef1a520762a869110aada11313 /test/testhdf5.c
parentb8237b2977e2fc202da40e5ffe72f7827ba6a33d (diff)
downloadhdf5-b81abe336d5ab6498fc6e382822a9f85be1af8e9.zip
hdf5-b81abe336d5ab6498fc6e382822a9f85be1af8e9.tar.gz
hdf5-b81abe336d5ab6498fc6e382822a9f85be1af8e9.tar.bz2
[svn-r445] Added individually named cleanup_xxx routine to each test module file
to cleanup temporary files used by that particular module. Added a cleanup() routine to testhdf5 that calls all the other cleanup_xxx() routines to do cleanup. Cleanup action can be disabled either by -c (no cleanup) option or HDF5_NOCLEANUP environment variable.
Diffstat (limited to 'test/testhdf5.c')
-rw-r--r--test/testhdf5.c42
1 files changed, 33 insertions, 9 deletions
diff --git a/test/testhdf5.c b/test/testhdf5.c
index d4d9f89..374fd40 100644
--- a/test/testhdf5.c
+++ b/test/testhdf5.c
@@ -132,6 +132,37 @@ print_func(const char *format,...)
return (ret_value);
}
+
+/*-------------------------------------------------------------------------
+ * Function: cleanup
+ *
+ * Purpose: Cleanup temporary test files
+ *
+ * Return: none
+ *
+ * Programmer: Albert Cheng
+ * July 2, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static void
+cleanup(void)
+{
+ if (!getenv ("HDF5_NOCLEANUP")) {
+ MESSAGE(2, ("\nCleaning Up temp files...\n\n"));
+ /* call individual cleanup routines in each source module */
+ cleanup_metadata();
+ cleanup_file();
+ cleanup_heap();
+ cleanup_ohdr();
+ cleanup_stab();
+ cleanup_h5s();
+ cleanup_attr();
+ }
+}
+
int
main(int argc, char *argv[])
{
@@ -282,15 +313,8 @@ main(int argc, char *argv[])
} /* end for */
print_func("\n\n");
} /* end if */
- if (CleanUp) {
- MESSAGE(2, ("\nCleaning Up...\n\n"));
-#if !(defined DOS386 | defined WIN386)
- system("rm -f *.h5 *.tmp");
-#else /* OLD_WAY */
- remove("*.h5");
- remove("*.tmp");
-#endif /* OLD_WAY */
- } /* end if */
+ if (CleanUp)
+ cleanup();
exit(0);
return (0);
} /* end main() */