Verified Commit b0ab44b6 authored by Camil Staps's avatar Camil Staps 🚀

Remove traceConfig,countConfig,verboseConfig etc. which only have fields for...

Remove traceConfig,countConfig,verboseConfig etc. which only have fields for testing functionality, not for printing options
parent 3e8420d5
......@@ -54,7 +54,6 @@ instance Testable [a] | Testable a
//derive bimap [], (,), (,,), (,,,), (,,,,), (,,,,,)
MaxExists :== 1000
NrOfTest :== 1000
//--- for generating lists of elements ---//
......@@ -148,7 +147,7 @@ quietnm :: !Int !Int !RandomStream !p -> [String] | Testable p
testEvents :: !RandomStream !p -> [String] | Testable p
testEventsn :: !Int !RandomStream !p -> [String] | Testable p
test :: !p -> [String] | Testable p // test p NrOfTest times
test :: !p -> [String] | Testable p // test p 1000 times
testn :: !Int !p -> [String] | Testable p // maxnumber of tests
ttestn :: !Int !p -> [String] | Testable p // maxnumber of tests, trace all arguments
testnm :: !Int !Int !p -> [String] | Testable p // maxnumber of tests, max number of errors
......
......@@ -114,13 +114,14 @@ where
GE_Tick n adm -> pc.everyOutput n adm
printEvents _ [] = []
verboseConfig =
{ maxTests = NrOfTest
, maxArgs = 2*NrOfTest
, fails = 1
defaultTestConfig =
{ maxTests = 1000
, maxArgs = 2000
, fails = 1
, randoms = aStream
, genState = genState
}
verbosePrintConfig =
{ everyOutput = verboseEvery
, counterExampleOutput = humanReadableCEOutput
......@@ -129,13 +130,6 @@ verbosePrintConfig =
}
verboseEvery n r = blank <+ n <+ ":" <+ join " " r.Admin.args
traceConfig =
{ maxTests = 100
, maxArgs = 1000
, fails = 1
, randoms = aStream
, genState = genState
}
tracePrintConfig =
{ everyOutput = traceEvery
, counterExampleOutput = humanReadableCEOutput
......@@ -147,13 +141,6 @@ traceEvery n r = n <+ ":" <+ join " " r.Admin.args <+ "\n"
blank :: String
blank =: { createArray len ' ' & [0] = '\r', [len-1] = '\r' } where len = 81
countConfig =
{ maxTests = 100
, maxArgs = 10000
, fails = 1
, randoms = aStream
, genState = genState
}
countPrintConfig =
{ everyOutput = countEvery 100
, counterExampleOutput = humanReadableCEOutput
......@@ -165,13 +152,6 @@ countEvery steps n r
| n rem steps == 0 = toString n +++ "\r"
| otherwise = ""
quietConfig =
{ maxTests = 1000
, maxArgs = 10000
, fails = 1
, randoms = aStream
, genState = genState
}
quietPrintConfig =
{ everyOutput = noEveryOutput
, counterExampleOutput = humanReadableCEOutput
......@@ -179,13 +159,6 @@ quietPrintConfig =
, resultOutput = humanReadableResOutput True
}
testEventsConfig =
{ maxTests = 1000
, maxArgs = 10000
, fails = 1
, randoms = aStream
, genState = genState
}
testEventsPrintConfig =
{ everyOutput = noEveryOutput
, counterExampleOutput = noCounterExampleOutput
......@@ -308,7 +281,7 @@ derive genShow Testoption, GenType
Test :: ![Testoption] !p -> [GastEvent] | Testable p
Test options p = testConfig config.randoms {config & randoms = []} p
where
config = foldl handleOption verboseConfig options
config = foldl handleOption defaultTestConfig options
handleOption c (Tests i) = {c & maxTests = i, maxArgs = 2*i}
handleOption c (Fails i) = {c & fails = i}
......@@ -326,46 +299,46 @@ TestList :: ![Testoption] ![p] -> [GastEvent] | Testable p
TestList options ps = flatten (map (Test options) ps)
test :: !p -> [String] | Testable p
test p = testn NrOfTest p
test p = testn 1000 p
testn :: !Int !p -> [String] | Testable p
testn n p = verbosen n aStream p
testnm :: !Int !Int !p -> [String] | Testable p
testnm n m p = printEvents verbosePrintConfig $ testConfig aStream { verboseConfig & maxTests = n, maxArgs = 100*n, fails = m } p
testnm n m p = printEvents verbosePrintConfig $ testConfig aStream { defaultTestConfig & maxTests = n, maxArgs = 100*n, fails = m } p
ttestn :: !Int !p -> [String] | Testable p
ttestn n p = printEvents verbosePrintConfig $ testConfig aStream { traceConfig & maxTests = n, maxArgs = 100*n } p
ttestn n p = printEvents verbosePrintConfig $ testConfig aStream { defaultTestConfig & maxTests = n, maxArgs = 100*n } p
ttestnm :: !Int !Int !p -> [String] | Testable p
ttestnm n m p = printEvents verbosePrintConfig $ testConfig aStream { traceConfig & maxTests = n, maxArgs = 100*n, fails = m } p
ttestnm n m p = printEvents verbosePrintConfig $ testConfig aStream { defaultTestConfig & maxTests = n, maxArgs = 100*n, fails = m } p
verbose :: !RandomStream !p -> [String] | Testable p
verbose rs p = printEvents verbosePrintConfig $ testConfig rs verboseConfig p
verbose rs p = printEvents verbosePrintConfig $ testConfig rs defaultTestConfig p
verbosen :: !Int !RandomStream !p -> [String] | Testable p
verbosen n rs p = printEvents verbosePrintConfig $ testConfig rs { verboseConfig & maxTests = n, maxArgs = 100*n } p
verbosen n rs p = printEvents verbosePrintConfig $ testConfig rs { defaultTestConfig & maxTests = n, maxArgs = 100*n } p
concise :: !RandomStream !p -> [String] | Testable p
concise rs p = printEvents countPrintConfig $ testConfig rs countConfig p
concise rs p = printEvents countPrintConfig $ testConfig rs defaultTestConfig p
concisen :: !Int !RandomStream !p -> [String] | Testable p
concisen n rs p = printEvents countPrintConfig $ testConfig rs { countConfig & maxTests = n, maxArgs = 100*n } p
concisen n rs p = printEvents countPrintConfig $ testConfig rs { defaultTestConfig & maxTests = n, maxArgs = 100*n } p
quiet :: !RandomStream !p -> [String] | Testable p
quiet rs p = printEvents quietPrintConfig $ testConfig rs quietConfig p
quiet rs p = printEvents quietPrintConfig $ testConfig rs defaultTestConfig p
quietn :: !Int !RandomStream !p -> [String] | Testable p
quietn n rs p = printEvents quietPrintConfig $ testConfig rs { quietConfig & maxTests = n, maxArgs = 100*n } p
quietn n rs p = printEvents quietPrintConfig $ testConfig rs { defaultTestConfig & maxTests = n, maxArgs = 100*n } p
quietnm :: !Int !Int !RandomStream !p -> [String] | Testable p
quietnm n m rs p = printEvents quietPrintConfig $ testConfig rs { quietConfig & maxTests = n, maxArgs = 100*n, fails = m } p
quietnm n m rs p = printEvents quietPrintConfig $ testConfig rs { defaultTestConfig & maxTests = n, maxArgs = 100*n, fails = m } p
testEvents :: !RandomStream !p -> [String] | Testable p
testEvents rs p = printEvents testEventsPrintConfig $ testConfig rs testEventsConfig p
testEvents rs p = printEvents testEventsPrintConfig $ testConfig rs defaultTestConfig p
testEventsn :: !Int !RandomStream !p -> [String] | Testable p
testEventsn n rs p = printEvents testEventsPrintConfig $ testConfig rs { testEventsConfig & maxTests = n, maxArgs = 100*n } p
testEventsn n rs p = printEvents testEventsPrintConfig $ testConfig rs { defaultTestConfig & maxTests = n, maxArgs = 100*n } p
testConfig :: RandomStream Config p -> [GastEvent] | Testable p
testConfig rs {maxTests,maxArgs,fails,genState} p
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment