Commit af710487 authored by Elemer Lelik's avatar Elemer Lelik
Browse files

Sync with 5.2.0

parent 4567b25b
!Makefile !Makefile
\ No newline at end of file
******************************************************************************
* Copyright (c) 2000-2015 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************************************************
Cygwin setup Cygwin setup
- If Cygwin is installed already, refresh your Cygwin installation - If Cygwin is installed already, refresh your Cygwin installation
Titan is always build for the newest Cygwin version available. Titan is always build for the newest Cygwin version available.
......
Build and install Titan on Linux ******************************************************************************
* Copyright (c) 2000-2015 Ericsson Telecom AB
1.Install required libraries: * All rights reserved. This program and the accompanying materials
(examples are given for Ubuntu 12.04/14.04; for other Linuxes, pls. use the relevant library installation method) * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
sudo apt-get install g++ expect libssl-dev libxml2-dev libncurses5-dev flex bison * http://www.eclipse.org/legal/epl-v10.html
xutils-dev is needed by makedepend: ******************************************************************************
sudo apt-get install xutils-dev
The following packages may be needed for titan_eclipse/automatic_build: Build and install Titan on Linux
sudo apt-get install ant xsltproc
1.Install required libraries:
2.Clone the titan directory from git into /home/<user_id>/titan (examples are given for Ubuntu 12.04/14.04; for other Linuxes, pls. use the relevant library installation method)
git clone https://github.com/eclipse/titan.core titan sudo apt-get install g++ expect libssl-dev libxml2-dev libncurses5-dev flex bison
xutils-dev is needed by makedepend:
3. Configure the build sudo apt-get install xutils-dev
The following packages may be needed for titan_eclipse/automatic_build:
cd titan sudo apt-get install ant xsltproc
check that MakefileFOSS.cfg is present and has the following content:
cat MakefileFOSS.cfg 2.Clone the titan directory from git into /home/<user_id>/titan
# Configurations for the Free Open Source Software version git clone https://github.com/eclipse/titan.core titan
LICENSING := no
USAGE_STATS := no 3. Configure the build
cd titan
Several build options are possible; for details on options , please read through the Makefile.cfg. check that MakefileFOSS.cfg is present and has the following content:
Options can be overridden by the content of a file named Makefile.personal which can be used to cat MakefileFOSS.cfg
adapt to local installation directories, change config options etc.
Below, a small number of typical scenarios are presented. # Configurations for the Free Open Source Software version
LICENSING := no
1) JNI disabled USAGE_STATS := no
The JNI interface is used by the Eclipse Titan Executor or by the Java Executor API.
If you don't need them , Titan can be compiled without JNI. Several build options are possible; for details on options , please read through the Makefile.cfg.
Options can be overridden by the content of a file named Makefile.personal which can be used to
Create ~/titan/Makefile.personal to override settings in Makefile.cfg with the following content: adapt to local installation directories, change config options etc.
(replace paths with values relevant to your installation) Below, a small number of typical scenarios are presented.
TTCN3_DIR := /home/<user id>/titan/Install 1) JNI disabled
OPENSSL_DIR := /usr
#JDKDIR := /usr/lib/jvm/java-7-openjdk-amd64 The JNI interface is used by the Eclipse Titan Executor or by the Java Executor API.
XMLDIR := /usr If you don't need them , Titan can be compiled without JNI.
JNI := no
GEN_PDF := no Create ~/titan/Makefile.personal to override settings in Makefile.cfg with the following content:
(replace paths with values relevant to your installation)
TTCN3_DIR := /home/<user id>/titan/Install
OPENSSL_DIR := /usr
2) JNI enabled #JDKDIR := /usr/lib/jvm/java-7-openjdk-amd64
XMLDIR := /usr
install JDK into /home/<user id>/jdk JNI := no
GEN_PDF := no
Create ~/titan/Makefile.personal to override settings in Makefile.cfg with the following content:
(replace paths with values relevant to your installation)
TTCN3_DIR := /home/<user id>/titan/Install
OPENSSL_DIR := /usr 2) JNI enabled
JDKDIR := /usr/lib/jvm/java-7-openjdk-amd64
XMLDIR := /usr install JDK into /home/<user id>/jdk
JNI := yes
GEN_PDF := no Create ~/titan/Makefile.personal to override settings in Makefile.cfg with the following content:
(replace paths with values relevant to your installation)
TTCN3_DIR := /home/<user id>/titan/Install
3. Run make OPENSSL_DIR := /usr
JDKDIR := /usr/lib/jvm/java-7-openjdk-amd64
make XMLDIR := /usr
JNI := yes
4. Run make install GEN_PDF := no
make install
This will install Titan into /home/<user id>/titan/Install 3. Run make
5. Optionally , run function/regression tests make
set environment variable TTCN3_DIR to /home/<user id>/titan/Install 4. Run make install
(setenv TTCN3_DIR /home/<user id>/titan/Install for csh, make install
export TTCN3_DIR=/home/<user id>/titan/Install for bash )
This will install Titan into /home/<user id>/titan/Install
5. Optionally , run function/regression tests
cd /home/<user id>/titan/function_test
set environment variable TTCN3_DIR to /home/<user id>/titan/Install
in the following Makefiles
(setenv TTCN3_DIR /home/<user id>/titan/Install for csh,
XER_EncDec/Makefile export TTCN3_DIR=/home/<user id>/titan/Install for bash )
Text_EncDec/Makefile
RAW_EncDec/Makefile
edit the value of XMLDIR to match your installation values cd /home/<user id>/titan/function_test
run the tests in the following Makefiles
make XER_EncDec/Makefile
Text_EncDec/Makefile
( or make |& tee outputfile if you want to save the output for verification) RAW_EncDec/Makefile
cd /home/<user id>/titan/regression_test edit the value of XMLDIR to match your installation values
make run
run the tests
( or make run |& tee outputfile if you want to save the output for verification)
make
These tests might run for half an hour (regr.tests) to two hours (func.tests)
( or make |& tee outputfile if you want to save the output for verification)
6. Optionally , copy Titan into its' final directory.
From here on, you can continue with the Titan installation guide, see /Install/docs, to set environment variables etc. cd /home/<user id>/titan/regression_test
make run
( or make run |& tee outputfile if you want to save the output for verification)
These tests might run for half an hour (regr.tests) to two hours (func.tests)
6. Optionally , copy Titan into its' final directory.
From here on, you can continue with the Titan installation guide, see /Install/docs, to set environment variables etc.
...@@ -20,26 +20,26 @@ http://polarsys.org/sites/default/files/custom_uploads/TITAN%20Datasheet%20A4%20 ...@@ -20,26 +20,26 @@ http://polarsys.org/sites/default/files/custom_uploads/TITAN%20Datasheet%20A4%20
##Binaries and SHA512 checksums for a number of Linux platforms can be downloaded from: ##Binaries and SHA512 checksums for a number of Linux platforms can be downloaded from:
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.1.0-sles10.tgz * https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux32-gcc4.1.0-sles10.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.1.0-sles10.tgz.sha512 * https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux32-gcc4.1.0-sles10.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.1.2-sled10.2.tgz * https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux32-gcc4.1.2-sled10.2.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.1.2-sled10.2.tgz.sha512 * https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux32-gcc4.1.2-sled10.2.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.3-SLED11.1.tgz * https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux32-gcc4.3-SLED11.1.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.3-SLED11.1.tgz.sha512 * https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux32-gcc4.3-SLED11.1.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.1.2-rhel5.tgz * https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.1.2-rhel5.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.1.2-rhel5.tgz.sha512 * https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.1.2-rhel5.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-SLED11.1.tgz * https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.3-SLED11.1.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-SLED11.1.tgz.sha512 * https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.3-SLED11.1.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-sled11.0.tgz * https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.3-sled11.0.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-sled11.0.tgz.sha512 * https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.3-sled11.0.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-sles11.1.tgz * https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.3-sles11.1.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-sles11.1.tgz.sha512 * https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.3-sles11.1.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.4.5-rhel6.tgz * https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.4.5-rhel6.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.4.5-rhel6.tgz.sha512 * https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.4.5-rhel6.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.6-ubuntu12.04.tgz * https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.6-ubuntu12.04.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.6-ubuntu12.04.tgz.sha512 * https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.6-ubuntu12.04.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.8-ubuntu14.04.tgz * https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.8-ubuntu14.04.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.8-ubuntu14.04.tgz.sha512 * https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.8-ubuntu14.04.tgz.sha512
# Related products: # Related products:
......
# titan.core
TTCN-3 is a standardized, modular language specifically designed for testing.
Eclipse Titan offers a free and open source (FOSS) compiler both for TTCN-3 and for
ASN.1 (Abstract Syntax Notation One).
# Standards page (also including downloadable code):
* http://www.ttcn-3.org/
# Main project page:
* https://projects.eclipse.org/projects/tools.titan
##Introductory video of a presentation about Titan held at EclipseCon 2014:
* https://www.youtube.com/watch?v=2knzZuwzn-Y.
##Titan Datasheet on polarsys.org:
http://polarsys.org/sites/default/files/custom_uploads/TITAN%20Datasheet%20A4%202.1.pdf
##Binaries and SHA512 checksums for a number of Linux platforms can be downloaded from:
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.1.0-sles10.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.1.0-sles10.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.1.2-sled10.2.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.1.2-sled10.2.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.3-SLED11.1.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.3-SLED11.1.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.1.2-rhel5.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.1.2-rhel5.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-SLED11.1.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-SLED11.1.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-sled11.0.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-sled11.0.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-sles11.1.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-sles11.1.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.4.5-rhel6.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.4.5-rhel6.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.6-ubuntu12.04.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.6-ubuntu12.04.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.8-ubuntu14.04.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.8-ubuntu14.04.tgz.sha512
# Related products:
## Test Ports:
* https://github.com/eclipse/titan.TestPorts.Common_Components.Abstract_Socket
* https://github.com/eclipse/titan.TestPorts.HTTPmsg
* https://github.com/eclipse/titan.TestPorts.LANL2asp
* https://github.com/eclipse/titan.TestPorts.PCAPasp
* https://github.com/eclipse/titan.TestPorts.PIPEasp
* https://github.com/eclipse/titan.TestPorts.SCTPasp
* https://github.com/eclipse/titan.TestPorts.SIPmsg
* https://github.com/eclipse/titan.TestPorts.SQLasp
* https://github.com/eclipse/titan.TestPorts.TCPasp
* https://github.com/eclipse/titan.TestPorts.TELNETasp
* https://github.com/eclipse/titan.TestPorts.UDPasp
## Protocol Modules:
* https://github.com/eclipse/titan.ProtocolModules.COMMON
* https://github.com/eclipse/titan.ProtocolModules.DHCP
* https://github.com/eclipse/titan.ProtocolModules.DHCPv6
* https://github.com/eclipse/titan.ProtocolModules.DIAMETER_ProtocolModule_Generator
* https://github.com/eclipse/titan.ProtocolModules.DNS
* https://github.com/eclipse/titan.ProtocolModules.ICMP
* https://github.com/eclipse/titan.ProtocolModules.ICMPv6
* https://github.com/eclipse/titan.ProtocolModules.IP
* https://github.com/eclipse/titan.ProtocolModules.RTP
* https://github.com/eclipse/titan.ProtocolModules.RTSP
* https://github.com/eclipse/titan.ProtocolModules.SMPP
* https://github.com/eclipse/titan.ProtocolModules.SMTP
* https://github.com/eclipse/titan.ProtocolModules.SNMP
* https://github.com/eclipse/titan.ProtocolModules.TCP
* https://github.com/eclipse/titan.ProtocolModules.UDP
* https://github.com/eclipse/titan.ProtocolModules.XMPP
******************************************************************************
* Copyright (c) 2000-2015 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************************************************
MinGW setup
(A) Download the MinGW installer from the MinGW site:
http://www.mingw.org/
(B) Follow the install steps found on the MinGW getting started page:
http://www.mingw.org/wiki/getting_started
Select the mingw-gcc-v3 packages because Titan only compiles
with older gcc. If you select the gcc4 packages, then the make process
stops immediately with some error messages. Select the msys packages too.
(C) Check the PATH system variable:
System -> Advanced system settings -> Environment Variables -> Path
The MinGW installation path must be present to use the installed
executables and files. For example:
echo %PATH%
C:\MinGW\bin;C:\MinGW\usr\bin...
(D) Working environment:
Use the <Install folder>\msys\<version>\msys.bat file to start a shell.
Download and extract the Titan source files and folders to a directory,
and create a Makefile.personal in the top directory. Please check the
installation guide and set all the needed variables like TTCN3_DIR. The
MinGW compilation needs a few extra changes in the Makefile.cfg also. Set
the PLATFORM and MINGW values:
PLATFORM := WIN32
MINGW := -DMINGW -mno-cygwin
(E) Compile Titan:
cd titan
make -j
make install
The compiled files will be placed into the ./Install directory.
(F) If the build process stops with a Windows error message saying that some files
are missing, search for the indicated Cygwin package and download it from the Cygwin page.
You can search fast and easily with the Cygwin Package Search tool:
https://cygwin.com/cgi-bin2/package-grep.cgi
Extract the downloaded package into the MinGW installation directory, and
restart the build process.
...@@ -142,6 +142,7 @@ MACRO_REFERENCE_INT \$"{"{WS}{TTCN3IDENTIFIER}{WS}(","{WS}integer{WS})?"}" ...@@ -142,6 +142,7 @@ MACRO_REFERENCE_INT \$"{"{WS}{TTCN3IDENTIFIER}{WS}(","{WS}integer{WS})?"}"
} }
"["{WS}LOGGING{WS}"]" BEGIN(INITIAL); "["{WS}LOGGING{WS}"]" BEGIN(INITIAL);
"["{WS}PROFILER{WS}"]" BEGIN(INITIAL);
"["{WS}EXECUTE{WS}"]" BEGIN(INITIAL); "["{WS}EXECUTE{WS}"]" BEGIN(INITIAL);
"["{WS}EXTERNAL_COMMANDS{WS}"]" BEGIN(INITIAL); "["{WS}EXTERNAL_COMMANDS{WS}"]" BEGIN(INITIAL);
"["{WS}GROUPS{WS}"]" BEGIN(INITIAL); "["{WS}GROUPS{WS}"]" BEGIN(INITIAL);
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
/* Version numbers */ /* Version numbers */
#define TTCN3_MAJOR 5 #define TTCN3_MAJOR 5
#define TTCN3_MINOR 1 #define TTCN3_MINOR 2
#define TTCN3_PATCHLEVEL 0 #define TTCN3_PATCHLEVEL 0
//#define TTCN3_BUILDNUMBER 0 //#define TTCN3_BUILDNUMBER 0
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* TTCN3_VERSION = TTCN3_MAJOR * 1000000 + TTCN3_MINOR * 10000 + * TTCN3_VERSION = TTCN3_MAJOR * 1000000 + TTCN3_MINOR * 10000 +
* TTCN3_PATCHLEVEL * 100 + TTCN3_BUILDNUMBER * TTCN3_PATCHLEVEL * 100 + TTCN3_BUILDNUMBER
*/ */
#define TTCN3_VERSION 50100 #define TTCN3_VERSION 50200
/* A monotonically increasing version number. /* A monotonically increasing version number.
* An official release is deemed to have the highest possible build number (99) * An official release is deemed to have the highest possible build number (99)
......
...@@ -263,17 +263,10 @@ namespace Common { ...@@ -263,17 +263,10 @@ namespace Common {
return versions; return versions;
} }
void Modules::add_types_to_json_schema(JSON_Tokenizer& json) void Modules::generate_json_schema(JSON_Tokenizer& json, map<Type*, JSON_Tokenizer>& json_refs)
{ {
for(size_t i = 0; i < mods_v.size(); ++i) { for(size_t i = 0; i < mods_v.size(); ++i) {
mods_v[i]->add_types_to_json_schema(json); mods_v[i]->generate_json_schema(json, json_refs);
}
}
void Modules::add_func_to_json_schema(map<Type*, JSON_Tokenizer>& json_refs)
{
for(size_t i = 0; i < mods_v.size(); ++i) {
mods_v[i]->add_func_to_json_schema(json_refs);
} }
} }
...@@ -807,6 +800,12 @@ namespace Common { ...@@ -807,6 +800,12 @@ namespace Common {
mputprintf(effective_module_functions, "%s\"%s\"", mputprintf(effective_module_functions, "%s\"%s\"",
(effective_module_functions ? ", " : ""), get_modid().get_dispname().c_str()); (effective_module_functions ? ", " : ""), get_modid().get_dispname().c_str());
} }
if (profiler_enabled && MOD_TTCN == get_moduletype()) {
output->source.static_function_bodies = mputprintf(output->source.static_function_bodies,
"TTCN3_Stack_Depth stack_depth;\n"
"ttcn3_prof.enter_function(\"%s\", 0, \"%s\");\n",
get_filename(), get_modid().get_dispname().c_str());
}
} }
output->source.static_function_bodies = output->source.static_function_bodies =
mputstr(output->source.static_function_bodies, output->functions.pre_init); mputstr(output->source.static_function_bodies, output->functions.pre_init);
...@@ -844,6 +843,12 @@ namespace Common { ...@@ -844,6 +843,12 @@ namespace Common {
mputprintf(effective_module_functions, "%s\"%s\"", mputprintf(effective_module_functions, "%s\"%s\"",
(effective_module_functions ? ", " : ""), get_modid().get_dispname().c_str()); (effective_module_functions ? ", " : ""), get_modid().get_dispname().c_str());
} }
if (profiler_enabled && MOD_TTCN == get_moduletype()) {
output->source.static_function_bodies = mputprintf(output->source.static_function_bodies,
"TTCN3_Stack_Depth stack_depth;\n"
"ttcn3_prof.enter_function(\"%s\", 0, \"%s\");\n",
get_filename(), get_modid().get_dispname().c_str());
}
} }
output->source.static_function_bodies = output->source.static_function_bodies =
mputstr(output->source.static_function_bodies, output->functions.post_init); mputstr(output->source.static_function_bodies, output->functions.post_init);
......
...@@ -116,14 +116,15 @@ namespace Common { ...@@ -116,14 +116,15 @@ namespace Common {
void generate_code(CodeGenHelper& cgh); void generate_code(CodeGenHelper& cgh);
void dump(unsigned level=1) const; void dump(unsigned level=1) const;
/** Generates JSON schema segments for the types defined in the modules /** Generates JSON schema segments for the types defined in the modules,
* and adds them to the JSON schema parameter. */ * and references to these types. Information related to the types'
void add_types_to_json_schema(JSON_Tokenizer& json); * JSON encoding and decoding functions is also inserted after the references.
*
/** Generates JSON schemas containing references to the types defined in the * @param json JSON document containing the main schema, schema segments for
* modules. Information related to the types' JSON encoding and decoding * the types will be inserted here
* functions is also inserted after the references. */ * @param json_refs map of JSON documents containing the references and function
void add_func_to_json_schema(map<Type*, JSON_Tokenizer>& json_refs); * info related to each type */
void generate_json_schema(JSON_Tokenizer& json, map<Type*, JSON_Tokenizer>& json_refs);
}; };
/** /**
...@@ -391,15 +392,15 @@ namespace Common { ...@@ -391,15 +392,15 @@ namespace Common {
void generate_code(CodeGenHelper& cgh); void generate_code(CodeGenHelper& cgh);
virtual void dump(unsigned level) const; virtual void dump(unsigned level) const;
/** Generates JSON schema segments for the types defined in the module /** Generates JSON schema segments for the types defined in the modules,
* and adds them to the JSON schema parameter. */ * and references to these types. Information related to the types'
virtual void add_types_to_json_schema(JSON_Tokenizer&) = 0; * JSON encoding and decoding functions is also inserted after the references.
*
/** Generates JSON schemas containing references to the types that have JSON * @param json JSON document containing the main schema, schema segments for
* encoding and/or decoding functions declared in the module. Information * the types will be inserted here
* related to these functions is also inserted after the references * @param json_refs map of JSON documents containing the references and function
* (only for TTCN-3 modules). */ * info related to each type */
virtual void add_func_to_json_schema(map<Type*, JSON_Tokenizer>&) = 0; virtual void generate_json_schema(JSON_Tokenizer& json, map<Type*, JSON_Tokenizer>& json_refs) = 0;
}; };
/** /**
......
...@@ -298,7 +298,7 @@ namespace Common { ...@@ -298,7 +298,7 @@ namespace Common {
if (++error_count >= max_errors) { if (++error_count >= max_errors) {
fputs("Maximum number of errors reached, aborting.\n", stderr); fputs("Maximum number of errors reached, aborting.\n", stderr);
fflush(stderr); fflush(stderr);
abort(); exit(EXIT_FAILURE);
} }
} }
......
...@@ -68,7 +68,7 @@ main.cc Real.cc Setting.cc SigParam.cc string.cc subtype.cc Stopwatch.cc \ ...@@ -68,7 +68,7 @@ main.cc Real.cc Setting.cc SigParam.cc string.cc subtype.cc Stopwatch.cc \
Type.cc Type_chk.cc Type_codegen.cc TypeCompat.cc \ Type.cc Type_chk.cc Type_codegen.cc TypeCompat.cc \
Typestuff.cc ustring.cc Value.cc Valuestuff.cc XerAttributes.cc subtypestuff.cc CodeGenHelper.cc Typestuff.cc ustring.cc Value.cc Valuestuff.cc XerAttributes.cc subtypestuff.cc CodeGenHelper.cc
MFGEN_SOURCES := makefile.c xpather.cc MFGEN_SOURCES := makefile.c xpather.cc ProjectGenHelper.cc
TCOV2LCOV_SOURCES := tcov2lcov.cc TCOV2LCOV_SOURCES := tcov2lcov.cc
......
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2000-2014 Ericsson Telecom AB
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// which accompanies this distribution, and is available at
// http://www.eclipse.org/legal/epl-v10.html
///////////////////////////////////////////////////////////////////////////////
#ifndef _LIB_GEN_HELPER_HH
#define _LIB_GEN_HELPER_HH
#include <string>
#include <map>
#include <vector>
#include <cstdio>
class ProjectGenHelper;
class ProjectDescriptor {
public:
explicit ProjectDescriptor(const char* name);
~ProjectDescriptor() { cleanUp(); };
const std::string& getProjectName() const { return projectName; }
void setTPDFileName( const char* name);
const std::string& getTPDFileName() const { return tpdFileName; }
void setTargetExecName(const char* name) { targetExecutableName = std::string(name); }
const std::string& getTargetExecName() const { return targetExecutableName; }
void setProjectAbsTpdDir(const char* name) { projectAbsTpdDir = std::string(name); }
const std::string& getProjectAbsTpdDir() const { return projectAbsTpdDir; }
void setProjectAbsWorkingDir(const char* name);
void setProjectWorkingDir(const char* name) { projectWorkingDir = std::string(name); }
const std::string& getProjectAbsWorkingDir() const { return projectAbsWorkingDir; }
const std::string& getProjectWorkingDir() const { return projectWorkingDir; }
void setLinkingStrategy(bool strategy) { dynamicLinked = strategy; }
bool getLinkingStrategy() const { return dynamicLinked; }
void setLibrary(bool isLib) { library = isLib; }
bool isLibrary() const { return library; }
bool isInitialized();
void addToReferencedProjects(const char* refProjName);
void addToRefProjWorkingDirs(const std::string& subProjDir);
bool hasLinkerLibTo(const std::string& refProjName) const;
bool hasLinkerLib(const char* libName) const; // Linker Lib got from TPD
void addToLibSearchPaths(const char* libSearchPath);
void addToLinkerLibs(const char* linkerLibs);
void print();
void cleanUp();
size_t numOfReferencedProjects() const { return referencedProjects.size(); };