LLVM OpenMP 22.0.0git
|
Class that can assert in a sequenced fashion, i.e., events have to occur in the order they were registered. More...
Public Member Functions | |
OmptSequencedAsserter () | |
void | insert (omptest::OmptAssertEvent &&AE) override |
Add the event to the in-sequence set of events that the asserter should check for. | |
virtual void | notifyImpl (omptest::OmptAssertEvent &&AE) override |
Implements the asserter's actual logic. | |
size_t | getRemainingEventCount () override |
Get the number of currently remaining events, with: ObserveState::Always. | |
omptest::AssertState | checkState () override |
Determine and return the asserter's state. | |
Public Member Functions inherited from omptest::OmptAsserter | |
OmptAsserter () | |
virtual | ~OmptAsserter ()=default |
void | notify (omptest::OmptAssertEvent &&AE) override |
Called from the CallbackHandler with a corresponding AssertEvent to which callback was handled. | |
int | getNotificationCount () |
Get the total number of received, effective notifications. | |
int | getSuccessfulAssertionCount () |
Get the total number of successful assertion checks. | |
AssertMode | getOperationMode () |
Get the asserter's current operationmode: e.g.: Strict or Relaxed. | |
omptest::AssertState | getState () |
Return the asserter's current state. | |
std::shared_ptr< OmptEventGroupInterface > | getEventGroups () const |
Accessor for the event group interface. | |
std::shared_ptr< logging::Logger > | getLog () const |
Accessor for the event group interface. | |
bool | verifyEventGroups (const omptest::OmptAssertEvent &ExpectedEvent, const omptest::OmptAssertEvent &ObservedEvent) |
Check the observed events' group association. | |
void | setOperationMode (AssertMode Mode) |
Set the asserter's mode of operation w.r.t. assertion. | |
Public Member Functions inherited from omptest::OmptListener | |
virtual | ~OmptListener ()=default |
void | setActive (bool Enabled) |
Control whether this asserter should be considered 'active'. | |
bool | isActive () |
Check if this asserter is considered 'active'. | |
bool | isSuppressedEventType (omptest::internal::EventTy EvTy) |
Check if the given event type is from the set of suppressed event types. | |
void | permitEvent (omptest::internal::EventTy EvTy) |
Remove the given event type to the set of suppressed events. | |
void | suppressEvent (omptest::internal::EventTy EvTy) |
Add the given event type to the set of suppressed events. |
Public Attributes | |
bool | AssertionSuspended {false} |
size_t | NextEvent {0} |
Index of the next, expected event. | |
std::vector< omptest::OmptAssertEvent > | Events {} |
Protected Member Functions | |
bool | consumeSyncPoint (const omptest::OmptAssertEvent &AE) |
Notification helper function, implementing SyncPoint logic. | |
bool | checkExcessNotify (const omptest::OmptAssertEvent &AE) |
Notification helper function, implementing excess event notification logic. | |
bool | consumeSuspend () |
Notification helper function, implementing Suspend logic. | |
bool | consumeRegularEvent (const omptest::OmptAssertEvent &AE) |
Notification helper function, implementing regular event notification logic. |
Additional Inherited Members | |
Protected Attributes inherited from omptest::OmptAsserter | |
omptest::AssertState | State {omptest::AssertState::Pass} |
The asserter's current state. | |
std::mutex | AssertMutex |
Mutex to avoid data races w.r.t. event notifications and/or insertions. | |
std::shared_ptr< OmptEventGroupInterface > | EventGroups {nullptr} |
Pointer to the OmptEventGroupInterface. | |
std::shared_ptr< logging::Logger > | Log {nullptr} |
Pointer to the logging instance. | |
AssertMode | OperationMode {AssertMode::Strict} |
Operation mode during assertion / notification. | |
int | NumNotifications {0} |
The total number of effective notifications. | |
int | NumSuccessfulAsserts {0} |
The number of successful assertion checks. |
Class that can assert in a sequenced fashion, i.e., events have to occur in the order they were registered.
Definition at line 174 of file OmptAsserter.h.
|
inline |
Definition at line 176 of file OmptAsserter.h.
References NextEvent, and omptest::OmptAsserter::OmptAsserter().
|
protected |
Notification helper function, implementing excess event notification logic.
Returns true when no more events were expected, indicating early exit of notification.
Definition at line 261 of file OmptAsserter.cpp.
References AssertionSuspended, Events, omptest::Fail, omptest::OmptAsserter::Log, NextEvent, omptest::OmptAsserter::NumNotifications, omptest::OmptAsserter::NumSuccessfulAsserts, and omptest::OmptAsserter::State.
Referenced by notifyImpl().
|
overridevirtual |
Determine and return the asserter's state.
Reimplemented from omptest::OmptAsserter.
Definition at line 333 of file OmptAsserter.cpp.
References omptest::Always, Events, omptest::Fail, getRemainingEventCount(), i, omptest::OmptAsserter::Log, NextEvent, and omptest::OmptAsserter::State.
|
protected |
Notification helper function, implementing regular event notification logic.
Returns true when a matching event was encountered, indicating early exit of notification.
Definition at line 297 of file OmptAsserter.cpp.
References omptest::Always, AssertionSuspended, Events, omptest::Fail, omptest::OmptAsserter::Log, omptest::Never, NextEvent, omptest::OmptAsserter::NumSuccessfulAsserts, omptest::OmptAsserter::State, and omptest::OmptAsserter::verifyEventGroups().
Referenced by notifyImpl().
|
protected |
Notification helper function, implementing Suspend logic.
Returns true in case of consumed event, indicating early exit of notification.
Definition at line 282 of file OmptAsserter.cpp.
References AssertionSuspended, Events, and NextEvent.
Referenced by notifyImpl().
|
protected |
Notification helper function, implementing SyncPoint logic.
Returns true in case of consumed event, indicating early exit of notification.
Definition at line 239 of file OmptAsserter.cpp.
References Events, omptest::Fail, omptest::OmptAssertEvent::getEventType(), getRemainingEventCount(), omptest::OmptAsserter::Log, omptest::OmptAsserter::NumSuccessfulAsserts, and omptest::OmptAsserter::State.
Referenced by notifyImpl().
|
overridevirtual |
Get the number of currently remaining events, with: ObserveState::Always.
Implements omptest::OmptAsserter.
Definition at line 324 of file OmptAsserter.cpp.
References Events, and omptest::OmptAsserter::NumSuccessfulAsserts.
Referenced by checkState(), and consumeSyncPoint().
|
overridevirtual |
Add the event to the in-sequence set of events that the asserter should check for.
Reimplemented from omptest::OmptAsserter.
Definition at line 205 of file OmptAsserter.cpp.
References omptest::OmptAsserter::AssertMutex, and Events.
|
overridevirtual |
Implements the asserter's actual logic.
Implements omptest::OmptAsserter.
Definition at line 210 of file OmptAsserter.cpp.
References AssertionSuspended, omptest::OmptAsserter::AssertMutex, checkExcessNotify(), consumeRegularEvent(), consumeSuspend(), consumeSyncPoint(), Events, omptest::Fail, omptest::OmptListener::isActive(), omptest::OmptListener::isSuppressedEventType(), omptest::OmptAsserter::Log, NextEvent, omptest::OmptAsserter::NumNotifications, omptest::OmptAsserter::OperationMode, omptest::Relaxed, and omptest::OmptAsserter::State.
bool omptest::OmptSequencedAsserter::AssertionSuspended {false} |
Definition at line 189 of file OmptAsserter.h.
Referenced by checkExcessNotify(), consumeRegularEvent(), consumeSuspend(), and notifyImpl().
std::vector<omptest::OmptAssertEvent> omptest::OmptSequencedAsserter::Events {} |
Definition at line 213 of file OmptAsserter.h.
Referenced by checkExcessNotify(), checkState(), consumeRegularEvent(), consumeSuspend(), consumeSyncPoint(), getRemainingEventCount(), insert(), and notifyImpl().
size_t omptest::OmptSequencedAsserter::NextEvent {0} |
Index of the next, expected event.
Definition at line 212 of file OmptAsserter.h.
Referenced by checkExcessNotify(), checkState(), consumeRegularEvent(), consumeSuspend(), notifyImpl(), and OmptSequencedAsserter().