h5u_test.c 1.93 KB
Newer Older
1 2 3 4 5 6 7 8 9
#include <stdlib.h>
#include <H5hut.h>

#include "testframe.h"
#include "params.h"

/* from write.c */
void h5u_test_write1(void);
void h5u_test_write2(void);
10
#if H5_VERSION_LE(1,8,12)
11
void h5u_test_write3(void);
12
#endif
13 14 15 16 17 18 19 20 21 22
void h5u_test_write4(void);

/* from read.c */
void h5u_test_read1(void);
void h5u_test_read2(void);
void h5u_test_read3(void);
void h5u_test_read4(void);

int main(int argc, char **argv)
{
23
#ifdef H5_HAVE_PARALLEL
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
	MPI_Init(&argc, &argv);
	int procs;
	MPI_Comm_size(MPI_COMM_WORLD, &procs);
	if (procs > MAX_MPI_TASKS) {
		fprintf(stderr,
		        "ERROR: please use <= %d MPI tasks for the test.\n",
		        MAX_MPI_TASKS);
		exit(EXIT_FAILURE);
	}
#endif

	/* Initialize testing framework */
	TestInit(argv[0], NULL, NULL);

	/* Tests are generally arranged from least to most complexity... */
	AddTest("write1", h5u_test_write1, NULL, "Write 32-bit data", NULL);
	AddTest("read1", h5u_test_read1, NULL, "Read 32-bit data", NULL);
	AddTest("write2", h5u_test_write2, NULL, "Write 32-bit strided data", NULL);
	AddTest("read2", h5u_test_read2, NULL, "Read 32-bit strided data", NULL);
43
#if H5_VERSION_LE(1,8,12)
44 45
	AddTest("write3", h5u_test_write3, NULL, "Write 64-bit strided data", NULL);
	AddTest("read3", h5u_test_read3, NULL, "Read 64-bit strided data", NULL);
46
#endif
47 48 49 50 51 52 53 54 55
	AddTest("write4", h5u_test_write4, NULL, "Write 64-bit data", NULL);
	AddTest("read4", h5u_test_read4, NULL, "Read 64-bit data", NULL);

	/* Display testing information */
	TestInfo(argv[0]);

	/* Parse command line arguments */
	TestParseCmdLine(argc, argv);

gsell's avatar
bugfix  
gsell committed
56
	H5SetVerbosityLevel(GetTestVerbosity());
57 58 59 60 61 62 63 64 65 66 67 68

	/* Perform requested testing */
	PerformTests();

	/* Display test summary, if requested */
	if (GetTestSummary())
		TestSummary();

	/* Clean up test files, if allowed */
	//if (GetTestCleanup() && !getenv("HDF5_NOCLEANUP"))
	//    TestCleanup();

69
#ifdef H5_HAVE_PARALLEL
70 71 72 73 74 75 76
	TestPrintf ("reached end\n");
	fflush(stdout);
	MPI_Finalize();
#endif
	return GetTestNumErrs();
}