From d4482ab3e5a018125891c7706a5bb573cdc8ecb9 Mon Sep 17 00:00:00 2001
From: balaskoa <jeno.balasko@ericsson.com>
Date: Wed, 29 Mar 2017 16:21:52 +0200
Subject: [PATCH] Hello World refinement - restricted for 2 passed TCs + make
 clean added

Signed-off-by: balaskoa <jeno.balasko@ericsson.com>
---
 hello/Makefile       |  1 +
 hello/MyExample.cfg  |  2 +-
 hello/MyExample.ttcn | 87 ++++++++++++++++++++++----------------------
 hello/MyExample2.cfg | 26 +++++++++++++
 4 files changed, 71 insertions(+), 45 deletions(-)
 create mode 100755 hello/MyExample2.cfg

diff --git a/hello/Makefile b/hello/Makefile
index e1d2cb339..e9e0fe9fa 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 305b38a61..82859974d 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 b00387878..b048284cd 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 000000000..ca44f07a9
--- /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
-- 
GitLab