Browse Source

Added initial testing infrastructure for MvC

Yentl Van Tendeloo 8 years ago
parent
commit
0c2221334f
2 changed files with 33 additions and 4 deletions
  1. 32 0
      integration/test_mvc.py
  2. 1 4
      integration/utils.py

+ 32 - 0
integration/test_mvc.py

@@ -0,0 +1,32 @@
+import unittest
+
+from utils import run_file, get_constructor, get_model_constructor
+
+all_files = [   "core/mini_modify.alc",
+                "core/core_formalism.mvc",
+                "core/core_algorithm.alc",
+                "primitives.alc",
+                "object_operations.alc",
+                "conformance_scd.alc",
+                "library.alc",
+                "ftg.alc",
+                "transform.alc",
+                "model_management.alc",
+                "ramify.alc",
+                "metamodels.alc",
+                "random.alc",
+                "constructors.alc",
+                "modelling.alc",
+                "compilation_manager.alc",
+            ]
+
+class TestModelverseCore(unittest.TestCase):
+    def test_po_init_admin(self):
+        self.init_admin("PO")
+
+    def init_admin(self, mode):
+        self.assertTrue(run_file(all_files,
+            [ "root",
+            ],
+            None,
+            mode))

+ 1 - 4
integration/utils.py

@@ -129,11 +129,9 @@ def run_file(files, parameters, expected, mode):
         for mod_filename in to_compile:
             if mod_filename.endswith(".mvc"):
                 model_mode = "MO"
+                mod_files.remove(mod_filename)
             else:
                 model_mode = mode
-            print("COMPILE " + mod_filename)
-            print(" as " + model_mode)
-            mod_files.remove(mod_filename)
             if parallel_push:
                 import threading
                 threads.append(threading.Thread(target=compile_file, args=[address, mod_filename, mod_filename, model_mode, proc]))
@@ -147,7 +145,6 @@ def run_file(files, parameters, expected, mode):
 
         if mode[-1] == "O":
             # Fire up the linker
-            print("Linking " + mod_files)
             val = execute("link_and_load", [address, username] + mod_files, wait=True)
             if val != 0:
                 raise Exception("Linking error")