Explorar o código

Added tests for singleton code YAKHMI-393

jos.itemis@gmail.com %!s(int64=14) %!d(string=hai) anos
pai
achega
c630c33c51
Modificáronse 2 ficheiros con 218 adicións e 9 borrados
  1. 26 2
      TestScenarios/CMakeLists.txt
  2. 192 7
      TestScenarios/GenModelC.sgen

+ 26 - 2
TestScenarios/CMakeLists.txt

@@ -2,10 +2,33 @@ cmake_minimum_required(VERSION 2.8)
 
 enable_testing()
 
-if(CMAKE_COMPILER_IS_GNUCC)
+if (CMAKE_COMPILER_IS_GNUCC)
 add_definitions( -Wall -O0 -g)
-endif(CMAKE_COMPILER_IS_GNUCC)
+endif (CMAKE_COMPILER_IS_GNUCC)
 
+if (COMPILE_SINGLETON)
+
+message ("Compiling Singleton code")
+add_subdirectory(src-gen-c-sgltn/InterfaceTest)
+add_subdirectory(src-gen-c-sgltn/Test_Expression)
+add_subdirectory(src-gen-c-sgltn/Test_Hierarchy)
+add_subdirectory(src-gen-c-sgltn/Test_ParallelRegions)
+add_subdirectory(src-gen-c-sgltn/Test_Transition)
+add_subdirectory(src-gen-c-sgltn/Test_ShallowHistory)
+add_subdirectory(src-gen-c-sgltn/Test_LocalActions)
+
+
+add_subdirectory(test-c-sgltn/InterfaceTest)
+add_subdirectory(test-c-sgltn/Test_Expression)
+add_subdirectory(test-c-sgltn/Test_Hierarchy)
+add_subdirectory(test-c-sgltn/Test_ParallelRegions)
+add_subdirectory(test-c-sgltn/Test_Transition)
+add_subdirectory(test-c-sgltn/Test_ShallowHistory)
+add_subdirectory(test-c-sgltn/Test_LocalActions)
+
+else (COMPILE_SINGLETON)
+
+message ("Compiling Multi-Instance code")
 add_subdirectory(src-gen-c/InterfaceTest)
 add_subdirectory(src-gen-c/Test_Expression)
 add_subdirectory(src-gen-c/Test_Hierarchy)
@@ -23,3 +46,4 @@ add_subdirectory(test-c/Test_Transition)
 add_subdirectory(test-c/Test_ShallowHistory)
 add_subdirectory(test-c/Test_LocalActions)
 
+endif (COMPILE_SINGLETON)

+ 192 - 7
TestScenarios/GenModelC.sgen

@@ -9,7 +9,7 @@ GeneratorModel for yakindu::c {
 		}
 		feature CCodeFeature {
 			InterfaceEventListener = true
-			Singleton = true
+			Singleton = false
 		}
 		feature licenseHeader {
 			licenseText = "
@@ -31,7 +31,7 @@ GeneratorModel for yakindu::c {
 		}
 		feature CCodeFeature {
 			InterfaceEventListener = true
-			Singleton = true
+			Singleton = false
 		}
 		feature licenseHeader {
 			licenseText = "
@@ -54,7 +54,7 @@ GeneratorModel for yakindu::c {
 		}
 		feature CCodeFeature {
 			InterfaceEventListener = true
-			Singleton = true
+			Singleton = false
 		}
 		feature licenseHeader {
 			licenseText = "
@@ -77,7 +77,7 @@ GeneratorModel for yakindu::c {
 		}
 		feature CCodeFeature {
 			InterfaceEventListener = true
-			Singleton = true
+			Singleton = false
 		}
 		feature licenseHeader {
 			licenseText = "
@@ -102,7 +102,7 @@ GeneratorModel for yakindu::c {
 		}
 		feature CCodeFeature {
 			InterfaceEventListener = true
-			Singleton = true
+			Singleton = false
 		}
 		feature licenseHeader {
 			licenseText = "
@@ -124,7 +124,7 @@ GeneratorModel for yakindu::c {
 		}
 		feature CCodeFeature {
 			InterfaceEventListener = true
-			Singleton = true
+			Singleton = false
 		}
 		feature licenseHeader {
 			licenseText = "
@@ -146,7 +146,7 @@ GeneratorModel for yakindu::c {
 		}
 		feature CCodeFeature {
 			InterfaceEventListener = true
-			Singleton = true
+			Singleton = false
 		}
 		feature licenseHeader {
 			licenseText = "
@@ -166,6 +166,191 @@ GeneratorModel for yakindu::c {
 			targetProject = "TestScenarios"
 			targetFolder = "src-gen-c/Test_Transition"
 		}
+		feature CCodeFeature {
+			InterfaceEventListener = true
+			Singleton = false
+		}
+		feature licenseHeader {
+			licenseText = "
+ # Copyright (c) 2011 committers of YAKINDU and others.
+ # 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:
+ #     committers of YAKINDU - initial API and implementation
+ "
+		}
+	}
+
+
+
+
+
+
+
+	statechart InterfaceTest {
+		feature	Outlet {
+			targetProject = "TestScenarios"
+			targetFolder = "src-gen-c-sgltn/InterfaceTest"
+		}
+		feature CCodeFeature {
+			InterfaceEventListener = true
+			Singleton = true
+		}
+		feature licenseHeader {
+			licenseText = "
+ # Copyright (c) 2011 committers of YAKINDU and others.
+ # 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:
+ #     committers of YAKINDU - initial API and implementation
+ "
+		}
+	}
+	statechart Test_DeepHistory {
+		feature Outlet {
+			targetProject = "TestScenarios"
+			targetFolder = "src-gen-c-sgltn/Test_DeepHistory"
+		}
+		feature CCodeFeature {
+			InterfaceEventListener = true
+			Singleton = true
+		}
+		feature licenseHeader {
+			licenseText = "
+ # Copyright (c) 2011 committers of YAKINDU and others.
+ # 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:
+ #     committers of YAKINDU - initial API and implementation
+ "
+		}
+		
+	}
+	statechart Test_Expression {
+		feature Outlet {
+			targetProject = "TestScenarios"
+			targetFolder = "src-gen-c-sgltn/Test_Expression"
+		}
+		feature CCodeFeature {
+			InterfaceEventListener = true
+			Singleton = true
+		}
+		feature licenseHeader {
+			licenseText = "
+ # Copyright (c) 2011 committers of YAKINDU and others.
+ # 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:
+ #     committers of YAKINDU - initial API and implementation
+ "
+		}
+
+	}
+	statechart Test_Hierarchy {
+		feature Outlet {
+			targetProject = "TestScenarios"
+			targetFolder = "src-gen-c-sgltn/Test_Hierarchy"
+		}
+		feature CCodeFeature {
+			InterfaceEventListener = true
+			Singleton = true
+		}
+		feature licenseHeader {
+			licenseText = "
+ # Copyright (c) 2011 committers of YAKINDU and others.
+ # 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:
+ #     committers of YAKINDU - initial API and implementation
+ "
+		}
+	}
+	statechart Test_LocalActions {
+		feature Outlet {
+			targetProject = "TestScenarios"
+			targetFolder = "src-gen-c-sgltn/Test_LocalActions"
+		}
+		feature CCodeFeature {
+			InterfaceEventListener = true
+			Singleton = true
+		}
+		feature licenseHeader {
+			licenseText = "
+ # Copyright (c) 2011 committers of YAKINDU and others.
+ # 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:
+ #     committers of YAKINDU - initial API and implementation
+ "
+		}
+	}
+	statechart Test_ParallelRegions {
+		feature Outlet {
+			targetProject = "TestScenarios"
+			targetFolder = "src-gen-c-sgltn/Test_ParallelRegions"
+		}
+		feature CCodeFeature {
+			InterfaceEventListener = true
+			Singleton = true
+		}
+		feature licenseHeader {
+			licenseText = "
+ # Copyright (c) 2011 committers of YAKINDU and others.
+ # 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:
+ #     committers of YAKINDU - initial API and implementation
+ "
+		}
+	}
+	statechart Test_ShallowHistory {
+		feature Outlet {
+			targetProject = "TestScenarios"
+			targetFolder = "src-gen-c-sgltn/Test_ShallowHistory"
+		}
+		feature CCodeFeature {
+			InterfaceEventListener = true
+			Singleton = true
+		}
+		feature licenseHeader {
+			licenseText = "
+ # Copyright (c) 2011 committers of YAKINDU and others.
+ # 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:
+ #     committers of YAKINDU - initial API and implementation
+ "
+		}
+	}
+	statechart Test_Transition {
+		feature Outlet {
+			targetProject = "TestScenarios"
+			targetFolder = "src-gen-c-sgltn/Test_Transition"
+		}
 		feature CCodeFeature {
 			InterfaceEventListener = true
 			Singleton = true