This walkthrough gets you from "I just installed ntt" to running a TTCN-3 test and using the LSP features in your editor in under five minutes. It assumes you already have ntt on your PATH; see the install instructions if you don't.
Pick a working directory and drop in a single test file. We'll use
/tmp/hello-ntt for this example - swap in any path you like, but make
sure the path you pick has no spaces in it (a Windows-friendly
restriction).
mkdir -p /tmp/hello-ntt
cd /tmp/hello-nttCreate a package.yml so ntt recognises this folder as a project root:
# /tmp/hello-ntt/package.yml
name: hello
source_dir: .Create the test file itself:
// /tmp/hello-ntt/Hello.ttcn3
module Hello {
function add(integer a, integer b) return integer {
return a + b;
}
testcase TC_Add() runs on system {
if (add(2, 3) == 5) {
setverdict(pass);
} else {
setverdict(fail);
}
}
control {
execute(TC_Add());
}
}
ntt listYou should see:
Hello.TC_Add
If you don't, double-check that you ran ntt from inside the project
directory and that package.yml is in the same folder as the .ttcn3
file.
ntt runntt executes the control block, which in turn calls our testcase, and
reports a pass verdict:
=== RUN Hello.TC_Add
=== PASS Hello.TC_Add 0.001s
If you change add(2, 3) == 5 to add(2, 3) == 6 and re-run, you'll
get a failing verdict and a non-zero exit status - exactly what a CI
pipeline needs.
ntt format Hello.ttcn3This normalises whitespace and reflows long lines while preserving
behaviour. Use --diff to preview the changes without writing them
back to disk.
ntt lintntt's built-in linter catches common mistakes (missing default cases,
unused imports, suspicious type coercions). Configure it via the
lint: section of package.yml; the defaults are sensible for a quick
start.
Both VS Code and vim-lsp-settings auto-detect ntt as the TTCN-3 language server. Open the project folder and the editor lights up with:
- semantic highlighting and inlay hints
- diagnostics on save
- jump to definition (including jumps from TTCN-3 into ASN.1 files)
- format-on-save via
ntt format - code actions (
source.organizeImports, lint quick-fixes)
You can also point any LSP-aware editor at the binary by configuring it to launch:
ntt langserverIf you already have a *.tpd file from
Eclipse Titan,
ntt can read it directly. Run any ntt command from a directory that
contains a .tpd (and no package.yml) and ntt will discover the
descriptor automatically. You can also point at it explicitly:
ntt list path/to/myproject.tpdReferenced sub-projects (<ReferencedProject> in the XML) are loaded
transitively, so the same command works for multi-module Titan
projects.
- Browse the ARCHITECTURE.md doc to understand how ntt is laid out internally.
- Run
ntt helpfor the full command list -run,list,tags,show,report,cover, and others. - Look at
examples/cmake/for a CMake-driven integration that builds test adapters together with the TTCN-3 code. - File feature requests and bug reports on GitHub issues.