summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.in17
-rw-r--r--test/dsets.c22
-rw-r--r--test/iopipe.c23
3 files changed, 49 insertions, 13 deletions
diff --git a/test/Makefile.in b/test/Makefile.in
index 3bf75a4..f4d9009 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -11,13 +11,14 @@ CPPFLAGS=-I. -I../src @CPPFLAGS@
# These are our main targets. They should be listed in the order to be
# executed, generally most specific tests to least specific tests.
-PROGS=testhdf5 hyperslab istore dtypes dsets cmpd_dset extend external \
+PROGS=testhdf5 hyperslab istore dtypes dsets cmpd_dset extend external \
iopipe
-TESTS=$(PROGS)
+TESTS=testhdf5 hyperslab istore dtypes dsets cmpd_dset extend external
+TIMINGS=iopipe
# Temporary files
MOSTLYCLEAN=cmpd_dset.h5 dataset.h5 extend.h5 istore.h5 tfile1.h5 tfile2.h5 \
- tfile3.h5 th5s1.h5 theap.h5 tohdr.h5 tstab1.h5 tstab2.h5 \
+ tfile3.h5 th5s1.h5 theap.h5 tohdr.h5 tstab1.h5 tstab2.h5 \
extern_1.h5 extern_2.h5 extern_3.h5 extern_1.raw extern_1b.raw \
extern_2.raw extern_2b.raw extern_3.raw extern_3b.raw \
extern_4.raw extern_4b.raw iopipe.raw iopipe.h5
@@ -64,6 +65,16 @@ IOPIPE_OBJ=$(IOPIPE_SRC:.c=.o)
# Private header files (not to be installed)...
PRIVATE_HDR=testhdf5.h
+# Additional targets
+.PHONY: timings _timings
+timings _timings: $(TIMINGS)
+ @for timing in $(TIMINGS) dummy; do \
+ if test $$timing != dummy; then \
+ echo "Running $$timing $(TEST_FLAGS)"; \
+ $(RUNTEST) ./$$timing $(TEST_FLAGS) || exit 1; \
+ fi; \
+ done;
+
# How to build the programs...
testhdf5: $(TESTHDF5_OBJ) ../src/libhdf5.a
$(CC) $(CFLAGS) -o $@ $(TESTHDF5_OBJ) ../src/libhdf5.a $(LIBS)
diff --git a/test/dsets.c b/test/dsets.c
index c92824c..eaca4a8 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -184,11 +184,12 @@ test_create(hid_t file)
static herr_t
test_simple_io(hid_t file)
{
- hid_t dataset, space;
- herr_t status;
- int points[100][200], check[100][200];
- int i, j, n;
- size_t dims[2];
+ hid_t dataset, space, xfer;
+ herr_t status;
+ int points[100][200], check[100][200];
+ int i, j, n;
+ size_t dims[2];
+ void *tconv_buf = NULL;
printf("%-70s", "Testing simple I/O");
@@ -205,6 +206,13 @@ test_simple_io(hid_t file)
space = H5Screate_simple(2, dims, NULL);
assert(space>=0);
+ /* Create a small conversion buffer to test strip mining */
+ tconv_buf = malloc (1000);
+ xfer = H5Pcreate (H5P_DATASET_XFER);
+ assert (xfer>=0);
+ status = H5Pset_buffer (xfer, 1000, tconv_buf, NULL);
+ assert (status>=0);
+
/* Create the dataset */
dataset = H5Dcreate(file, DSET_SIMPLE_IO_NAME, H5T_NATIVE_INT, space,
H5P_DEFAULT);
@@ -212,12 +220,12 @@ test_simple_io(hid_t file)
/* Write the data to the dataset */
status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, points);
+ xfer, points);
if (status<0) goto error;
/* Read the dataset back */
status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, check);
+ xfer, check);
if (status<0) goto error;
/* Check that the values read are the same as the values written */
diff --git a/test/iopipe.c b/test/iopipe.c
index 813150e..f185aad 100644
--- a/test/iopipe.c
+++ b/test/iopipe.c
@@ -19,12 +19,22 @@
#define RAW_FILE_NAME "iopipe.raw"
#define HDF5_FILE_NAME "iopipe.h5"
+#define HEADING "%-16s"
+#define PROGRESS '='
+
+#if 1
+/* Normal testing */
#define REQUEST_SIZE_X 4579
#define REQUEST_SIZE_Y 4579
#define NREAD_REQUESTS 45
#define NWRITE_REQUESTS 45
-#define HEADING "%-16s"
-#define PROGRESS '='
+#else
+/* Speedy testing */
+#define REQUEST_SIZE_X 1000
+#define REQUEST_SIZE_Y 1000
+#define NREAD_REQUESTS 45
+#define NWRITE_REQUESTS 45
+#endif
/*-------------------------------------------------------------------------
@@ -83,10 +93,17 @@ print_stats (const char *prefix,
static void
synchronize (void)
{
+#ifdef HAVE_SYSTEM
system ("sync");
system ("df >/dev/null");
#if 0
- system ("/sbin/swapout 130");
+ /*
+ * This works well on Linux to get rid of all cached disk buffers. The
+ * number should be approximately the amount of RAM in MB. Do not
+ * include swap space in that amount or the command will fail.
+ */
+ system ("/sbin/swapout 128");
+#endif
#endif
}