-
-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor refactoring of testframe.c testing framework #4930
Minor refactoring of testframe.c testing framework #4930
Conversation
A few minor follow-on changes from comments in #4891 |
PerformTests(void) | ||
{ | ||
for (unsigned Loop = 0; Loop < TestCount; Loop++) { | ||
int old_num_errs = TestNumErrs_g; | ||
|
||
if (TestArray[Loop].TestSkipFlag) { | ||
if (TestFrameworkProcessID_g == 0) | ||
MESSAGE(2, ("Skipping -- %s (%s) \n", TestArray[Loop].Description, TestArray[Loop].Name)); | ||
MESSAGE(2, ("Skipping -- %s (%s) \n", TestArray[Loop].Description, TestArray[Loop].Name)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MESSAGE macro includes the check for TestFrameworkProcessID_g
of 0
* Perform test cleanup | ||
*/ | ||
void | ||
TestCleanup(void) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TestCleanup()
was only used in a few places and is covered entirely by PerformTests()
now
@@ -180,15 +197,16 @@ extern "C" { | |||
* | |||
*/ | |||
H5TEST_DLL herr_t TestInit(const char *ProgName, void (*TestPrivateUsage)(FILE *stream), | |||
int (*TestPrivateParser)(int argc, char *argv[]), int TestProcessID); | |||
int (*TestPrivateParser)(int argc, char *argv[]), herr_t (*TestSetupFunc)(void), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a run-once setup and cleanup callback for the whole test program. The setup callback is called as part of TestInit() to initialize state as soon as possible and the cleanup callback is called by TestShutdown() to keep the state around as long as possible (for test post-processing or similar).
d3a27ff
to
cfb0ae9
Compare
Added setup and cleanup callback parameters to TestInit() to perform setup and cleanup tasks once for whole test program Removed TestCleanup() function since its functionality is covered by PerformTests() Added check of the HDF5_NOCLEANUP environment variable in GetTestCleanup()
Added setup and cleanup callback parameters to TestInit() to perform setup and cleanup tasks once for whole test program Removed TestCleanup() function since its functionality is covered by PerformTests() Added check of the HDF5_NOCLEANUP environment variable in GetTestCleanup()
Added setup and cleanup callback parameters to TestInit() to perform setup and cleanup tasks once for whole test program Removed TestCleanup() function since its functionality is covered by PerformTests() Added check of the HDF5_NOCLEANUP environment variable in GetTestCleanup()
Added setup and cleanup callback parameters to TestInit() to perform setup and cleanup tasks once for whole test program Removed TestCleanup() function since its functionality is covered by PerformTests() Added check of the HDF5_NOCLEANUP environment variable in GetTestCleanup()
Added setup and cleanup callback parameters to TestInit() to perform setup and cleanup tasks once for whole test program Removed TestCleanup() function since its functionality is covered by PerformTests() Added check of the HDF5_NOCLEANUP environment variable in GetTestCleanup()
Added setup and cleanup callback parameters to TestInit() to perform setup and cleanup tasks once for whole test program Removed TestCleanup() function since its functionality is covered by PerformTests() Added check of the HDF5_NOCLEANUP environment variable in GetTestCleanup()
Added setup and cleanup callback parameters to TestInit() to perform setup and cleanup tasks once for whole test program
Removed TestCleanup() function since its functionality is covered by PerformTests()
Added check of the HDF5_NOCLEANUP environment variable in GetTestCleanup()