ct_testspec(3)
β¨ ct_testspec β¨
okay bestie, welcome to ct_testspec β that's the ct_testspec(3) module from the Erlang Common Test world π it's a tiny little helper module, but it's doing the absolute most when it comes to reading test specs, no cap.
πΈ DESCRIPTION πΈ
This module exports help functions for parsing of test specifications. that's it, that's the whole vibe β it's the parser bestie who reads your test spec files and tells you what's up π
π¦ FUNCTIONS π¦
π
get_tests(Specs) -> {ok, [{Specs, Tests}]} | {error, Reason}
and here's the type tea, verbatim, because we do NOT play with type specs π«Ά:
get_tests(Specs) -> {ok, [{Specs, Tests}]} | {error, Reason}
when
Specs :: [string()] | [[string()]],
Tests :: {Node, Run, Skip},
Node :: atom(),
Run :: {Dir, Suites, Cases},
Skip ::
{Dir, Suites, Comment} |
{Dir, Suites, Cases, Comment},
Dir :: string(),
Suites :: atom | [atom()] | all,
Cases :: atom | [atom()] | all,
Comment :: string(),
Reason :: term().
Parse the given test specification files and return the tests to run and skip. literally its whole job, and it slays at it π
so here's the thing β the shape of what you pass in matters, and it changes the vibe completely:
- If
SpecsIn=[Spec1,Spec2,...], separate tests will be created per specification. one test each, everybody gets their own moment β¨ - If
SpecsIn=[[Spec1,Spec2,...]], all specifications will be merge into one test. one big group hug, one single test π«
For each test, a {Specs,Tests} element is returned, where:
Specsis a list of all included test specifications,- and
Testsspecifies actual tests to run/skip per node π
ngl the nesting on that input is doing the absolute most β[string()]vs[[string()]]is one little bracket standing between "separate tests" and "one merged test", so look at it twice before you blame the parser π
and that's the whole module, bestie β small, focused, iconic, main character energy in a 60-line file π
Ericsson AB made this one, it shipped as part of common_test version 1.31.1, and this page is dated ct_testspec(3). mwah, periodt ππ
π¦ where this page comes from
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms