Browse Source

Removed unused tests

Casper Thule 3 years ago
parent
commit
e928740146

BIN
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.cg.cpp.tests/input/single_folder_spec/window/Window.fmu


+ 0 - 30
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.cg.cpp.tests/input/single_folder_spec/window/modelDescription.xml

@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<fmiModelDescription fmiVersion="2.0" modelName="SingleWatertank" guid="{cfc65592-9ece-4563-9705-1581b6e7071c}" generationTool="20-sim" numberOfEventIndicators="0" copyright="Controllab Products B.V." license="-">
-<CoSimulation modelIdentifier="SingleWatertank" needsExecutionTool="false" canHandleVariableCommunicationStepSize="true" canInterpolateInputs="false" maxOutputDerivativeOrder="0" canRunAsynchronuously="false" canBeInstantiatedOnlyOncePerProcess="true" canNotUseMemoryManagementFunctions="true" canGetAndSetFMUstate="false" canSerializeFMUstate="false" providesDirectionalDerivative="false" />
-
-<ModelVariables>
-<ScalarVariable name="reaction_force" valueReference="1" variability="continuous" causality="input">
-<Real start="0.0" />
-</ScalarVariable>
-<ScalarVariable name="displacement" valueReference="2" variability="continuous" causality="input">
-<Real start="0.0" />
-</ScalarVariable>
-<ScalarVariable name="speed" valueReference="3" variability="continuous" causality="input">
-<Real start="0.0" />
-</ScalarVariable>
-
-<ScalarVariable name="disp" valueReference="4" variability="continuous" causality="output">
-<Real />
-</ScalarVariable>
-<ScalarVariable name="tau" valueReference="5" variability="continuous" causality="output">
-<Real />
-</ScalarVariable>
-
-</ModelVariables>
-<ModelStructure>
-<Outputs>
-<Unknown index="4" />
-<Unknown index="5" />
-</Outputs>
-</ModelStructure>
-</fmiModelDescription>

+ 0 - 84
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.cg.cpp.tests/input/single_folder_spec/window/window_sa_canonical.BASE.sa

@@ -1,84 +0,0 @@
-module Window_SA
-
-semantic adaptation reactive mealy WindowSA windowSA
-at "./path/to/WindowSA.fmu"
-
-	for inner fmu Window window
-		at "input/single_folder_spec/window/Window.fmu"
-		with input ports displacement (rad), speed (rad/s), reaction_force (N)
-		with output ports height (m), reaction_torque (N.m)
-
-/*
-In the original version, no input ports where declared, so all dangling inputs of the original fmus are bound to the input ports of the adapted FMU.
-In the canonical version, the input and output ports are all declared explicitly, and their bindings are implemented in the in/out rules.
-*/
-
-input ports 	reaction_force,
-				displacement,
-				speed
-
-	output ports	disp,
-					tau
-
-
-control rules {
-	do_step(window, t, H); // includes update_in rules and update_out (update-in rules do not update state)
-	return H;
-}
-
-in var 	stored_windowsa_reaction_force := 0.0, 
-		stored_windowsa_displacement := 0.0, 
-		stored_windowsa_speed := 0.0;
-
-in rules {
-	/*
-	is_set checks whether the input value is given in the setValues call of the adapted FMU.
-	Notice that in the canonical version, all ports are prefixed.
-	*/
-
-	true -> {
-		if (is_set(windowSA.reaction_force)){
-			stored_windowsa_reaction_force := windowSA.reaction_force;
-		}
-	} --> {
-			window.reaction_force := stored_windowsa_reaction_force;
-		};
-	
-	true -> {
-		if (is_set(windowSA.displacement)){
-				stored_windowsa_displacement := windowSA.displacement;			
-			}
-	} --> {
-		window.displacement := stored_windowsa_displacement; 
-		};
-	
-	
-	true -> {		
-		if (is_set(windowSA.speed)){
-			stored_windowsa_speed := windowSA.speed;
-		}
-	} --> {
-		
-		window.speed := stored_windowsa_speed;
-	};
-}
-
-out var stored_window_reaction_torque := 0.0,
-		stored_window_height := 0.0;
-		
-out rules {
-
-	true -> {
-		stored_window_reaction_torque := window.reaction_torque;
-	} --> {
-		windowSA.tau := - stored_window_reaction_torque;
-	};
-	
-	true -> {
-		stored_window_height := window.height;
-	} --> {
-		windowSA.disp := stored_window_height * 100;
-	};
-
-}
-

+ 0 - 93
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.cg.cpp.tests/src/be/uantwerpen/ansymo/semanticadaptation/cg/cpp/tests/CgCppBasicTest2.xtend

@@ -1,93 +0,0 @@
-/*
- * generated by Xtext 2.10.0
- */
-package be.uantwerpen.ansymo.semanticadaptation.cg.cpp.tests
-
-import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.SemanticAdaptation
-import be.uantwerpen.ansymo.semanticadaptation.tests.AbstractSemanticAdaptationTest
-import be.uantwerpen.ansymo.semanticadaptation.tests.SemanticAdaptationInjectorProvider
-import com.google.inject.Inject
-import java.util.regex.Pattern
-import org.eclipse.emf.ecore.EObject
-import org.eclipse.xtext.testing.InjectWith
-import org.eclipse.xtext.testing.XtextRunner
-import org.eclipse.xtext.testing.util.ParseHelper
-import org.eclipse.xtext.testing.validation.ValidationTestHelper
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.eclipse.xtext.generator.InMemoryFileSystemAccess
-import org.eclipse.xtext.generator.IGeneratorContext
-import org.eclipse.emf.ecore.resource.ResourceSet
-import org.junit.Ignore
-import be.uantwerpen.ansymo.semanticadaptation.cg.cpp.generation.CppGenerator
-
-@RunWith(XtextRunner)
-@InjectWith(SemanticAdaptationInjectorProvider)
-class CgCppBasicTest2 extends AbstractSemanticAdaptationTest {
-
-	// @Inject CppGenerator underTest
-	@Inject extension ParseHelper<SemanticAdaptation>
-	@Inject extension  ValidationTestHelper
-
-	@Ignore
-	@Test def powerwindow_model_only() { __parseNoErrors('input/window/window_sa_canonical.BASE.sa') }
-
-	def __parseNoErrors(String filename) {
-		val model = __parse(filename)
-		__assertNoParseErrors(model, filename)
-
-		val fsa = new InMemoryFileSystemAccess()
-		val IGeneratorContext ctxt = null;
-		new CppGenerator().doGenerate(model.eResource, fsa, ctxt)
-
-		System.out.println(fsa.allFiles)
-	}
-
-	def __parseNoErrorsPrint(String filename) {
-		val root = __parse(filename)
-		print_ast(root)
-		__assertNoParseErrors(root, filename)
-	}
-
-	def __parse(String filename) {
-		val model = readFile(filename).parse
-		return model;
-	}
-
-	def __parse(String filename, ResourceSet resourceSetToUse) {
-
-		return readFile(filename).parse(resourceSetToUse)
-	}
-
-	def __assertNoParseErrors(EObject root, String filename) {
-		try {
-			root.assertNoErrors
-		} catch (AssertionError e) {
-			val p = Pattern.compile(".*, offset (?<offset>[0-9]+), length (?<length>[0-9]+)")
-			val code = readFile(filename)
-			for (String line : e.message.split("\n")) {
-				val m = p.matcher(line)
-				m.matches()
-				val count = __occurrencesInString(code.subSequence(0, Integer.valueOf(m.group("offset"))).toString(),
-					"\n")
-				print(filename + " at line " + (count + 1) + ": ")
-				println(line)
-			}
-			throw e
-		}
-	}
-
-	def __occurrencesInString(String str, String findstr) {
-		var lastIndex = 0
-		var count = 0
-		while (lastIndex != -1) {
-			lastIndex = str.indexOf(findstr, lastIndex)
-			if (lastIndex != -1) {
-				count++
-				lastIndex += findstr.length()
-			}
-		}
-		return count
-	}
-
-}

+ 0 - 93
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.cg.cpp.tests/src/be/uantwerpen/ansymo/semanticadaptation/cg/cpp/tests/CgCppBasicTestKel.xtend

@@ -1,93 +0,0 @@
-/*
- * generated by Xtext 2.10.0
- */
-package be.uantwerpen.ansymo.semanticadaptation.cg.cpp.tests
-
-import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.SemanticAdaptation
-import be.uantwerpen.ansymo.semanticadaptation.tests.AbstractSemanticAdaptationTest
-import be.uantwerpen.ansymo.semanticadaptation.tests.SemanticAdaptationInjectorProvider
-import com.google.inject.Inject
-import java.util.regex.Pattern
-import org.eclipse.emf.ecore.EObject
-import org.eclipse.xtext.testing.InjectWith
-import org.eclipse.xtext.testing.XtextRunner
-import org.eclipse.xtext.testing.util.ParseHelper
-import org.eclipse.xtext.testing.validation.ValidationTestHelper
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.eclipse.xtext.generator.InMemoryFileSystemAccess
-import org.eclipse.xtext.generator.IGeneratorContext
-import org.eclipse.emf.ecore.resource.ResourceSet
-import org.junit.Ignore
-import be.uantwerpen.ansymo.semanticadaptation.cg.cpp.generation.CppGenerator
-
-@RunWith(XtextRunner)
-@InjectWith(SemanticAdaptationInjectorProvider)
-class CgCppBasicTestKel extends AbstractSemanticAdaptationTest {
-
-	// @Inject CppGenerator underTest
-	@Inject extension ParseHelper<SemanticAdaptation>
-	@Inject extension  ValidationTestHelper
-
-	@Ignore
-	@Test def powerwindow_model_only() { __parseNoErrors('test_input/single_folder_spec/windowKEL/window_sa_canonical.BASE.sa') }
-
-	def __parseNoErrors(String filename) {
-		val model = __parse(filename)
-		__assertNoParseErrors(model, filename)
-
-		val fsa = new InMemoryFileSystemAccess()
-		val IGeneratorContext ctxt = null;
-		new CppGenerator().doGenerate(model.eResource, fsa, ctxt);
-		
-		
-		System.out.println(fsa.allFiles)		
-	}
-
-	def __parseNoErrorsPrint(String filename) {
-		val root = __parse(filename)
-		print_ast(root)
-		__assertNoParseErrors(root, filename)
-	}
-
-	def __parse(String filename) {
-		return readFile(filename).parse
-	}
-
-	def __parse(String filename, ResourceSet resourceSetToUse) {
-
-		return readFile(filename).parse(resourceSetToUse)
-	}
-
-	def __assertNoParseErrors(EObject root, String filename) {
-		try {
-			root.assertNoErrors
-		} catch (AssertionError e) {
-			val p = Pattern.compile(".*, offset (?<offset>[0-9]+), length (?<length>[0-9]+)")
-			val code = readFile(filename)
-			for (String line : e.message.split("\n")) {
-				val m = p.matcher(line)
-				m.matches()
-				val count = __occurrencesInString(code.subSequence(0, Integer.valueOf(m.group("offset"))).toString(),
-					"\n")
-				print(filename + " at line " + (count + 1) + ": ")
-				println(line)
-			}
-			throw e
-		}
-	}
-
-	def __occurrencesInString(String str, String findstr) {
-		var lastIndex = 0
-		var count = 0
-		while (lastIndex != -1) {
-			lastIndex = str.indexOf(findstr, lastIndex)
-			if (lastIndex != -1) {
-				count++
-				lastIndex += findstr.length()
-			}
-		}
-		return count
-	}
-
-}

+ 0 - 112
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.cg.cpp.tests/src/be/uantwerpen/ansymo/semanticadaptation/cg/cpp/tests/CgCppModuleTest.xtend

@@ -1,112 +0,0 @@
-/*
- * generated by Xtext 2.10.0
- */
-package be.uantwerpen.ansymo.semanticadaptation.cg.cpp.tests
-
-import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.SemanticAdaptation
-import be.uantwerpen.ansymo.semanticadaptation.tests.AbstractSemanticAdaptationTest
-import be.uantwerpen.ansymo.semanticadaptation.tests.SemanticAdaptationInjectorProvider
-import com.google.inject.Inject
-import java.io.File
-import java.util.regex.Pattern
-import org.eclipse.emf.ecore.EObject
-import org.eclipse.emf.ecore.resource.ResourceSet
-import org.eclipse.xtext.generator.IGeneratorContext
-import org.eclipse.xtext.generator.InMemoryFileSystemAccess
-import org.eclipse.xtext.testing.InjectWith
-import org.eclipse.xtext.testing.XtextRunner
-import org.eclipse.xtext.testing.util.ParseHelper
-import org.eclipse.xtext.testing.validation.ValidationTestHelper
-import org.junit.Test
-import org.junit.runner.RunWith
-
-import static org.junit.Assert.assertTrue
-import org.junit.Ignore
-import be.uantwerpen.ansymo.semanticadaptation.cg.cpp.generation.CppGenerator
-
-@RunWith(XtextRunner)
-@InjectWith(SemanticAdaptationInjectorProvider)
-class CgCppModuleTest extends AbstractSemanticAdaptationTest {
-
-	// @Inject CppGenerator underTest
-	@Inject extension ParseHelper<SemanticAdaptation>
-	@Inject extension  ValidationTestHelper
-
-	@Ignore
-	@Test def powerwindow_model_only() { __parseNoErrors('input/single_folder_spec/window/window_sa_canonical.BASE.sa') }
-
-	def __parseNoErrors(String filename) {
-
-		val file = new File(filename)
-
-		assertTrue("File not found: " + filename, file.exists);
-		
-		var SemanticAdaptation model = null;
-		if (file.isDirectory) {
-			for (f : file.listFiles) {
-				if (model === null) {
-					model = __parse(f.absolutePath)
-				} else {
-					model = __parse(f.absolutePath, model.eResource.resourceSet)
-				}
-				__assertNoParseErrors(model, f.absolutePath)
-			}
-		} else {
-			model = __parse(filename)
-			__assertNoParseErrors(model, filename)
-		}
-
-		val fsa = new InMemoryFileSystemAccess()
-		val IGeneratorContext ctxt = null;
-		new CppGenerator().doGenerate(model.eResource, fsa, ctxt)
-
-		System.out.println(fsa.allFiles)
-	}
-
-	def __parseNoErrorsPrint(String filename) {
-		val root = __parse(filename)
-		print_ast(root)
-		__assertNoParseErrors(root, filename)
-	}
-
-	def __parse(String filename) {
-		return readFile(filename).parse
-	}
-
-	def __parse(String filename, ResourceSet resourceSetToUse) {
-
-		return readFile(filename).parse(resourceSetToUse)
-	}
-
-	def __assertNoParseErrors(EObject root, String filename) {
-		try {
-			root.assertNoErrors
-		} catch (AssertionError e) {
-			val p = Pattern.compile(".*, offset (?<offset>[0-9]+), length (?<length>[0-9]+)")
-			val code = readFile(filename)
-			for (String line : e.message.split("\n")) {
-				val m = p.matcher(line)
-				m.matches()
-				val count = __occurrencesInString(code.subSequence(0, Integer.valueOf(m.group("offset"))).toString(),
-					"\n")
-				print(filename + " at line " + (count + 1) + ": ")
-				println(line)
-			}
-			throw e
-		}
-	}
-
-	def __occurrencesInString(String str, String findstr) {
-		var lastIndex = 0
-		var count = 0
-		while (lastIndex != -1) {
-			lastIndex = str.indexOf(findstr, lastIndex)
-			if (lastIndex != -1) {
-				count++
-				lastIndex += findstr.length()
-			}
-		}
-		return count
-	}
-
-}