Commit f2dacd2e authored by Elemer Lelik's avatar Elemer Lelik

Initial contribution

parent e0fa3b58

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.
###############################################################################
# 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
###############################################################################
#README file for the innersourced Titan Eclipse plugins project
1. VERSION REQUIREMENTS
Java 1.6 or higher, recommended: 1.7
ANTLR UI 4.1.3 with ANTLR 2.7.6 or 2.7.7
Ant 1.9.2 or higher
NOTE: Build will not work below 1.8 for sure!
Eclipse Standard or Java 3.6 (Helios) or higher, recommended 4.4 (Luna)
----------------------
2. SETTING UP ECLIPSE FOR TITAN DEVELOPMENT
2.1. Installing Eclipse plug-ins:
Eclipse -> Help -> Install New Software...
Contact all update sites during install to find required software -> ALWAYS SWITCH OFF (it can cause problems)
ANTLR
http://antlreclipse.sourceforge.net/updates/
Titan plug-ins
from the Titan update site
TODO: add URL
Set the new JDK in Window -> Preferences -> Java -> Installed JREs
Window->Preferences->TITAN Preferences:
TITAN installation path: <git repository>/titan/Install
License file (optional, only if license checking is switched on): /home/<user id>/license_<license id>.dat
2.2. Importing Titan plug-in projects to Eclipse
Add "Git Repository Exploring" perspective
Add an existing local Git repository
Choose titan and titan_eclipse, finish
titan_eclipse: right click -> import projects... -> next -> finish
2.3. Other recommended settings
Project property (right click, properties) -> TITAN Project Property -> Internal makefile creation attributes (middle tab) ->
Include source line info in C++ code (-l) -> switch on
Add source line info for logging (-L) -> switch on
Add TITAN Editing perspective
Add TITAN Executing perspective
windows/customize perspective/commands groups availability -> "Launch" switch on
----------------------
3. SWITCHING ON TITAN LICENSE CHECKING AND USAGE STATISTICS SENDING
By default Titan license checking and usage statistics sending are switched off. You can switch them on by running the following script:
<git repository>/titan_eclipse/license.sh
It modifies the source, you need to rebuild org.eclipse.titan.common plug-in project.
----------------------
4. BUILDING AND INSTALLING TITAN PLUG-INS FROM COMMAND LINE WITH ANT
4.1. BUILDING TITAN PLUG-INS FROM COMMAND LINE WITH ANT
cd <git repository>/titan_eclipse/automatic_build
ant -f build_main.xml -lib <antlr plugin path>/antlr.jar <target>
antlr.jar is installed in this directory: <eclipse_dir>/plugins/org.antlr_2.7....
target can be one of the following:
common.plugin
designer.plugin
executor.plugin
help.plugin
logviewer.plugin
debug.plugin
regressiontests.plugin
titanium.plugin
titanium.regressiontests.plugin
Make sure, that the following environment variables are set to a valid directory/file:
JAVA_HOME
ECLIPSE_HOME
compiler.location: this is the titan project directory: <git repository>/titan
java6: a java6 executable
updatesite.experimental.location: output directory for experimental update site (optional)
updatesites.tmp.location: temporary output directory for experimental update site (optional)
zip.dir: output directory for zip package that contains all the plug-ins (optional)
These variables can be set by editing <git repository>/titan_eclipse/automatic_build/build_config.xml
and also in the command, here is a working example:
ant -f build_main.xml \
-lib $HOME/eclipse/plugins/org.antlr_2.7.6.20140628-1000/antlr.jar \
-DJAVA_HOME=$HOME/jdk/ \
-DECLIPSE_HOME=$HOME/eclipse/ \
-Dcompiler.location=$HOME/git/titan/ \
-Djava6=$HOME/jdk/bin/java \
designer.plugin
4.2. INSTALLING PLUG-INS TO ECLIPSE
The plug-in jars are created in result/plugins/ directory.
Copy these *.jar files to $ECLIPSE_HOME/plugins/ directory.
----------------------
5. BUILDING PLUG-INS WITH ONLY ANTLR 4 DEPENDENCIES
cd automatic_build
./setv4.sh
This script sets the project to use only ANTLR 4 dependent parsers, and removes source files with unnecessary dependencies
After this step plug-ins can be built and installed as it is described in chapter 4.
<?xml version="1.0" encoding="UTF-8"?>
<TITAN_Designer_Properties>
<ActiveConfiguration>Default</ActiveConfiguration>
<ProjectProperties>
<MakefileSettings>
<generateMakefile>false</generateMakefile>
<generateInternalMakefile>true</generateInternalMakefile>
<symboliclinklessBuild>true</symboliclinklessBuild>
<targetExecutable>bin\Regression_test_project.exe</targetExecutable>
</MakefileSettings>
<LocalBuildSettings>
<MakefileScript/>
<workingDirectory>bin</workingDirectory>
</LocalBuildSettings>
</ProjectProperties>
</TITAN_Designer_Properties>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Regression_test_project</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.titan.designer.core.TITANBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.titan.designer.core.TITANNature</nature>
<nature>org.eclipse.titan.log.viewer.TitanLogProject</nature>
</natures>
</projectDescription>
###############################################################################
# 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
###############################################################################
[LOGGING]
LogFile := "MyExample.log"
FileMask := LOG_ALL
ConsoleMask := ERROR | TESTCASE | STATISTICS
[EXECUTE]
MyExample.control
/******************************************************************************
* 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
******************************************************************************/
// TTCN-3 version of "Hello, world!"
module MyExample
{
type port PCOType message
{
inout charstring;
}
type component MTCType
{
port PCOType MyPCO_PT;
}
testcase tc_HelloW() runs on MTCType system MTCType
{
map(mtc:MyPCO_PT, system:MyPCO_PT);
MyPCO_PT.send("Hello, world!");
setverdict(pass);
}
testcase tc_HelloW2() runs on MTCType system MTCType
{
timer TL_T := 15.0;
map(mtc:MyPCO_PT, system:MyPCO_PT);
MyPCO_PT.send("Hello, world!");
TL_T.start;
alt {
[] MyPCO_PT.receive("Hello, TTCN-3!") { TL_T.stop; setverdict(pass); }
[] TL_T.timeout { setverdict(inconc); }
[] MyPCO_PT.receive { TL_T.stop; setverdict(fail); }
}
}
control
{
execute(tc_HelloW());
execute(tc_HelloW2());
}
}
///////////////////////////////////////////////////////////////////////////////
// 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
///////////////////////////////////////////////////////////////////////////////
// This Test Port skeleton source file was generated by the
// TTCN-3 Compiler of the TTCN-3 Test Executor version 1.5.pl7
// for Janos Zoltan Szabo (ejnosza@balisea) on Mon Sep 13 09:35:21 2004
// You may modify this file. Complete the body of empty functions and
// add your member functions here.
#include <stdio.h>
#include "PCOType.hh"
#include "memory.h"
namespace MyExample {
PCOType::PCOType(const char *par_port_name)
: PCOType_BASE(par_port_name)
{
}
PCOType::~PCOType()
{
}
void PCOType::set_parameter(const char *parameter_name,
const char *parameter_value)
{
}
void PCOType::Event_Handler(const fd_set *read_fds,
const fd_set *write_fds, const fd_set *error_fds,
double time_since_last_call)
{
size_t buf_len = 0, buf_size = 32;
char *buf = (char*)Malloc(buf_size);
for ( ; ; ) {
int c = getc(stdin);
if (c == EOF) {
if (buf_len > 0) incoming_message(CHARSTRING(buf_len, buf));
Uninstall_Handler();
break;
} else if (c == '\n') {
incoming_message(CHARSTRING(buf_len, buf));
break;
} else {
if (buf_len >= buf_size) {
buf_size *= 2;
buf = (char*)Realloc(buf, buf_size);
}
buf[buf_len++] = c;
}
}
Free(buf);
}
void PCOType::user_map(const char *system_port)
{
fd_set readfds;
FD_ZERO(&readfds);
FD_SET(fileno(stdin), &readfds);
Install_Handler(&readfds, NULL, NULL, 0.0);
}
void PCOType::user_unmap(const char *system_port)
{
Uninstall_Handler();
}
void PCOType::user_start()
{
}
void PCOType::user_stop()
{
}
void PCOType::outgoing_send(const CHARSTRING& send_par)
{
puts((const char*)send_par);
fflush(stdout);
}
} /* end of namespace */
///////////////////////////////////////////////////////////////////////////////
// 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
///////////////////////////////////////////////////////////////////////////////
// This Test Port skeleton header file was generated by the
// TTCN-3 Compiler of the TTCN-3 Test Executor version 1.5.pl7
// for Janos Zoltan Szabo (ejnosza@balisea) on Mon Sep 13 09:35:21 2004
// You may modify this file. Add your attributes and prototypes of your
// member functions here.
#ifndef PCOType_HH
#define PCOType_HH
#include "MyExample.hh"
namespace MyExample {
class PCOType : public PCOType_BASE {
public:
PCOType(const char *par_port_name = NULL);
~PCOType();
void set_parameter(const char *parameter_name,
const char *parameter_value);
void Event_Handler(const fd_set *read_fds,
const fd_set *write_fds, const fd_set *error_fds,
double time_since_last_call);
protected:
void user_map(const char *system_port);
void user_unmap(const char *system_port);
void user_start();
void user_stop();
void outgoing_send(const CHARSTRING& send_par);
};
} /* end of namespace */
#endif
/******************************************************************************
* 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
******************************************************************************/
module altsteps
{
import from types all;
// Unhandled cases: p1_PT: boolean, pl_2: integer
altstep as_1(test_port pl_2) runs on c1_CT
{
[] p1_PT.receive(t1:?) {}
[] pl_2.receive(t2:*) {}
}
// No unhandled cases
// pl_2: integer, pl_2: boolean are not unhandled cases (pl_2 is completely ignored)
altstep as_2(test_port pl_2) runs on c1_CT
{
[] p1_PT.receive(t1:*) {}
[] p1_PT.receive(t2:*) {}
}
// No unhandled cases
altstep as_3(test_port pl_2) runs on c1_CT
{
[] p1_PT.receive(t1:*) {}
[] p1_PT.receive(t2:*) {}
[] pl_2.receive(t1:*) {}
[] pl_2.receive(t2:*) {}
}
}
\ No newline at end of file
/******************************************************************************
* 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
******************************************************************************/
module import_cycle {
import from import_jin all;
}
\ No newline at end of file
/******************************************************************************
* 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
******************************************************************************/
module import_jang {
import from import_jin all;
}
\ No newline at end of file
/******************************************************************************
* 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
******************************************************************************/
module import_jin {
import from import_jang all;
import from import_jin all;
}
\ No newline at end of file
/******************************************************************************
* 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
******************************************************************************/
module block {
control
{
// no empty statement block
while (true) {
var integer i := 0;
}
// empty statement block
if (true) {}
}
}
\ No newline at end of file
/******************************************************************************
* 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
******************************************************************************/
module say_no_to_goto {
control
{
label lab;
// Start running! Raptors are extremely fast.
goto lab;
}
}
\ No newline at end of file
/******************************************************************************
* 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
******************************************************************************/
module altguard {
import from types all;
altstep as_1(test_port pl_1, integer i) {
// might transform
[] pl_1.receive(t1:*) {
if (true) {}
}
// might transform
[i>3] pl_1.receive(t2:*) {
if (true) {}
}
// no marker here
[] any port.receive {
i := 32;
if (true) {}
alt {
// might transform
[] any port.receive {
if (true) {}
}
}
}
}
}
\ No newline at end of file
/******************************************************************************
* 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
******************************************************************************/
module receive_template {
import from types all;
altstep as_1(test_int_port pl_1) {
var integer rec, i;
[] pl_1.receive(1) -> value rec {
while (rec > 4) {
// no problem with this match
if (match(i, 43)) {}
}
}
[] pl_1.receive(*) -> value rec {
{
// uses the redirected value, a receive template would be better
if (match(rec, 43)) {}
}
}
}
}
\ No newline at end of file
/******************************************************************************
* 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
******************************************************************************/
module ifelse {
function f(boolean b) {
// fine, it has an else branch
if (b) {
// fine, this if is not a single statement in the block
if (b) {}
return;
} else {
// this if should have an else branch
if (b) {}
}
}
}
\ No newline at end of file
/******************************************************************************
* 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
******************************************************************************/
module shiftrotate {
type record of integer ROI;
type set of integer SOI;
function f() {
const bitstring cbs := '001101'B;
var bitstring bs;