Commit d0e476d2 authored by Camil Staps's avatar Camil Staps 🍃

Add timing information to --test runs

parent f6a7c350
......@@ -127,7 +127,14 @@ where
, test_options :: ![TestOption]
}
:: TestOption = NoUnify
:: TestOption
= TO_NoUnify
| TO_Quiet
instance == TestOption
where
== TO_NoUnify to = to=:TO_NoUnify
== TO_Quiet to = to=:TO_Quiet
instance zero Options
where
......@@ -165,8 +172,12 @@ optionDescription = WithHelp True $ Options
"Load queries from FILE and execute them (do not start a TCP server)"
, Flag
"--test-no-unify"
(\opts -> Ok {opts & test_options=[NoUnify:opts.test_options]})
(\opts -> Ok {opts & test_options=[TO_NoUnify:opts.test_options]})
"Do not test queries that require unification (only used with --test)"
, Flag
"--test-quiet"
(\opts -> Ok {opts & test_options=[TO_Quiet:opts.test_options]})
"Do not print test queries as they are executed (only used with --test)"
]
Start w
......@@ -313,14 +324,22 @@ test opts queries db w
# w = snd $ fclose (stderr <<< "Warning: could not parse '" <<< qstring <<< "'; " <<< fromError q <<< "\n") w
= test opts queries db w
# q = fromOk q
| excluded opts q
| excluded q
= test opts queries db w
# (_,_,db,w) = handle (Just q) db w
# w = if (isMember TO_Quiet opts)
w
(snd $ fclose (stderr <<< qstring) w)
#! (Clock start,w) = clock w
#! (resp,_,db,w) = handle (Just q) db w
| (hyperstrict resp).return < 0 = abort "return code was < 0\n"
#! (Clock end,w) = clock w
# w = if (isMember TO_Quiet opts)
w
(snd $ fclose (stderr <<< "\t" <<< (end-start) <<< "\n") w)
= test opts queries db w
where
excluded :: ![TestOption] !Request -> Bool
excluded [] _ = False
excluded [NoUnify:os] r = isJust r.unify || excluded os r
excluded :: !Request -> Bool
excluded r = isJust r.unify && isMember TO_NoUnify opts
computeRankConstraints :: !FilePath !*CloogleDB !*World -> *World
computeRankConstraints constraintfile db w
......
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