test.pl: Use END blocks to cancel watchdog timers #23678
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In doing follow up work to a7f3f23
"Turn off watchdog when done in tests", I realized that my solution was
suboptimal, and that the code already existed in test.pl to do things
better.
What that code does is to create an END block to cancel the watchdog
upon program exit. I think that is a better solution than to force
the addition of explicit calls to watchdog(0). This commit creates a
standard way to specify the code that does the cancellation, and to use
it, not only when the END block does, but also when the timer is
explicitly cancelled.
This means the calls to watchdog(0) that occur at the end of the file
that were added in a7f3f23 aren't
necessary. The END block takes care of it. The reason to keep them is
if we want to add a porting test that every watchdog is cleared.