Skip to content
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

Move TestAlarmOn()/TestAlarmOff() back into PerformTests() #5307

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions test/testframe.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,6 @@ TestInit(const char *ProgName, void (*TestPrivateUsage)(FILE *stream),
/* Initialize value for TestExpress functionality */
h5_get_testexpress();

/* Enable alarm timer for test program once TestExpress setting
* has been determined
*/
if (TestAlarmOn() < 0)
MESSAGE(5, ("Couldn't enable test alarm timer\n"));

/* Record the program name and private routines if provided. */
TestProgName = ProgName;
if (NULL != TestPrivateUsage)
Expand Down Expand Up @@ -456,6 +450,10 @@ TestParseCmdLine(int argc, char *argv[])
herr_t
PerformTests(void)
{
/* Enable alarm timer for tests */
if (TestAlarmOn() < 0)
Copy link
Collaborator Author

@jhendersonHDF jhendersonHDF Feb 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I'd like for this timer to cover essentially the whole test program, the timing of when testframe tests process command-line arguments means that this call has to come late in test execution to react to the -testexpress command-line option. The timer is still for all of the tests as intended in #5292, but not for the init/shutdown parts of the program. To cover that as well, TestParseCmdLine() would need to be called as part of TestInit(), which would be a good idea but would require re-writing how that function deals with skipping tests, so this is the easier solution for now.

MESSAGE(5, ("Couldn't enable test alarm timer\n"));

for (unsigned Loop = 0; Loop < TestCount; Loop++) {
int old_num_errs = TestNumErrs_g;

Expand All @@ -481,6 +479,8 @@ PerformTests(void)
MESSAGE(5, ("There were %d errors detected.\n\n", TestArray[Loop].TestNumErrors));
}

TestAlarmOff();

MESSAGE(2, ("\n\n"));
if (TestNumErrs_g)
MESSAGE(VERBO_NONE, ("!!! %d Error(s) were detected !!!\n\n", TestNumErrs_g));
Expand Down Expand Up @@ -573,8 +573,6 @@ TestShutdown(void)

free(TestArray);

TestAlarmOff();

return SUCCEED;
}

Expand Down
Loading