Commit a45c5fe9 authored by balaskoa's avatar balaskoa
Browse files

target files have been added to regression test of cfg file parsers (no JUnit tests yet)


Signed-off-by: default avatarbalaskoa <jeno.balasko@ericsson.com>
parent 5ed9de87
##############################################################################
# Copyright (c) 2000-2016 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
#
# Contributors:
# Balasko, Jeno
# Beres, Szabolcs
#
##############################################################################
TOPDIR := ../../
include $(TOPDIR)/Makefile.regression
unexport ABS_SRC
unexport SRCDIR
DIRS := macro_reference structured
# List of fake targets:
.PHONY: all dep clean run $(DIRS) $(addsuffix /, $(DIRS)) profile
all run dep clean distclean:
for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit; done
# To run just one test, type "make dir" or "make "dir/"
$(DIRS) $(addsuffix /, $(DIRS)):
$(MAKE) -C $@ run
# To run all tests, possibly in parallel
runall: $(DIRS)
###############################################################################
# Copyright (c) 2000-2016 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
#
# Contributors:
# Balasko, Jeno
# Baranyi, Botond
# Beres, Szabolcs
#
###############################################################################
[LOGGING]
*.MatchingHints := Compact
# In this section you can specify the name of the log file and the classes of events
# you want to log into the file or display on console (standard error).
LogFile := "logs/%e.%h-%r.%s"
FileMask :=WARNING|VERDICTOP|USER|TESTCASE|STATISTICS|PORTEVENT|ERROR| ACTION| MATCHING| STATISTICS
ConsoleMask :=VERDICTOP|USER| FUNCTION| ACTION|ERROR | WARNING | TESTCASE | STATISTICS
LogSourceInfo := Yes
AppendFile := No
TimeStampFormat := DateTime
LogEventTypes := No
SourceInfoFormat := Stack
LogEntityName := Yes
[TESTPORT_PARAMETERS]
# In this section you can specify parameters that are passed to Test Ports.
[INCLUDE]
# To use configuration settings given in other configuration files,
# the configuration files just need to be listed in this section, with their full or relative pathnames.
[EXECUTE]
TSTM_macro_test_testcases.control
[DEFINE]
//These commented lines are part of the test, do not remove them!!!
# In this section you can create macro definitions,
# that can be used in other configuration file sections except [INCLUDE].
// In this section you can create macro definitions,
// that can be used in other configuration file sections except [INCLUDE].
/*
In this section you can create macro definitions,
that can be used in other configuration file sections except [INCLUDE].
*/
#Primary macros:
MACRO_1_0:=1
MACRO_1_1 := 1234567890
MACRO_1_2 :="1234567890"
MACRO_1_3:=subidubi1
MACRO_1_4 := "subidubi2"
MACRO_1_5:=123456789.abc-def_ghijklmnopqrstuvwxyz-F //F0::0A
MACRO_1_6:=00:01:02:03:04:05:06:07
MACRO_1_7:=0:1:2:3:4:5:6:7
MACRO_1_8:=0::ABBA
MACRO_1_9:=0::1
MACRO_1_10:=::
MACRO_1_11:=::: #Why is this accepted???
#Macros with one reference
MACRO_2_0:=$MACRO_1_0 //accepted but wrong, TR: not written yet
MACRO_2_1:=$MACRO_1_1
MACRO_2_2:=$MACRO_1_2
MACRO_2_3:=$MACRO_1_3
MACRO_2_4:=$MACRO_1_4
MACRO_2_5:=$MACRO_1_5
MACRO_2_6:=$MACRO_1_6
MACRO_2_7:=$MACRO_1_7
MACRO_2_8:=$MACRO_1_8
MACRO_2_9:=$MACRO_1_9
MACRO_2_10:=$MACRO_1_10
MACRO_2_11:=$MACRO_1_11
MACRO_3_0:=${MACRO_1_0}
MACRO_4_0:="${MACRO_1_0}"
MACRO_4_0x1:=${MACRO_1_0}${MACRO_1_1}
MACRO_4_0x0:=${MACRO_1_0}${MACRO_1_0}
MACRO_4_0x1x2:=${MACRO_1_0}${MACRO_1_1}${MACRO_1_2}
MACRO_4_0xSx1:=${MACRO_1_0}something${MACRO_1_1}
MACRO_4_Sx0x1x2:=something${MACRO_1_0}${MACRO_1_1}${MACRO_1_2}
MACRO_4_0xSx1x2:=${MACRO_1_0}something${MACRO_1_1}${MACRO_1_2}
MACRO_4_0xsx1x2:=${MACRO_1_0}"something"${MACRO_1_1}${MACRO_1_2}
MACRO_4_0x1xSx2:=${MACRO_1_0}${MACRO_1_1}something${MACRO_1_2}
MACRO_4_0xSx1xSx2:=${MACRO_1_0}something${MACRO_1_1}something${MACRO_1_2}
MACRO_4_0xSx1xSx2xS:=${MACRO_1_0}something${MACRO_1_1}something${MACRO_1_2}something
MACRO_4_Sx0xSx1xSx2xS:=something${MACRO_1_0}something${MACRO_1_1}something${MACRO_1_2}something
MACRO_4_sx0xSx1xSx2xS:="something."${MACRO_1_0}something${MACRO_1_1}something${MACRO_1_2}something
MACRO_4_horror1:= ${MACRO_4_Sx0xSx1xSx2xS}${MACRO_4_Sx0xSx1xSx2xS}
MACRO_4_0x0x0x0x0x0x0x0:=${MACRO_1_0}${MACRO_1_0}${MACRO_1_0}${MACRO_1_0}${MACRO_1_0}${MACRO_1_0}${MACRO_1_0}${MACRO_1_0}
MACRO_4_comment1:=${MACRO_1_0}${MACRO_1_0}
MACRO_4_comment2:=${MACRO_1_0}"how can You
handle
this?"${MACRO_1_0}
# repetition is not allowed:
#MACRO_4_0:="${MACRO_1_0}"
#MACRO_2_1:=$MACRO_1_1
#strange lines
d = 1 e = 2 f = 3${e}${d} i := $d"00"$e"00"$f
#f=321
#i=100200321
o=ABBA
o1=ABBA$e${f}
#duplicates
val := 123
val := -8
ES_TEE_AR := cool
ES_TEE_AR := "not "$ES_TEE_AR", man"
[MODULE_PARAMETERS]
# This section shall contain the values of all parameters that are defined in your TTCN-3 modules.
tsp_old_1_0:=$MACRO_1_0
tsp_old_1_1:=$MACRO_1_1
tsp_old_1_2:=$MACRO_1_2
tsp_old_1_3:=$MACRO_1_3
tsp_old_1_4:=$MACRO_1_4
tsp_old_1_5:=$MACRO_1_5
tsp_old_1_6:=$MACRO_1_6
tsp_old_1_7:=$MACRO_1_7
tsp_old_1_8:=$MACRO_1_8
tsp_old_1_9:=$MACRO_1_9
tsp_old_1_10:=$MACRO_1_10
/* not accepted yet: */
tsp_new_2_0 :=$MACRO_2_0
tsp_new_2_1 :=$MACRO_2_1
tsp_new_2_2 :=$MACRO_2_2
tsp_new_2_3 :=$MACRO_2_3
tsp_new_2_4 :=$MACRO_2_4
tsp_new_2_5 :=$MACRO_2_5
tsp_new_2_6 :=$MACRO_2_6
tsp_new_2_7 :=$MACRO_2_7
tsp_new_2_8 :=$MACRO_2_8
tsp_new_2_9 :=$MACRO_2_9
tsp_new_2_10:=$MACRO_2_10
tsp_new_2_11:=$MACRO_2_11
tsp_new_3_0 :=$MACRO_3_0
tsp_new_4_0 :=$MACRO_4_0
tsp_new_4_0x1 :=$MACRO_4_0x1
tsp_new_4_0x0 :=$MACRO_4_0x0
tsp_new_4_0x1x2 :=$MACRO_4_0x1x2
tsp_new_4_0xSx1 :=$MACRO_4_0xSx1
tsp_new_4_Sx0x1x2:=$MACRO_4_Sx0x1x2
tsp_new_4_0xSx1x2:=$MACRO_4_0xSx1x2
tsp_new_4_0xsx1x2:=$MACRO_4_0xsx1x2
tsp_new_4_0x1xSx2:=$MACRO_4_0x1xSx2
tsp_new_4_0xSx1xSx2:=$MACRO_4_0xSx1xSx2
tsp_new_4_0xSx1xSx2xS:=$MACRO_4_0xSx1xSx2xS
tsp_new_4_Sx0xSx1xSx2xS:=$MACRO_4_Sx0xSx1xSx2xS
tsp_new_4_sx0xSx1xSx2xS:=$MACRO_4_sx0xSx1xSx2xS
tsp_new_4_horror1:=$MACRO_4_horror1
tsp_new_4_0x0x0x0x0x0x0x0:=$MACRO_4_0x0x0x0x0x0x0x0
tsp_new_4_comment1:=$MACRO_4_comment1
tsp_new_4_comment2:=$MACRO_4_comment2
tsp_d:=$d
tsp_e:=${e}
tsp_f:=${ f}
tsp_i:=${i }
tsp_o=${o,octetstring}
tsp_d1:=${d,charstring}
tsp_e1:=${e,integer}
tsp_f1=$f
tsp_i1=${i,charstring}
tsp_o1=${o1,octetstring}
mp_int := ${val,integer}
mp_str := $ES_TEE_AR
/******************************************************************************
* Copyright (c) 2000-2016 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
*
* Contributors:
* Balasko, Jeno
* Baranyi, Botond
* Beres, Szabolcs
*
******************************************************************************/
//Version:0.1
//Date: 2012-10-18
//Description: Positive test cases for macros in section [DEFINE]
module TSTM_macro_test_testcases{
//import from dummy all;
modulepar {
charstring tsp_old_1_0:="0";
charstring tsp_old_1_1:="0";
charstring tsp_old_1_2:="0";
charstring tsp_old_1_3:="0";
charstring tsp_old_1_4:="0";
charstring tsp_old_1_5:="0";
charstring tsp_old_1_6:="0";
charstring tsp_old_1_7:="0";
charstring tsp_old_1_8:="0";
charstring tsp_old_1_9:="0";
charstring tsp_old_1_10:="0";
charstring tsp_old_1_11:="0";
//charstring tsp_1_2:="3";
charstring tsp_new_2_0:="0";
charstring tsp_new_2_1:="0";
charstring tsp_new_2_2:="0";
charstring tsp_new_2_3:="0";
charstring tsp_new_2_4:="0";
charstring tsp_new_2_5:="0";
charstring tsp_new_2_6:="0";
charstring tsp_new_2_7:="0";
charstring tsp_new_2_8:="0";
charstring tsp_new_2_9:="0";
charstring tsp_new_2_10:="0";
charstring tsp_new_2_11:="0"
charstring tsp_new_3_0:="0";
charstring tsp_new_4_0:="0";
charstring tsp_new_4_0x1:="0";
charstring tsp_new_4_0x0:="0";
charstring tsp_new_4_0x1x2:="0";
charstring tsp_new_4_0xSx1:="0";
charstring tsp_new_4_Sx0x1x2:="0";
charstring tsp_new_4_0xSx1x2:="0";
charstring tsp_new_4_0xsx1x2:="0";
charstring tsp_new_4_0x1xSx2:="0";
charstring tsp_new_4_0xSx1xSx2:="0";
charstring tsp_new_4_0xSx1xSx2xS:="0";
charstring tsp_new_4_Sx0xSx1xSx2xS:="0";
charstring tsp_new_4_sx0xSx1xSx2xS:="0";
charstring tsp_new_4_horror1:="0";
charstring tsp_new_4_0x0x0x0x0x0x0x0:="0";
charstring tsp_new_4_comment1:="0";
charstring tsp_new_4_comment2:="0";
charstring tsp_d := "0"
charstring tsp_e :=""
charstring tsp_f:="";
charstring tsp_i:=""
octetstring tsp_o:=''O;
charstring tsp_d1 := "0"
integer tsp_e1 :=-1;
charstring tsp_f1:="";
charstring tsp_i1:=""
octetstring tsp_o1:=''O;
integer mp_int := 0;
charstring mp_str := "cool";
}
type component MyComp_CT{}
//=========================================================================
// Testcases
//=========================================================================
testcase tc_old_0() runs on MyComp_CT {
if(match(tsp_old_1_0, "1") ) {setverdict(pass)} else {setverdict(fail,tsp_old_1_0)};
}
testcase tc_old_1() runs on MyComp_CT {
if(match(tsp_old_1_1, "1234567890") ) {setverdict(pass)} else {setverdict(fail, tsp_old_1_1)};
}
testcase tc_old_2() runs on MyComp_CT {
if(match(tsp_old_1_2, "1234567890") ) {setverdict(pass)} else {setverdict(fail,tsp_old_1_2)};
}
testcase tc_old_3() runs on MyComp_CT {
if(match(tsp_old_1_3, "subidubi1") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_old_4() runs on MyComp_CT {
if(match(tsp_old_1_4, "subidubi2") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_old_5() runs on MyComp_CT {
if(match(tsp_old_1_5, "123456789.abc-def_ghijklmnopqrstuvwxyz-F") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_old_6() runs on MyComp_CT {
if(match(tsp_old_1_6, "00:01:02:03:04:05:06:07") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_old_7() runs on MyComp_CT {
if(match(tsp_old_1_7, "0:1:2:3:4:5:6:7") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_old_8() runs on MyComp_CT {
if(match(tsp_old_1_8, "0::ABBA") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_old_9() runs on MyComp_CT {
if(match(tsp_old_1_9, "0::1") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_old_10() runs on MyComp_CT {
if(match(tsp_old_1_10, "::") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_old_11() runs on MyComp_CT {
if(match(tsp_old_1_11, ":::") ) {setverdict(pass)} else {setverdict(fail)};
}
//================ NEW ===================
//TODO: Modify the expected value for a real one
testcase tc_new_2_0() runs on MyComp_CT {
if(match(tsp_new_2_0, "1") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_2_1() runs on MyComp_CT {
if(match(tsp_new_2_1, "1234567890") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_2_2() runs on MyComp_CT {
if(match(tsp_new_2_2, "1234567890") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_2_3() runs on MyComp_CT {
if(match(tsp_new_2_3, "subidubi1") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_2_4() runs on MyComp_CT {
if(match(tsp_new_2_4, "subidubi2") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_2_5() runs on MyComp_CT {
if(match(tsp_new_2_5, "123456789.abc-def_ghijklmnopqrstuvwxyz-F") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_2_6() runs on MyComp_CT {
if(match(tsp_new_2_6, "00:01:02:03:04:05:06:07") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_2_7() runs on MyComp_CT {
if(match(tsp_new_2_7, "0:1:2:3:4:5:6:7") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_2_8() runs on MyComp_CT {
if(match(tsp_new_2_8, "0::ABBA") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_2_9() runs on MyComp_CT {
if(match(tsp_new_2_9, "0::1") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_2_10() runs on MyComp_CT {
if(match(tsp_new_2_10, "::") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_2_11() runs on MyComp_CT {
if(match(tsp_new_2_11, ":::") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_3_0() runs on MyComp_CT {
if(match(tsp_new_3_0, "1") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_4_0() runs on MyComp_CT {
if(match(tsp_new_4_0, "${MACRO_1_0}") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_4_0x1() runs on MyComp_CT {
if(match(tsp_new_4_0x1, "11234567890") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_4_0x0() runs on MyComp_CT {
if(match(tsp_new_4_0x0, "11") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_4_0x1x2() runs on MyComp_CT {
if(match( tsp_new_4_0x1x2, "112345678901234567890") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_4_0xSx1() runs on MyComp_CT {
if(match( tsp_new_4_0xSx1, "1something1234567890") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_4_Sx0x1x2() runs on MyComp_CT {
if(match( tsp_new_4_Sx0x1x2, "something112345678901234567890") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_4_0xSx1x2() runs on MyComp_CT {
if(match( tsp_new_4_0xSx1x2, "1something12345678901234567890") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_4_0xsx1x2() runs on MyComp_CT {
if(match( tsp_new_4_0xsx1x2, "1something12345678901234567890") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_4_0x1xSx2() runs on MyComp_CT {
if(match( tsp_new_4_0x1xSx2, "11234567890something1234567890") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_4_0xSx1xSx2() runs on MyComp_CT {
if(match( tsp_new_4_0xSx1xSx2, "1something1234567890something1234567890") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_4_0xSx1xSx2xS() runs on MyComp_CT {
if(match( tsp_new_4_0xSx1xSx2xS, "1something1234567890something1234567890something") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_4_Sx0xSx1xSx2xS() runs on MyComp_CT {
if(match( tsp_new_4_Sx0xSx1xSx2xS, "something1something1234567890something1234567890something") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_4_sx0xSx1xSx2xS() runs on MyComp_CT {
if(match( tsp_new_4_sx0xSx1xSx2xS, "something.1something1234567890something1234567890something") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_4_horror1 () runs on MyComp_CT {
if(match( tsp_new_4_horror1, "something1something1234567890something1234567890somethingsomething1something1234567890something1234567890something") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_4_0x0x0x0x0x0x0x0() runs on MyComp_CT {
if(match( tsp_new_4_0x0x0x0x0x0x0x0, "11111111") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_4_comment1() runs on MyComp_CT {
if(match( tsp_new_4_comment1, "11") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_new_4_comment2() runs on MyComp_CT {
if(match( tsp_new_4_comment2, "1how can You\nhandle\nthis?1") ) {setverdict(pass)} else {setverdict(fail)};
}
testcase tc_defio() runs on MyComp_CT {
if(tsp_d=="1") { setverdict(pass) } else {setverdict(fail,"tsp_d=",tsp_d)}
if(tsp_e=="2") { setverdict(pass) } else {setverdict(fail,"tsp_e=",tsp_e)}
if(tsp_f=="321") { setverdict(pass) } else {setverdict(fail,"tsp_f=",tsp_f)}
if(tsp_i=="100200321") { setverdict(pass) } else {setverdict(fail,"tsp_i=",tsp_i)}
if(tsp_o=='ABBA'O) { setverdict(pass) } else {setverdict(fail,"tsp_o=",tsp_o)}
}
testcase tc_defio1() runs on MyComp_CT {
if(tsp_d1=="1") { setverdict(pass) } else {setverdict(fail,"tsp_d=",tsp_d)}
if(tsp_e1==2) { setverdict(pass) } else {setverdict(fail,"tsp_e=",tsp_e)}
if(tsp_f1=="321") { setverdict(pass) } else {setverdict(fail,"tsp_f=",tsp_f)}
if(tsp_i1=="100200321") { setverdict(pass) } else {setverdict(fail,"tsp_i=",tsp_i)}
if(tsp_o1=='ABBA2321'O) { setverdict(pass) } else {setverdict(fail,"tsp_o1=",tsp_o1)}
}
// Duplicate defines
testcase tc_duplicate() runs on MyComp_CT {
if (mp_int == -8) { setverdict(pass) } else { setverdict(fail, "mp_int=", mp_int) }
if (mp_str == "not cool, man") { setverdict(pass) } else { setverdict(fail, "mp_str=", mp_str) }
}
control{
execute(tc_old_0());
execute(tc_old_1());
execute(tc_old_2());
execute(tc_old_3());
execute(tc_old_4());
execute(tc_old_5());
execute(tc_old_6());
execute(tc_old_7());
execute(tc_old_8());
execute(tc_old_9());
execute(tc_old_10());
execute(tc_new_2_0());
execute(tc_new_2_1());
execute(tc_new_2_2());
execute(tc_new_2_3());
execute(tc_new_2_4());
execute(tc_new_2_5());
execute(tc_new_2_6());
execute(tc_new_2_7());
execute(tc_new_2_8());
execute(tc_new_2_9());
execute(tc_new_2_10());
execute(tc_new_2_11());
execute(tc_new_3_0());
execute(tc_new_4_0());
execute(tc_new_4_0x1());
execute(tc_new_4_0x0());
execute(tc_new_4_0x0());
execute(tc_new_4_0x1x2());
execute(tc_new_4_0xSx1());
execute(tc_new_4_Sx0x1x2());
execute(tc_new_4_0xSx1x2());
execute(tc_new_4_0xsx1x2());
execute(tc_new_4_0x1xSx2());
execute(tc_new_4_0xSx1xSx2());
execute(tc_new_4_0xSx1xSx2xS());
execute(tc_new_4_Sx0xSx1xSx2xS ());
execute(tc_new_4_sx0xSx1xSx2xS ());
execute(tc_new_4_horror1());
execute(tc_new_4_0x0x0x0x0x0x0x0());
execute(tc_new_4_comment1());
execute(tc_new_4_comment2());
execute(tc_defio());
execute(tc_defio1());
execute(tc_duplicate());
}
} // end of module
###############################################################################
# Copyright (c) 2000-2016 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
#
# Contributors:
# Balasko, Jeno
# Beres, Szabolcs
#
###############################################################################
[DEFINE]
# _f means "faulty"
#DEF_1_f1 := \"asdf\" //faulty
#DEF_1_f2 := ""asdf"" //faulty