Commit Graph

105 Commits

Author SHA1 Message Date
Michael Walker
da474b5dcf Turn 'Program' typeclass into a GADT
With careful application of typeclass instances to this GADT, and by
redefining 'ConcT' in terms of it, this solves the type inference
problem and removes the need for the 'basic' function.  This approach
also has less newtype wrapping/unwrapping, and so is probably a step
in the right direction even without the type inference advantages.

The diff is quite big because things have needed to migrate between
modules to avoid the import graph getting even worse.
2019-02-02 01:38:39 +00:00
Michael Walker
d375387784 Replace dontCheck/subconcurrency with new Program class
The 'Program' is the new formulation of dejafu unit tests.  A
'Program' is one of three types:

- A 'ConcT', which is as before.

- A 'WithSetup', which corresponds to 'dontCheck'.

- A 'WithSetupAndTeardown', which corresponds to 'subconcurrency'.

This more new formulation makes it impossible to nest 'withSetup' (the
replacement for 'dontCheck') or 'withSetupAndTeardown' (the
half-replacement for 'subconcurrency'), by as these functions take a
'ConcT' as their argument and produce a 'Program WithSetup' or
'Program WithSetupAndTeardown'.

The testing functions have all been generalised to work with this
'Program' type.
2019-02-02 01:38:39 +00:00
Michael Walker
17739e6ec6 Remove explicit TypeSynonymInstances
It is implied by FlexibleInstances.
2019-02-01 23:14:37 +00:00
Michael Walker
ac35055beb Remove unnecessary CPP 2019-02-01 23:14:31 +00:00
Michael Walker
c17f66303a Remove deprecated functions & types 2019-01-20 14:24:46 +00:00
Michael Walker
c754c1f3d6 Prepare releases 2019-01-20 01:10:34 +00:00
Michael Walker
5b93fbd8d5 Re-export 'Condition' from {hunit,tasty}-dejafu 2019-01-20 00:07:17 +00:00
Michael Walker
02467da2ac Rename Failure to Condition 2019-01-20 00:07:17 +00:00
Michael Walker
fa658dcf06 dejafu-1.11.0.4 & tasty-dejafu-1.2.0.8 2018-12-02 10:43:20 +00:00
Michael Walker
dd462357c9 Bump tasty upper bound 2018-12-02 10:39:42 +00:00
Michael Walker
0088f21ade concurrency, dejafu, hunit-dejafu, tasty-dejafu release 2018-07-01 13:31:23 +01:00
Michael Walker
039295ef41 Rename CRef to IORef 2018-07-01 12:45:43 +01:00
Michael Walker
93f284b366 dejafu-1.10.0.0, hunit-dejafu-1.2.0.5, tasty-dejafu-1.2.0.6 release 2018-06-17 11:21:43 +01:00
Michael Walker
1f82a0adc5 dejafu-1.9.0.0, hunit-dejafu-1.2.0.4, tasty-dejafu-1.2.0.5 releases 2018-06-10 01:42:48 +01:00
Michael Walker
02e0442b84 dejafu-1.8.0.0, hunit-dejafu-1.2.0.3, tasty-dejafu-1.2.0.4 releases 2018-06-03 11:29:25 +01:00
Michael Walker
e6610c9d3d dejafu-1.7.0.0, hunit-dejafu-1.2.0.2, tasty-dejafu-1.2.0.3 releases 2018-06-03 02:46:00 +01:00
Michael Walker
2dd213efa5 tasty-dejafu-1.2.0.2 release 2018-05-12 07:28:57 +01:00
Michael Walker
3497eb39a9 Bump upper bound of tasty to <1.2
https://github.com/fpco/stackage/issues/3620
2018-05-12 07:26:41 +01:00
Michael Walker
e60ed883cd dejafu-1.6.0.0 + {hunit,tasty}-dejafu-1.2.0.1 release 2018-05-11 02:16:32 +01:00
Michael Walker
0e00f8aec3 Prepare releases 2018-03-28 19:05:15 +01:00
Michael Walker
35c2069b89 Drop GHC 7.10 support 2018-03-25 10:28:20 +01:00
Michael Walker
2a3f442e95 Prepare dejafu, hunit-dejafu, tasty-dejafu release 2018-03-17 18:43:16 +00:00
Michael Walker
34f6358e86 Remove mentions of docs.barrucadu.co.uk 2018-03-11 22:49:51 +00:00
Michael Walker
d1d3f186b7 Prepare dejafu, hunit-dejafu, and tatsy-dejafu release 2018-03-06 18:57:27 +00:00
Michael Walker
20178ef751 Prepare dejafu, hunit-dejafu, and tasty-dejafu release 2018-03-06 17:25:49 +00:00
Michael Walker
89c14ff2f7 Add *WithSettings to Test.Tasty.DejaFu and deprecate *Discard 2018-03-04 12:38:51 +00:00
Michael Walker
c36685b53e Make all settings other than Way and MemType optional 2018-03-04 02:56:08 +00:00
Michael Walker
ff45adcd74 Prepare for release 2018-02-22 19:00:44 +00:00
Michael Walker
481bf1eca6 Rewrite tasty-dejafu changelog 2018-02-16 18:59:20 +00:00
Michael Walker
b61cc71d36 Prepare for tasty-dejafu-1.0.1.0 release 2018-02-13 18:57:19 +00:00
Michael Walker
7fcebe366c Add CHANGELOG entries 2018-02-13 18:57:19 +00:00
Michael Walker
a366b812d0 Clarify role of discard function in Tasty testDejafusDiscard 2018-02-13 18:45:20 +00:00
Andreas Herrmann
1ad606b6a5 testDejafusDiscard takes a list of predicates 2018-02-13 12:03:42 +01:00
Michael Walker
ebfe250ee7 tasty-dejafu-1.0.0.1 release 2018-01-09 10:49:06 +00:00
Michael Walker
f7ed31da32 Bump upper bound of tasty to 1.1 2018-01-09 10:46:57 +00:00
Michael Walker
fdbcb8b375 tasty-dejafu-1.0.0.0 release 2017-12-23 13:18:20 +00:00
Michael Walker
f310c60bc5 Update copyright years 2017-12-13 07:24:18 +00:00
Michael Walker
81bcb5a351 Split up Test.DejaFu.Common 2017-12-12 14:07:22 +00:00
Michael Walker
5ee2590f0e Rework docs
Closes #146
Closes #147
Closes #156
2017-12-12 14:07:22 +00:00
Michael Walker
020e3967f7 Change order of arguments to test functions
1. Discard function (if present)
2. Way              (if present)
3. Memory type      (if present)
4. Name of test
5. Predicate
6. Action

For multi-predicate functions, 4 and 5 are replaced with a list.
2017-12-12 14:07:22 +00:00
Michael Walker
6644bf76ef Remove _casesChecked from Result
It's now almost meaningless how many cases were examined before
finding a failure given that, ideally, only failures will be returned
at all.
2017-12-12 14:07:22 +00:00
Michael Walker
db95dde7df Give predicates discard functions 2017-12-12 14:07:22 +00:00
Michael Walker
6eaae0a589 Wrap predicate functions in a newtype & separate ty params
Also adds a Functor and Profunctor instance for predicates.  The old
predicate type is kept as an alias for the (common) case where both
tyvars are the same.
2017-12-12 14:07:22 +00:00
Michael Walker
45256193c0 Implement bound threads
This also adds forkOS(N) and isCurrentThreadBound to MonadConc, a
breaking change.

Note: forkOSWithUnmask(N) is NOT added to MonadConc, as it isn't
supported in base-4.8 (GHC 7.10).  See #132 for the action on this.

A bound thread under test gets a dedicated worker thread, which is
forked bound using the underlying MonadConc.  This worker is used for
all lifted actions, with execution as normal otherwise.
2017-12-12 14:06:59 +00:00
Michael Walker
31d29c11ea Require a 'MonadConc n' instance to run 'ConcT r n' expressions
This is preparation for adding bound threads.  The instance isn't used
in this commit, but the diff is large enough that I feel this should
be a separate commit for ease of review.

Fallout:

- The MonadBaseControl IO instance is gone, as I'm not sure how to do
  it generally.
- The pure/IO split is gone, everything is now monadic.
- The execution, SCT, and dejafu functions are of the form (MonadConc
  n, MonadRef r n) => ...
2017-12-12 14:06:59 +00:00
Michael Walker
99cae72b42 Pick version numbers for next-supermajor release 2017-12-12 14:06:59 +00:00
Michael Walker
d750342c77 hunit-dejafu-0.7.1.1 and tasty-dejafu-0.7.1.1 releases 2017-11-30 22:08:56 +00:00
Michael Walker
fa1836c3a8 Add missing haddock @since annotations 2017-11-30 22:08:38 +00:00
Michael Walker
82966c43f3 hunit-dejafu-0.7.1.0 and tasty-dejafu-0.7.1.0 releases 2017-11-30 21:43:12 +00:00
Michael Walker
417415937a Add testPropertyFor to {hunit,tasty}-dejafu
Closes #159
2017-11-30 21:40:25 +00:00