dejafu-2.4.0.5: A library for unit-testing concurrent programs.
Copyright(c) 2017--2018 Michael Walker
LicenseMIT
MaintainerMichael Walker <mike@barrucadu.co.uk>
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.DejaFu.Utils

Description

Utility functions for users of dejafu.

Synopsis

Traces

toTIdTrace :: Trace -> [(ThreadId, ThreadAction)] Source #

Turn a Trace into an abbreviated form.

Since: 1.3.2.0

showTrace :: Trace -> String Source #

Pretty-print a trace, including a key of the thread IDs (not including thread 0). Each line of the key is indented by two spaces.

Since: 0.5.0.0

threadNames :: Trace -> [(Int, String)] Source #

Get all named threads in the trace.

Since: 0.7.3.0

simplestsBy :: (x -> x -> Bool) -> [(x, Trace)] -> [(x, Trace)] Source #

Find the "simplest" trace leading to each result.

Conditions

showCondition :: Condition -> String Source #

Pretty-print a condition

Since: 1.12.0.0

Scheduling

tidOf :: ThreadId -> Decision -> ThreadId Source #

Get the resultant thread identifier of a Decision, with a default case for Continue.

Since: 0.5.0.0

decisionOf Source #

Arguments

:: Foldable f 
=> Maybe ThreadId

The prior thread.

-> f ThreadId

The threads.

-> ThreadId

The current thread.

-> Decision 

Get the Decision that would have resulted in this thread identifier, given a prior thread (if any) and collection of threads which are unblocked at this point.

Since: 0.5.0.0