Titan TTCN3 Notes

Some notes about developing in Titan TTCN3, specifically regarding test cases in the Osmocom universe.

Building / Using test cases


  • You'll need recent enough eclipse-titan installed: 8.0.0 or later recommended.
    • if you're using Debian packages, you might run into a compile error "The version of GCC does not match the expected version". If you do, it is suggested to use MAKEDEPEND_RUN define to workaround the issue. Alternatively you can edit /usr/include/titan/cversion.h and comment out the related #error line.
    • there's a build for Debian 9.0 available from our osmocom:latest feed, see
  • You'll need a checkout/clone of

Titan Modules required

The osmo-ttcn3-hacks depend on a variety of other TTCN-3 modules that will be automatically cloned by the make files included, see the deps/ sub-directory.

Test run

For example, to run sysinfo tests do the following:
  • adjust BASEDIR in sysinfo/ to match your environment
  • adjust test configuration in sysinfo/Test.cfg if necessary
    cd sysinfo
    make -j1 compile && make -j8
    cd ..
    ./ sysinfo/Test sysinfo/Test.cfg

See also

Log files

you will receive log files in the current working directory. You can use the ttcn3_logmerge tool to merge multiple log files based on their timestamps, and you can use the ttcn3_logformat tool to do some human-friendly formatting of the log files. Harald often runs his test suite like:

rm -f *.log && make -j1 compile && make -j8 && ../ MGCP_Test MGCP_Test.cfg && ttcn3_logformat *.log

Development related bits

ttcn3 import statements

Calling the shell scripts to create symlinks is necessary because the titan compiler has to see all related files at once.
Be careful when you're adding new import statements to files residing in the library/ subdirectory - those might not get symlinked to all test subdirs yet, and might cause compile errors for some tests!

Learning TTCN3

A good set of slides about TTCN3 can be found in:

See also

Speedup local builds with ccache:

There's a patch in gerrit to use ccache if it is found in the build system, which provides a speedup factor of around x10.

Patch can be found in:

Upstream should be contacted to request for inclusion of a flag to remove the "generated date" as a comment in the generated code, which prevents ccache to work fine out of the box (the provided gerrit patch workarounds this issue).

RAW coder

A lot of the messages (GSMTAP, LAPDm, L1CTL, ...) are described using the Titan extensions to the TTCN-3 type language and the associated RAW coder.

Section 4.23 of the Programmer's Technical Reference Guide for the TITAN TTCN-3 Toolset contains the description of this RAW coder.


This determines the order of fields within a record or set type.

In (not only) GSM specs, typically the messages are described from first field at top to the last field at the bottom, so the logical choice here is to set "FIELDORDER" as we do in the GMS_Types.ttcn and other files. However, there's one CAVEAT: In GSM 04.08 (and derived specs), Information Elements with 1/2 (4bit) length are ordered un-intitively.


  • L1 Pseudl Length (1)
  • protocol descriptor (1/2)
  • skip indicator (1/2)
  • Message Type (1)

which then translates to:

        type record RrHeader {
                L2PseudoLength  l2_plen,
                uint4_t         skip_indicator,
                uint4_t         rr_protocol_discriminator,
                RrMessageType   message_type
        } with { variant "FIELDORDER(msb)" };

Note the skip_indicator and rr_protocol_discriminator fields are swapped in their order compared to the spec!


Our RANAP ttcn3 tests require libfftranscode, which can be found at:

When it is missing, the error message looks like this: fatal error: fftranscode/transcode.h: No such file or directory
    7 | #include <fftranscode/transcode.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:180: RANAP_EncDec.o] Error 1

See also Titan_TTCN3_Testsuites

Updated by pespin 2 months ago · 30 revisions

Add picture from clipboard (Maximum size: 48.8 MB)