view rathaxes_use_single_file_language_tests.patch @ 95:4e7107e284de

Check that direct assignment works too in the pointer to Rathaxes type regression test
author Louis Opter <louis@lse.epita.fr>
date Mon, 22 Oct 2012 02:02:22 +0200
parents c908de343118
children
line wrap: on
line source

# HG changeset patch
# Parent e3555104b356bbaf4ebed282f74f75323bf7eabf
rathaxes: convert the test about pointers to Rathaxes types to a single file

And move it to a more generic "language" directory under tests.

diff --git a/rathaxes/compiler/tests/CMakeLists.txt b/rathaxes/compiler/tests/CMakeLists.txt
--- a/rathaxes/compiler/tests/CMakeLists.txt
+++ b/rathaxes/compiler/tests/CMakeLists.txt
@@ -44,4 +44,4 @@
 # Tests for the typing system (should not do anymore than parsing/checking typing)
 ADD_SUBDIRECTORY(typing)
 
-ADD_SUBDIRECTORY(pointer_to_rathaxes_type)
+ADD_SUBDIRECTORY(language)
diff --git a/rathaxes/compiler/tests/pointer_to_rathaxes_type/CMakeLists.txt b/rathaxes/compiler/tests/language/CMakeLists.txt
rename from rathaxes/compiler/tests/pointer_to_rathaxes_type/CMakeLists.txt
rename to rathaxes/compiler/tests/language/CMakeLists.txt
--- a/rathaxes/compiler/tests/pointer_to_rathaxes_type/CMakeLists.txt
+++ b/rathaxes/compiler/tests/language/CMakeLists.txt
@@ -1,3 +1,1 @@
-ADD_RATHAXES_SOURCES(test_pointer_to_rathaxes_type pointer_to_rathaxes_type.rtx
-                     RTI pointer_to_rathaxes_type.rti
-                     BLT pointer_to_rathaxes_type.blt)
+ADD_RATHAXES_SOURCES(test_pointer_to_rathaxes_type pointer_to_rathaxes_type.rtx)
diff --git a/rathaxes/compiler/tests/pointer_to_rathaxes_type/pointer_to_rathaxes_type.rtx b/rathaxes/compiler/tests/language/pointer_to_rathaxes_type.rtx
rename from rathaxes/compiler/tests/pointer_to_rathaxes_type/pointer_to_rathaxes_type.rtx
rename to rathaxes/compiler/tests/language/pointer_to_rathaxes_type.rtx
--- a/rathaxes/compiler/tests/pointer_to_rathaxes_type/pointer_to_rathaxes_type.rtx
+++ b/rathaxes/compiler/tests/language/pointer_to_rathaxes_type.rtx
@@ -1,3 +1,58 @@
+/* Interfaces */
+
+interface Test
+{
+    provided pointcut   code();
+
+    provided type   Test
+    {
+        chunk   ::decl();
+    }
+
+    required sequence   entry_point(Test::Test)
+    {
+        provided chunk  code();
+    }
+}
+
+/* Templates */
+
+with Test
+{
+    ${pointcut Test::code()};
+
+    template type   Test::Test()
+    {
+        chunk   ::decl()
+        {
+            int;
+        }
+
+        map
+        {
+        }
+    }
+
+    template sequence   Test::entry_point(Test::Test)
+    {
+        chunk   code()
+        {
+            int
+            main(void)
+            {
+                ${Test::Test} *p;
+                ${Test::Test} *assign = NULL;
+
+                ${pointcut ::IMPLEMENTATION(local.p)};
+
+                return 0;
+            }
+        }
+    }
+}
+
+/* Description */
+
 device Test use Test
 {
     Test::entry_point(Test::Test t)
diff --git a/rathaxes/compiler/tests/pointer_to_rathaxes_type/pointer_to_rathaxes_type.blt b/rathaxes/compiler/tests/pointer_to_rathaxes_type/pointer_to_rathaxes_type.blt
deleted file mode 100644
--- a/rathaxes/compiler/tests/pointer_to_rathaxes_type/pointer_to_rathaxes_type.blt
+++ /dev/null
@@ -1,33 +0,0 @@
-with Test
-{
-    ${pointcut Test::code()};
-
-    template type   Test::Test()
-    {
-        chunk   ::decl()
-        {
-            int;
-        }
-
-        map
-        {
-        }
-    }
-
-    template sequence   Test::entry_point(Test::Test)
-    {
-        chunk   code()
-        {
-            int
-            main(void)
-            {
-                ${Test::Test} *p;
-                ${Test::Test} *assign = NULL;
-
-                ${pointcut ::IMPLEMENTATION(local.p)};
-
-                return 0;
-            }
-        }
-    }
-}
diff --git a/rathaxes/compiler/tests/pointer_to_rathaxes_type/pointer_to_rathaxes_type.rti b/rathaxes/compiler/tests/pointer_to_rathaxes_type/pointer_to_rathaxes_type.rti
deleted file mode 100644
--- a/rathaxes/compiler/tests/pointer_to_rathaxes_type/pointer_to_rathaxes_type.rti
+++ /dev/null
@@ -1,14 +0,0 @@
-interface Test
-{
-    provided pointcut   code();
-
-    provided type   Test
-    {
-        chunk   ::decl();
-    }
-
-    required sequence   entry_point(Test::Test)
-    {
-        provided chunk  code();
-    }
-}