-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multicore support #410
Open
Rewbert
wants to merge
67
commits into
nick8325:master
Choose a base branch
from
Rewbert:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Multicore support #410
Changes from all commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
df5b3d7
Add support for parallel tests, as well as some refactoring of existi…
Rewbert 2a068c0
withBuffering for continuous printing
Rewbert 1079a34
first experimental shrinking loop
Rewbert f7939d5
Update README
Rewbert 35cc311
commit before hacking away
Rewbert e3e33d2
parallel shrink loop, appears to work
Rewbert 01631b1
Merge branch 'master' of github.com:Rewbert/quickcheck
Rewbert 8c29c48
simplified the API a bit
Rewbert b888718
updated documentation
Rewbert 334ee2c
tidy up code very slightly (a lot of trash left)
Rewbert 99d2bf6
moved numconcurrent into state
Rewbert 7ffcebe
forgot some uncommented parts
Rewbert 2465f6f
I believe that it is now not killing and respawning testers, but rath…
Rewbert 89a176d
non-working version where they interrupt each other
Rewbert 19543a8
commit because I nuked my machine
Rewbert 47e048a
change number of shrink successful
Rewbert c35bbcb
Merge pull request #1 from Rewbert/interrupted-shrinking
Rewbert a7e5786
quick hack to get the complete number of tests executed down to the s…
Rewbert 5e233b7
Update README
Rewbert 605c746
add final flag for Ale
Rewbert 3f97bf9
bring back the IFL implementation
Rewbert 3f2db24
add counter for numStarted
Rewbert 26e3985
test with debugprint on
Rewbert da052b4
different print
Rewbert 85d1f68
different print
Rewbert 6401912
different print
Rewbert b694e56
revert
Rewbert 84bae82
revert
Rewbert 4627bde
test flag
Rewbert c901b9f
test flag
Rewbert e608fca
test flag
Rewbert 47d527d
test flag
Rewbert a226dd3
test flag
Rewbert a7c3816
test flag
Rewbert 3d86a42
test flag
Rewbert b20d907
test flag
Rewbert f561521
test flag
Rewbert e998d2d
test flag
Rewbert 66bca6e
add error, for debugging
Rewbert 128f752
Update README
Rewbert be7d2a1
Update README
Rewbert f91488f
Update README
Rewbert f093894
experiment
Rewbert a82bf59
experiment
Rewbert b2a4a47
experiment
Rewbert 795d4f6
experiment
Rewbert 85429e1
experiment
Rewbert aacaf33
experiment
Rewbert 8627b01
Update README
Rewbert c6b27be
Add back a space, to make my advisor happy
Rewbert 455fc66
add better warning message, to make Koen happy!
Rewbert 93284ed
Merge branch 'master' of github.com:Rewbert/quickcheck
Rewbert a7268c8
more general message
Rewbert e226cda
replicating the work in commit 781d8e6 by @MaximilianAlgehed on March…
Rewbert 3a06c73
replaying the work in commit #d88f5f6 by @MaximilianAlgehed on March …
Rewbert 7298e97
reapply commit #982c1e7 by @MaximilianAlgehed on March 26th
Rewbert cd50233
forgot to export the new function
Rewbert 051829b
reapply commit #96f8dde by @MaximilianAlgehed on March 27th
Rewbert 20cbfee
some cleanup and documentation
Rewbert 19ee159
some doc
Rewbert 5f80f3f
some doc
Rewbert ec39c18
remove support for deterministic shrinking
Rewbert 751449f
modify some comments and remove dead code
Rewbert 897adb1
removed test file
Rewbert f8cbaa0
another example of slowshrinking
Rewbert 0a21298
remove unused field left over from evaluation
Rewbert d1c7962
remove unused dependency
Rewbert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ import Test.QuickCheck.Property hiding (Result, reason) | |
import qualified Test.QuickCheck.Property as P | ||
import Test.QuickCheck.Test | ||
import Test.QuickCheck.Gen | ||
import Test.QuickCheck.State | ||
import Test.QuickCheck.Text | ||
import qualified Data.Set as Set | ||
import Data.Set(Set) | ||
|
@@ -17,16 +16,16 @@ features :: [String] -> Set String -> Set String | |
features labels classes = | ||
Set.fromList labels `Set.union` classes | ||
|
||
prop_noNewFeatures :: Testable prop => Set String -> prop -> Property | ||
prop_noNewFeatures feats prop = | ||
mapResult f prop | ||
where | ||
f res = | ||
case ok res of | ||
Just True | ||
| not (features (P.labels res) (Set.fromList (P.classes res)) `Set.isSubsetOf` feats) -> | ||
res{ok = Just False, P.reason = "New feature found"} | ||
_ -> res | ||
-- prop_noNewFeatures :: Testable prop => Set String -> prop -> Property | ||
-- prop_noNewFeatures feats prop = | ||
-- mapResult f prop | ||
-- where | ||
-- f res = | ||
-- case ok res of | ||
-- Just True | ||
-- | not (features (P.labels res) (Set.fromList (P.classes res)) `Set.isSubsetOf` feats) -> | ||
-- res{ok = Just False, P.reason = "New feature found"} | ||
-- _ -> res | ||
Comment on lines
+19
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How come this needs to be commented out? |
||
|
||
-- | Given a property, which must use 'label', 'collect', 'classify' or 'cover' | ||
-- to associate labels with test cases, find an example test case for each possible label. | ||
|
@@ -81,26 +80,26 @@ labelledExamplesResult prop = labelledExamplesWithResult stdArgs prop | |
|
||
-- | A variant of 'labelledExamples' that takes test arguments and returns a result. | ||
labelledExamplesWithResult :: Testable prop => Args -> prop -> IO Result | ||
labelledExamplesWithResult args prop = | ||
withState args $ \state -> do | ||
let | ||
loop :: Set String -> State -> IO Result | ||
loop feats state = withNullTerminal $ \nullterm -> do | ||
res <- test state{terminal = nullterm} (property (prop_noNewFeatures feats prop)) | ||
let feats' = features (failingLabels res) (failingClasses res) | ||
case res of | ||
Failure{reason = "New feature found"} -> do | ||
putLine (terminal state) $ | ||
"*** Found example of " ++ | ||
concat (intersperse ", " (Set.toList (feats' Set.\\ feats))) | ||
mapM_ (putLine (terminal state)) (failingTestCase res) | ||
putStrLn "" | ||
loop (Set.union feats feats') | ||
state{randomSeed = usedSeed res, computeSize = computeSize state `at0` usedSize res} | ||
_ -> do | ||
out <- terminalOutput nullterm | ||
putStr out | ||
return res | ||
at0 f s 0 0 = s | ||
at0 f s n d = f n d | ||
loop Set.empty state | ||
labelledExamplesWithResult args prop = undefined -- TODO fix this | ||
-- withState args (\state -> do | ||
-- let | ||
-- loop :: Set String -> State -> IO Result | ||
-- loop feats state = withNullTerminal $ \nullterm -> do | ||
-- res <- test state{terminal = nullterm} (property (prop_noNewFeatures feats prop)) | ||
-- let feats' = features (failingLabels res) (failingClasses res) | ||
-- case res of | ||
-- Failure{reason = "New feature found"} -> do | ||
-- putLine (terminal state) $ | ||
-- "*** Found example of " ++ | ||
-- concat (intersperse ", " (Set.toList (feats' Set.\\ feats))) | ||
-- mapM_ (putLine (terminal state)) (failingTestCase res) | ||
-- putStrLn "" | ||
-- loop (Set.union feats feats') | ||
-- state{randomSeed = usedSeed res, computeSize = computeSize state `at0` usedSize res} | ||
-- _ -> do | ||
-- out <- terminalOutput nullterm | ||
-- putStr out | ||
-- return res | ||
-- at0 f s 0 0 = s | ||
-- at0 f s n d = f n d | ||
-- loop Set.empty state) Nothing 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably not something we want in the final readme ;)