diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h index 9288bd1e96a..ad95be47cd7 100644 --- a/c++/test/h5cpputil.h +++ b/c++/test/h5cpputil.h @@ -28,11 +28,6 @@ using namespace H5; using std::cerr; using std::endl; -#define MESSAGE(V, A) \ - do { \ - if (GetTestVerbosity() > (V)) \ - printf A; \ - } while (0) #define SUBTEST(TEST) \ do { \ printf(" Subtest: %-52s", TEST); \ diff --git a/test/testframe.c b/test/testframe.c index 05cb57967ea..b960781d153 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -537,6 +537,15 @@ TestShutdown(void) return SUCCEED; } +/* + * Retrieve the MPI rank for this process. + */ +H5_ATTR_PURE int +GetTestFrameworkProcessID(void) +{ + return TestFrameworkProcessID_g; +} + /* * Retrieve the verbosity level for the testing framework */ diff --git a/test/testframe.h b/test/testframe.h index 2b24f03c07d..f90e05fb717 100644 --- a/test/testframe.h +++ b/test/testframe.h @@ -91,16 +91,16 @@ * Verbose queries * Only None needs an exact match. The rest are at least as much. */ -#define VERBOSE_NONE (TestVerbosity_g == VERBO_NONE) -#define VERBOSE_DEF (TestVerbosity_g >= VERBO_DEF) -#define VERBOSE_LO (TestVerbosity_g >= VERBO_LO) -#define VERBOSE_MED (TestVerbosity_g >= VERBO_MED) -#define VERBOSE_HI (TestVerbosity_g >= VERBO_HI) +#define VERBOSE_NONE (GetTestVerbosity() == VERBO_NONE) +#define VERBOSE_DEF (GetTestVerbosity() >= VERBO_DEF) +#define VERBOSE_LO (GetTestVerbosity() >= VERBO_LO) +#define VERBOSE_MED (GetTestVerbosity() >= VERBO_MED) +#define VERBOSE_HI (GetTestVerbosity() >= VERBO_HI) /* Used to document process through a test */ #define MESSAGE(V, A) \ do { \ - if (TestFrameworkProcessID_g == 0 && TestVerbosity_g > (V)) \ + if (GetTestFrameworkProcessID() == 0 && GetTestVerbosity() > (V)) \ printf A; \ } while (0) @@ -112,9 +112,6 @@ /* Variables */ /*************/ -H5TEST_DLLVAR int TestFrameworkProcessID_g; -H5TEST_DLLVAR int TestVerbosity_g; - /**************/ /* Prototypes */ /**************/ @@ -422,6 +419,20 @@ H5TEST_DLL herr_t PerformTests(void); */ H5TEST_DLL void TestSummary(FILE *stream); +/** + * -------------------------------------------------------------------------- + * \ingroup H5TEST + * + * \brief Returns the MPI rank for this process + * + * \return The MPI rank of this process + * + * \details GetTestFrameworkProcessID() returns the MPI rank for this process. + * Always returns rank 0 in serial HDF5. + * + */ +H5TEST_DLL int GetTestFrameworkProcessID(void); + /** * -------------------------------------------------------------------------- * \ingroup H5TEST