mirror of git://sourceware.org/git/glibc.git
support: Add support_record_failure_barrier
This can be used to stop execution after a TEST_COMPARE_BLOB failure, for example.
This commit is contained in:
parent
55618e1396
commit
d0b8aa6de4
|
|
@ -207,6 +207,9 @@ void support_record_failure_reset (void);
|
||||||
failures or not. */
|
failures or not. */
|
||||||
int support_record_failure_is_failed (void);
|
int support_record_failure_is_failed (void);
|
||||||
|
|
||||||
|
/* Terminate the process if any failures have been encountered so far. */
|
||||||
|
void support_record_failure_barrier (void);
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
#endif /* SUPPORT_CHECK_H */
|
#endif /* SUPPORT_CHECK_H */
|
||||||
|
|
|
||||||
|
|
@ -112,3 +112,13 @@ support_record_failure_is_failed (void)
|
||||||
synchronization for reliable test error reporting anyway. */
|
synchronization for reliable test error reporting anyway. */
|
||||||
return __atomic_load_n (&state->failed, __ATOMIC_RELAXED);
|
return __atomic_load_n (&state->failed, __ATOMIC_RELAXED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
support_record_failure_barrier (void)
|
||||||
|
{
|
||||||
|
if (__atomic_load_n (&state->failed, __ATOMIC_RELAXED))
|
||||||
|
{
|
||||||
|
puts ("error: exiting due to previous errors");
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue