Browse Source

some more tests working.

Claudio Gomes 5 years ago
parent
commit
dbaf22d064

+ 4 - 0
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.cg.cpp.tests/src/be/uantwerpen/ansymo/semanticadaptation/cg/cpp/tests/CgCppAutoTest.xtend

@@ -26,6 +26,7 @@ import org.junit.runners.Parameterized
 import org.junit.runners.Parameterized.Parameters
 import org.junit.Ignore
 import be.uantwerpen.ansymo.semanticadaptation.cg.cpp.generation.CppGenerator
+import org.junit.Assert
 
 @RunWith(typeof(Parameterized))
 @InjectWith(SemanticAdaptationInjectorProvider)
@@ -87,6 +88,8 @@ class CgCppAutoTest extends AbstractSemanticAdaptationTest {
 		files.remove(0);
 		val tailFiles = files;
 		val model = __parse(hdFile, tailFiles)
+		
+		println("Checking for errors in file " + hdFile.absolutePath)
 		__assertNoParseErrors(model, hdFile)
 
 		val fsa = new InMemoryFileSystemAccess()
@@ -117,6 +120,7 @@ class CgCppAutoTest extends AbstractSemanticAdaptationTest {
 
 	def __assertNoParseErrors(EObject root, File file) {
 		try {
+			Assert.assertNotNull(root)
 			root.assertNoErrors
 		} catch (AssertionError e) {
 			val p = Pattern.compile(".*, offset (?<offset>[0-9]+), length (?<length>[0-9]+)")

+ 15 - 15
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.cg.cpp.tests/src/be/uantwerpen/ansymo/semanticadaptation/cg/cpp/tests/CgCppBasicTest.xtend

@@ -62,36 +62,36 @@ class CgCppBasicTest extends AbstractSemanticAdaptationTest {
 		__parseAndGenerateWithNoErrors('window_sa_canonical_new.BASE.sa', 'test_input/single_folder_spec/window/', 'powerwindow');
 	}
 	
-	@Ignore @Test def getSetState_sa() {
-		__parseAndGenerateWithNoErrors('test_input/single_folder_spec/getsetstate/GetSetState.sa', 'generated', "getSetState");
+	@Test def getSetState_sa() {
+		__parseAndGenerateWithNoErrors('GetSetState.sa', 'test_input/single_folder_spec/getsetstate/', "getSetState");
 	}
 
-	@Ignore @Test def lazy_canonical() {
-		__parseAndGenerateWithNoErrors('test_input/single_folder_spec/lazy/lazy_canonical.sa', 'generated', "lazy");
+	@Test def lazy_canonical() {
+		__parseAndGenerateWithNoErrors('lazy_canonical.sa', 'test_input/single_folder_spec/lazy/', "lazy");
 	}
 
 	@Ignore @Test def loop() {
-		__parseAndGenerateWithNoErrors('test_input/single_folder_spec/loop/loop_canonical.sa', 'generated', "LoopSA");
+		__parseAndGenerateWithNoErrors('loop_canonical.sa', 'test_input/single_folder_spec/loop/', "LoopSA");
 	}
 
-	@Ignore @Test def rate() {
-		__parseAndGenerateWithNoErrors('test_input/single_folder_spec/rate/rate.sa', 'generated', "rate");
+	@Test def rate() {
+		__parseAndGenerateWithNoErrors('rate.sa', 'test_input/single_folder_spec/rate/', "rate");
 	}
 
-	@Ignore @Test def rate_canonical() {
-		__parseAndGenerateWithNoErrors('test_input/single_folder_spec/rate/rate_canonical.sa', 'generated', "rate_canonical");
+	@Test def rate_canonical() {
+		__parseAndGenerateWithNoErrors('rate_canonical.sa', 'test_input/single_folder_spec/rate/', "rate_canonical");
 	}
 
-	@Ignore @Test def power() {
-		__parseAndGenerateWithNoErrors('test_input/single_folder_spec/power/power.BASE.sa', 'generated', 'power');
+	@Test def power() {
+		__parseAndGenerateWithNoErrors('power.BASE.sa', 'test_input/single_folder_spec/power/', 'power');
 	}
 
-	@Ignore @Test def rollback_test() {
-		__parseAndGenerateWithNoErrors('test_input/single_folder_spec/rollback_test/rollback_test.sa', 'generated', 'rollback_test');
+	@Test def rollback_test() {
+		__parseAndGenerateWithNoErrors('rollback_test.sa', 'test_input/single_folder_spec/rollback_test/', 'rollback_test');
 	}
 
-	@Ignore @Test def controller_test() {
-		__parseAndGenerateWithNoErrors('test_input/single_folder_spec/controller/controller.sa', 'generated', 'controller');
+	@Test def controller_test() {
+		__parseAndGenerateWithNoErrors('controller.sa', 'test_input/single_folder_spec/controller/', 'controller');
 	}
 
 	def __parseNoErrorsWithValidation(String directory, String filename) {