Copyright | (c) 2015--2018 Michael Walker |
---|---|
License | MIT |
Maintainer | Michael Walker <mike@barrucadu.co.uk> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Systematic testing for concurrent computations.
- runSCT :: MonadConc n => Way -> MemType -> ConcT n a -> n [(Either Failure a, Trace)]
- runSCT' :: (MonadConc n, NFData a) => Way -> MemType -> ConcT n a -> n [(Either Failure a, Trace)]
- resultsSet :: (MonadConc n, Ord a) => Way -> MemType -> ConcT n a -> n (Set (Either Failure a))
- resultsSet' :: (MonadConc n, Ord a, NFData a) => Way -> MemType -> ConcT n a -> n (Set (Either Failure a))
- runSCTWithSettings :: MonadConc n => Settings n a -> ConcT n a -> n [(Either Failure a, Trace)]
- runSCTWithSettings' :: (MonadConc n, NFData a) => Settings n a -> ConcT n a -> n [(Either Failure a, Trace)]
- resultsSetWithSettings :: (MonadConc n, Ord a) => Settings n a -> ConcT n a -> n (Set (Either Failure a))
- resultsSetWithSettings' :: (MonadConc n, Ord a, NFData a) => Settings n a -> ConcT n a -> n (Set (Either Failure a))
- module Test.DejaFu.Settings
- runSCTDiscard :: MonadConc n => (Either Failure a -> Maybe Discard) -> Way -> MemType -> ConcT n a -> n [(Either Failure a, Trace)]
- runSCTDiscard' :: (MonadConc n, NFData a) => (Either Failure a -> Maybe Discard) -> Way -> MemType -> ConcT n a -> n [(Either Failure a, Trace)]
- resultsSetDiscard :: (MonadConc n, Ord a) => (Either Failure a -> Maybe Discard) -> Way -> MemType -> ConcT n a -> n (Set (Either Failure a))
- resultsSetDiscard' :: (MonadConc n, Ord a, NFData a) => (Either Failure a -> Maybe Discard) -> Way -> MemType -> ConcT n a -> n (Set (Either Failure a))
- sctBound :: MonadConc n => MemType -> Bounds -> ConcT n a -> n [(Either Failure a, Trace)]
- sctBoundDiscard :: MonadConc n => (Either Failure a -> Maybe Discard) -> MemType -> Bounds -> ConcT n a -> n [(Either Failure a, Trace)]
- sctUniformRandom :: (MonadConc n, RandomGen g) => MemType -> g -> Int -> ConcT n a -> n [(Either Failure a, Trace)]
- sctUniformRandomDiscard :: (MonadConc n, RandomGen g) => (Either Failure a -> Maybe Discard) -> MemType -> g -> Int -> ConcT n a -> n [(Either Failure a, Trace)]
- sctWeightedRandom :: (MonadConc n, RandomGen g) => MemType -> g -> Int -> ConcT n a -> n [(Either Failure a, Trace)]
- sctWeightedRandomDiscard :: (MonadConc n, RandomGen g) => (Either Failure a -> Maybe Discard) -> MemType -> g -> Int -> ConcT n a -> n [(Either Failure a, Trace)]
Running Concurrent Programs
:: MonadConc n | |
=> Way | How to run the concurrent program. |
-> MemType | The memory model to use for non-synchronised |
-> ConcT n a | The computation to run many times. |
-> n [(Either Failure a, Trace)] |
Explore possible executions of a concurrent program according to
the given Way
.
The exact executions tried, and the order in which results are found, is unspecified and may change between releases.
Since: 1.0.0.0
runSCT' :: (MonadConc n, NFData a) => Way -> MemType -> ConcT n a -> n [(Either Failure a, Trace)] Source #
A strict variant of runSCT
.
Demanding the result of this will force it to normal form, which may be more efficient in some situations.
The exact executions tried, and the order in which results are found, is unspecified and may change between releases.
Since: 1.0.0.0
:: (MonadConc n, Ord a) | |
=> Way | How to run the concurrent program. |
-> MemType | The memory model to use for non-synchronised |
-> ConcT n a | The computation to run many times. |
-> n (Set (Either Failure a)) |
Return the set of results of a concurrent program.
Since: 1.0.0.0
resultsSet' :: (MonadConc n, Ord a, NFData a) => Way -> MemType -> ConcT n a -> n (Set (Either Failure a)) Source #
A strict variant of resultsSet
.
Demanding the result of this will force it to normal form, which may be more efficient in some situations.
Since: 1.0.0.0
Configuration
runSCTWithSettings' :: (MonadConc n, NFData a) => Settings n a -> ConcT n a -> n [(Either Failure a, Trace)] Source #
A strict variant of runSCTWithSettings
.
Demanding the result of this will force it to normal form, which may be more efficient in some situations.
The exact executions tried, and the order in which results are found, is unspecified and may change between releases.
Since: 1.2.0.0
resultsSetWithSettings Source #
:: (MonadConc n, Ord a) | |
=> Settings n a | The SCT settings. |
-> ConcT n a | The computation to run many times. |
-> n (Set (Either Failure a)) |
A variant of resultsSet
which takes a Settings
record.
Since: 1.2.0.0
resultsSetWithSettings' :: (MonadConc n, Ord a, NFData a) => Settings n a -> ConcT n a -> n (Set (Either Failure a)) Source #
A strict variant of resultsSetWithSettings
.
Demanding the result of this will force it to normal form, which may be more efficient in some situations.
Since: 1.2.0.0
module Test.DejaFu.Settings
Deprecated
:: MonadConc n | |
=> (Either Failure a -> Maybe Discard) | Selectively discard results. |
-> Way | How to run the concurrent program. |
-> MemType | The memory model to use for non-synchronised |
-> ConcT n a | The computation to run many times. |
-> n [(Either Failure a, Trace)] |
Deprecated: Use runSCTWithSettings instead
A variant of runSCT
which can selectively discard results.
The exact executions tried, and the order in which results are found, is unspecified and may change between releases.
Since: 1.0.0.0
runSCTDiscard' :: (MonadConc n, NFData a) => (Either Failure a -> Maybe Discard) -> Way -> MemType -> ConcT n a -> n [(Either Failure a, Trace)] Source #
Deprecated: Use runSCTWithSettings' instead
A strict variant of runSCTDiscard
.
Demanding the result of this will force it to normal form, which may be more efficient in some situations.
The exact executions tried, and the order in which results are found, is unspecified and may change between releases.
Since: 1.0.0.0
:: (MonadConc n, Ord a) | |
=> (Either Failure a -> Maybe Discard) | Selectively discard results. Traces are always discarded. |
-> Way | How to run the concurrent program. |
-> MemType | The memory model to use for non-synchronised |
-> ConcT n a | The computation to run many times. |
-> n (Set (Either Failure a)) |
Deprecated: Use resultsSetWithSettings instead
A variant of resultsSet
which can selectively discard results.
Since: 1.0.0.0
resultsSetDiscard' :: (MonadConc n, Ord a, NFData a) => (Either Failure a -> Maybe Discard) -> Way -> MemType -> ConcT n a -> n (Set (Either Failure a)) Source #
Deprecated: Use resultsSetWithSettings' instead
A strict variant of resultsSetDiscard
.
Demanding the result of this will force it to normal form, which may be more efficient in some situations.
Since: 1.0.0.0
:: MonadConc n | |
=> MemType | The memory model to use for non-synchronised |
-> Bounds | The combined bounds. |
-> ConcT n a | The computation to run many times |
-> n [(Either Failure a, Trace)] |
Deprecated: Use runSCT instead
SCT via BPOR.
Schedules are generated by running the computation with a deterministic scheduler with some initial list of decisions. At each step of execution, possible-conflicting actions are looked for, if any are found, "backtracking points" are added, to cause the events to happen in a different order in a future execution.
Note that unlike with non-bounded partial-order reduction, this may do some redundant work as the introduction of a bound can make previously non-interfering events interfere with each other.
The exact executions tried, and the order in which results are found, is unspecified and may change between releases.
Since: 1.0.0.0
:: MonadConc n | |
=> (Either Failure a -> Maybe Discard) | Selectively discard results. |
-> MemType | The memory model to use for non-synchronised |
-> Bounds | The combined bounds. |
-> ConcT n a | The computation to run many times |
-> n [(Either Failure a, Trace)] |
Deprecated: Use runSCTWithSettings instead
A variant of sctBound
which can selectively discard results.
The exact executions tried, and the order in which results are found, is unspecified and may change between releases.
Since: 1.0.0.0
:: (MonadConc n, RandomGen g) | |
=> MemType | The memory model to use for non-synchronised |
-> g | The random number generator. |
-> Int | The number of executions to perform. |
-> ConcT n a | The computation to run many times. |
-> n [(Either Failure a, Trace)] |
Deprecated: Use runSCT instead
SCT via uniform random scheduling.
Schedules are generated by assigning to each new thread a random weight. Threads are then scheduled by a weighted random selection.
This is not guaranteed to find all distinct results.
Since: 1.0.0.0
sctUniformRandomDiscard Source #
:: (MonadConc n, RandomGen g) | |
=> (Either Failure a -> Maybe Discard) | Selectively discard results. |
-> MemType | The memory model to use for non-synchronised |
-> g | The random number generator. |
-> Int | The number of executions to perform. |
-> ConcT n a | The computation to run many times. |
-> n [(Either Failure a, Trace)] |
Deprecated: Use runSCTWithSettings instead
A variant of sctUniformRandom
which can selectively discard
results.
This is not guaranteed to find all distinct results.
Since: 1.0.0.0
:: (MonadConc n, RandomGen g) | |
=> MemType | The memory model to use for non-synchronised |
-> g | The random number generator. |
-> Int | The number of executions to perform. |
-> ConcT n a | The computation to run many times. |
-> n [(Either Failure a, Trace)] |
Deprecated: Use runSCT instead
SCT via weighted random scheduling.
Schedules are generated by assigning to each new thread a random weight. Threads are then scheduled by a weighted random selection.
This is not guaranteed to find all distinct results.
Since: 1.7.0.0
sctWeightedRandomDiscard Source #
:: (MonadConc n, RandomGen g) | |
=> (Either Failure a -> Maybe Discard) | Selectively discard results. |
-> MemType | The memory model to use for non-synchronised |
-> g | The random number generator. |
-> Int | The number of executions to perform. |
-> ConcT n a | The computation to run many times. |
-> n [(Either Failure a, Trace)] |
Deprecated: Use runSCTWithSettings instead
A variant of sctWeightedRandom
which can selectively discard
results.
This is not guaranteed to find all distinct results.
Since: 1.7.0.0