Skip to content

Add hal::mock::stall_detector #42

@kammce

Description

@kammce

It should look like this:

hal::mock::stall_detector detector(10ms);

// Do the actions that may cause a stall to occur like polling a register or waiting a duration of time.
detector.operation_finished();

The stall detector should spawn a thread that waits the amount of time specified in the constructor. That thread should throw an exception if the operation_finished() has not been called in the amount of time specified. That thrown exception object is not accessible by the rest of the code ensuring that it terminates the test. It would also be good to take a std::source_location as well in order for the developer to know where the deadlock occurred in the code. Maybe even a stack trace as well from the termination site. The destructor should join the thread.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions