diff --git a/hello/Makefile b/hello/Makefile index e1d2cb339a50b190d0adcc98f37a22da8b272617..e9e0fe9fac011c537d0d5ab1e4e49ffb769af29f 100644 --- a/hello/Makefile +++ b/hello/Makefile @@ -42,4 +42,5 @@ else $(MAKE) CXX='$(CXX)' CXXFLAGS='$(CXXFLAGS)' LDFLAGS='$(LDFLAGS)' && \ (sleep 5 && echo 'Hello, TTCN-3!') | ttcn3_start MyExample MyExample.cfg && \ logformat -o MyExample_merged.log *.log + cd $(DEMODIR) && make clean endif diff --git a/hello/MyExample.cfg b/hello/MyExample.cfg index 305b38a617de47532771db077b1ea837f6cb9e48..82859974dbcf803c30d1477a56733297a12e9d25 100644 --- a/hello/MyExample.cfg +++ b/hello/MyExample.cfg @@ -20,4 +20,4 @@ ConsoleMask := TTCN_ERROR | TTCN_TESTCASE | TTCN_STATISTICS [EXECUTE] MyExample.control -hello_world.control +#hello_world.control --see in MyExample2.cfg diff --git a/hello/MyExample.ttcn b/hello/MyExample.ttcn index b0038787844d50c342210f3223b78f4fcfe485af..b048284cdfad4b658988bb119b148d17ab004175 100644 --- a/hello/MyExample.ttcn +++ b/hello/MyExample.ttcn @@ -1,53 +1,52 @@ /****************************************************************************** - * Copyright (c) 2000-2017 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 - * Lovassy, Arpad - * Szabo, Janos Zoltan – initial implementation - * - ******************************************************************************/ +* Copyright (c) 2000-2017 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 +* Lovassy, Arpad +* Szabo, Janos Zoltan – initial implementation +* +******************************************************************************/ // TTCN-3 version of "Hello, world!" module MyExample { - type port PCOType message - { - inout charstring; - } +type port PCOType message +{ + inout charstring; +} - type component MTCType - { - port PCOType MyPCO; - } +type component MTCType +{ + port PCOType MyPCO; +} - testcase HelloW() runs on MTCType system MTCType - { - map(mtc:MyPCO, system:MyPCO); - MyPCO.send("Hello, world!"); - setverdict(pass); - } +testcase HelloW() runs on MTCType system MTCType +{ + map(mtc:MyPCO, system:MyPCO); + MyPCO.send("Hello, world!"); + setverdict(pass); +} - testcase HelloW2() runs on MTCType system MTCType - { - timer T := 1.0; - map(mtc:MyPCO, system:MyPCO); - MyPCO.send("Hello, world!"); - T.start; - alt { - [] MyPCO.receive("Hello, TTCN-3!") { T.stop; setverdict(pass); } - [] T.timeout { setverdict(inconc); } - [] MyPCO.receive { T.stop; setverdict(fail); } - } - } +testcase HelloW2() runs on MTCType system MTCType +{ + timer T := 1.0; + map(mtc:MyPCO, system:MyPCO); + MyPCO.send("Hello, world!"); + T.start; + alt { + [] MyPCO.receive("Hello, TTCN-3!") { T.stop; setverdict(pass); } + [] T.timeout { setverdict(pass); } + [] MyPCO.receive { T.stop; setverdict(fail); } + } +} - control - { - execute(HelloW()); - execute(HelloW2()); - //1 pass, 1 inconc expected - } +control +{ + execute(HelloW()); + execute(HelloW2()); +} } diff --git a/hello/MyExample2.cfg b/hello/MyExample2.cfg new file mode 100755 index 0000000000000000000000000000000000000000..ca44f07a9858aae80370796395156d211464e811 --- /dev/null +++ b/hello/MyExample2.cfg @@ -0,0 +1,26 @@ +############################################################################### +# Copyright (c) 2000-2017 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 +# Delic, Adam +# Lovassy, Arpad +# Szabo, Bence Janos +# Szabo, Janos Zoltan – initial implementation +# +############################################################################### +[LOGGING] +LogFile := "MyExample-%n-%r.log" +FileMask := LOG_ALL +ConsoleMask := TTCN_ERROR | TTCN_TESTCASE | TTCN_STATISTICS + +[EXECUTE] +#Not all testcases run to pass! +#Expected result: +#This is just a demo +MyExample.control +hello_world.control