Documentation
¶
Index ¶
- func BasketFlags() *pflag.FlagSet
- func GenerateControls(files ...string) <-chan string
- func GenerateControlsWithContext(ctx context.Context, b Basket, files ...string) <-chan string
- func GenerateIDs(ids ...string) <-chan string
- func GenerateIDsWithContext(ctx context.Context, ids ...string) <-chan string
- func GenerateTests(files ...string) <-chan string
- func GenerateTestsWithContext(ctx context.Context, b Basket, files ...string) <-chan string
- func SplitQualifiedName(name string) (string, string)
- type Basket
- type Job
- type Ledger
- type Result
- type Runner
- type Suite
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasketFlags ¶
BasketFlags returns a flagset with all flags for filtering objects.
BasketFlags are regular expressions to filter objects. If you pass multiple regular expressions, all of them must match (AND). Example:
$ cat example.ttcn3 testcase foo() ... testcase bar() ... testcase foobar() ... ... $ ntt list --regex=foo --regex=bar example.foobar $ ntt list --regex='foo|bar' example.foo example.bar example.foobar
Similarly, you can also specify regular expressions for documentation tags. Example:
$ cat example.ttcn3 // @one // @two some-value testcase foo() ... // @two: some-other-value testcase bar() ... ... $ ntt list --tags-regex=@one --tags-regex=@two example.foo $ ntt list --tags-regex='@two: some' example.foo example.bar
func GenerateControls ¶
GenerateControls emits all control function ids from given TTCN-3 files to a channel.
func GenerateControlsWithContext ¶
GenerateControls emits all control function ids from given TTCN-3 files to a channel.
func GenerateIDs ¶
GenerateIDs emits given IDs to a channel.
func GenerateIDsWithContext ¶
GenerateIDs emits given IDs to a channel.
func GenerateTests ¶
GenerateTests emits all test ids from given TTCN-3 files to a channel.
func GenerateTestsWithContext ¶
GenerateTestsWithContext emits all test ids from given TTCN-3 files to a channel.
func SplitQualifiedName ¶
SplitQualifiedName splits a qualified name into module and test name.
Types ¶
type Basket ¶
type Basket struct {
// Name is the name of the basket. The basket is used to filter objects
// by tag, if no explicit filters are given.
Name string
// Regular expressions the object name must match.
NameRegex []string
// Regular expressions the object name must not match.
NameExclude []string
// Regular expressions the object tags must match.
TagsRegex []string
// Regular expressions the object tags must not match.
TagsExclude []string
// Baskets are sub-baskets to be ORed.
Baskets []Basket
}
A Basket is a filter for objects. It can be used to filter objects by name and tags.
Baskets are also filters defined by environment variables of the form:
NTT_LIST_BASKETS_<name> = <filters>
For example, to define a basket "stable" which excludes all objects with @wip or @flaky tags:
export NTT_LIST_BASKETS_stable="-X @wip|@flaky"
Baskets become active when they are listed in colon separated environment variable NTT_LIST_BASKETS. If you specify multiple baskets, at least of them must match (OR).
Rule of thumb: all baskets are ORed, all explicit filter options are ANDed. Example:
$ export NTT_LIST_BASKETS_stable="--tags-exclude @wip|@flaky" $ export NTT_LIST_BASKETS_ipv6="--tags-regex @ipv6" $ NTT_LIST_BASKETS=stable:ipv6 ntt list -R @flaky
Above example will output all tests with a @flaky tag and either @wip or @ipv6 tag.
If a basket is not defined by an environment variable, it's equivalent to a "--tags-regex" filter. For example, to lists all tests, which have either a @flaky or a @wip tag:
# Note, flaky and wip baskets are not specified explicitly. $ NTT_LIST_BASKETS=flaky:wip ntt list # This does the same: $ ntt list --tags-regex="@wip|@flaky"
func (*Basket) LoadFromEnvOrConfig ¶
Load baskets from given environment variable from environment or from configuration.
type Job ¶
type Job struct {
// Full qualified name of the test or control function to be executed.
Name string
// Working directory for the job.
Dir string
// Test suite the job belongs to.
Suite *Suite
// contains filtered or unexported fields
}
Job represents a single job to be executed.
type Runner ¶
type Runner interface {
// Run the jobs in the given channel.
Run(ctx context.Context, jobs <-chan *Job) <-chan Result
}
Runner is a test runner.
type Suite ¶
Suite represents a test suite.
func NewSuite ¶
NewSuite creates a new suite from the given files. It expects either a single directory as argument or a list of regular .ttcn3 files.
Calling NewSuite with an empty argument list will create a suite from current working directory or, if set, from NTT_SOURCE_DIR.
NewSuite will read manifest (package.yml) if any.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
ntt
command
|
|
|
internal
|
|
|
compdb
Package compdb provides the structs for generate compilation database as specified by https://clang.llvm.org/docs/JSONCompilationDatabase.html
|
Package compdb provides the structs for generate compilation database as specified by https://clang.llvm.org/docs/JSONCompilationDatabase.html |
|
env
Package env provides functionality to dynamically load the environment variables
|
Package env provides functionality to dynamically load the environment variables |
|
fs
Package fs provides a primitive virtual file system.
|
Package fs provides a primitive virtual file system. |
|
loc
Package loc provides space-efficient mapping of source code locations.
|
Package loc provides space-efficient mapping of source code locations. |
|
log
Package log provides uniform logging and tracing interfaces for ntt.
|
Package log provides uniform logging and tracing interfaces for ntt. |
|
lsp
Package lsp implements LSP for gopls.
|
Package lsp implements LSP for gopls. |
|
lsp/helper
command
Invoke with //go:generate helper/helper -t Server -d protocol/tsserver.go -u lsp -o server_gen.go invoke in internal/lsp
|
Invoke with //go:generate helper/helper -t Server -d protocol/tsserver.go -u lsp -o server_gen.go invoke in internal/lsp |
|
lsp/jsonrpc2
Package jsonrpc2 is a minimal implementation of the JSON RPC 2 spec.
|
Package jsonrpc2 is a minimal implementation of the JSON RPC 2 spec. |
|
lsp/jsonrpc2/servertest
Package servertest provides utilities for running tests against a remote LSP server.
|
Package servertest provides utilities for running tests against a remote LSP server. |
|
lsp/protocol
Package protocol contains the structs that map directly to the wire format of the "Language Server Protocol".
|
Package protocol contains the structs that map directly to the wire format of the "Language Server Protocol". |
|
lsp/span
Package span contains support for representing with positions and ranges in text files.
|
Package span contains support for representing with positions and ranges in text files. |
|
lsp/telemetry
Package telemetry provides an opinionated set of packages that cover the main concepts of telemetry in an implementation agnostic way.
|
Package telemetry provides an opinionated set of packages that cover the main concepts of telemetry in an implementation agnostic way. |
|
lsp/telemetry/export
Package export holds the definition of the telemetry Exporter interface, along with some simple implementations.
|
Package export holds the definition of the telemetry Exporter interface, along with some simple implementations. |
|
lsp/telemetry/export/ocagent
Package ocagent adds the ability to export all telemetry to an ocagent.
|
Package ocagent adds the ability to export all telemetry to an ocagent. |
|
lsp/telemetry/log
Package log is a context based logging package, designed to interact well with both the lsp protocol and the other telemetry packages.
|
Package log is a context based logging package, designed to interact well with both the lsp protocol and the other telemetry packages. |
|
lsp/telemetry/metric
Package metric aggregates stats into metrics that can be exported.
|
Package metric aggregates stats into metrics that can be exported. |
|
lsp/telemetry/stats
Package stats provides support for recording telemetry statistics.
|
Package stats provides support for recording telemetry statistics. |
|
lsp/telemetry/tag
Package tag provides support for telemetry tagging.
|
Package tag provides support for telemetry tagging. |
|
lsp/telemetry/trace
Package trace adds support for telemetry tracing.
|
Package trace adds support for telemetry tracing. |
|
lsp/telemetry/unit
Package unit holds the definitions for the units you can use in telemetry.
|
Package unit holds the definitions for the units you can use in telemetry. |
|
lsp/xcontext
Package xcontext is a package to offer the extra functionality we need from contexts that is not available from the standard context package.
|
Package xcontext is a package to offer the extra functionality we need from contexts that is not available from the standard context package. |
|
memoize
Package memoize supports memoizing the return values of functions with idempotent results that are expensive to compute.
|
Package memoize supports memoizing the return values of functions with idempotent results that are expensive to compute. |
|
session
Package session provides machine-wide unique sessions.
|
Package session provides machine-wide unique sessions. |
|
session/flock
Package flock implements a thread-safe interface for file locking.
|
Package flock implements a thread-safe interface for file locking. |
|
yaml
Package yaml provides uniform interface for parsing YAML files.
|
Package yaml provides uniform interface for parsing YAML files. |
|
Package k3 provides convenience functions for supporting k3 toolchain.
|
Package k3 provides convenience functions for supporting k3 toolchain. |
|
log
Package log supports parsing K3 runtime log files.
|
Package log supports parsing K3 runtime log files. |
|
t3xf
Package t3xf provides routines for decoding and loading t3xf encoded files.
|
Package t3xf provides routines for decoding and loading t3xf encoded files. |
|
Package project provides a tool-independent interface for working with various TTCN-3 project layouts and configurations.
|
Package project provides a tool-independent interface for working with various TTCN-3 project layouts and configurations. |
|
Package test provides interfaces for running TTCN-3 test cases.
|
Package test provides interfaces for running TTCN-3 test cases. |
|
Package ttcn3 provides routines for evaluating TTCN-3 source code.
|
Package ttcn3 provides routines for evaluating TTCN-3 source code. |
|
ast
Package ast provides TTCN-3 syntax tree nodes and functions for tree traversal.
|
Package ast provides TTCN-3 syntax tree nodes and functions for tree traversal. |
|
parser
Package parser implements a tolerant TTCN-3 parser library.
|
Package parser implements a tolerant TTCN-3 parser library. |
|
scanner
Package scanner provides a TTCN-3 scanner
|
Package scanner provides a TTCN-3 scanner |
|
syntax
Package syntax provides a fast high fidelity parser for TTCN-3.
|
Package syntax provides a fast high fidelity parser for TTCN-3. |
|
syntax/internal/gen
command
This program reads the TTCN-3 grammar file and generates a parser for it.
|
This program reads the TTCN-3 grammar file and generates a parser for it. |
|
token
Package token defines constants representing the lexical tokens of the TTCN-3 programming language and basic operations on tokens (printing, predicates).
|
Package token defines constants representing the lexical tokens of the TTCN-3 programming language and basic operations on tokens (printing, predicates). |

