Browse Source

Remove all PO tests

Yentl Van Tendeloo 8 years ago
parent
commit
da277cd586

+ 2 - 9
integration/test_binary2decimal.py

@@ -3,14 +3,7 @@ import unittest
 from utils import run_file
 
 class TestBinary2Decimal(unittest.TestCase):
-    def test_po_binary2decimal(self):
-        self.binary2decimal("PO")
-
-    def test_co_binary2decimal(self):
-        self.binary2decimal("CO")
-
-    def binary2decimal(self, mode):
+    def test_binary2decimal(self):
         self.assertTrue(run_file(["binary_to_decimal.alc", "primitives.alc"],
             ["1", "10", "11", "100", "001", "1100111101"],
-            [1, 2, 3, 4, 1, 829],
-            mode))
+            [1, 2, 3, 4, 1, 829]))

+ 2 - 10
integration/test_factorial.py

@@ -2,16 +2,8 @@ import unittest
 
 from utils import run_file
 
-
 class TestFactorial(unittest.TestCase):
-    def test_po_factorial(self):
-        self.factorial("PO")
-
-    def test_co_factorial(self):
-        self.factorial("CO")
-
-    def factorial(self, mode):
+    def test_factorial(self):
         self.assertTrue(run_file(["factorial.alc", "primitives.alc"],
             [1, 2, 3, 4, 20],
-            [1, 2, 6, 24, 2432902008176640000],
-            mode))
+            [1, 2, 6, 24, 2432902008176640000]))

+ 2 - 9
integration/test_fibonacci.py

@@ -4,14 +4,7 @@ from utils import run_file
 
 
 class TestFibonacci(unittest.TestCase):
-    def test_po_fibonacci(self):
-        self.fibonacci("PO")
-
-    def test_co_fibonacci(self):
-        self.fibonacci("CO")
-
-    def fibonacci(self, mode):
+    def test_fibonacci(self):
         self.assertTrue(run_file(["fibonacci.alc", "primitives.alc"],
             [1, 2, 3, 4],
-            [1, 1, 2, 3],
-            mode))
+            [1, 1, 2, 3]))

+ 2 - 10
integration/test_fibonacci_smart.py

@@ -2,16 +2,8 @@ import unittest
 
 from utils import run_file
 
-
 class TestFibonacciSmart(unittest.TestCase):
-    def test_po_fibonacci_smart(self):
-        self.fibonacci_smart("PO")
-
-    def test_co_fibonacci_smart(self):
-        self.fibonacci_smart("CO")
-
-    def fibonacci_smart(self, mode):
+    def test_fibonacci_smart(self):
         self.assertTrue(run_file(["fibonacci_smart.alc", "primitives.alc"],
             [1, 2, 3, 4, 5, 6, 7, 8],
-            [1, 1, 2, 3, 5, 8, 13, 21],
-            mode))
+            [1, 1, 2, 3, 5, 8, 13, 21]))

+ 4 - 18
integration/test_if_elif.py

@@ -4,26 +4,12 @@ from utils import run_file
 
 
 class TestIfElif(unittest.TestCase):
-    def test_po_if_elif_else(self):
-        self.if_elif_else("PO")
-
-    def test_co_if_elif_else(self):
-        self.if_elif_else("CO")
-
-    def if_elif_else(self, mode):
+    def test_if_elif_else(self):
         self.assertTrue(run_file(["if_elif_else.alc", "primitives.alc"],
             [-1, 10, 11, 0, 1, 0, -100],
-            [-1, 1, 1, 0, 1, 0, -1],
-            mode))
-
-    def test_po_if_elif(self):
-        self.if_elif("PO")
-
-    def test_co_if_elif(self):
-        self.if_elif("CO")
+            [-1, 1, 1, 0, 1, 0, -1]))
 
-    def if_elif(self, mode):
+    def test_if_elif(self):
         self.assertTrue(run_file(["if_elif.alc", "primitives.alc"],
                                  [-1, 10, 11, 0, 1, 0, -100],
-                                 [-1, 1, 1, 0, 1, 0, -1],
-                                 mode))
+                                 [-1, 1, 1, 0, 1, 0, -1]))

+ 2 - 9
integration/test_leap_year.py

@@ -4,14 +4,7 @@ from utils import run_file
 
 
 class TestLeapYear(unittest.TestCase):
-    def test_po_leap_year(self):
-        self.leap_year("PO")
-
-    def test_co_leap_year(self):
-        self.leap_year("CO")
-
-    def leap_year(self, mode):
+    def test_leap_year(self):
         self.assertTrue(run_file(["leap_year.alc", "primitives.alc"],
             [2016, 2015, 2014, 2013, 2012, 2001, 2000, 1999],
-            [True, False, False, False, True, False, False, False],
-            mode))
+            [True, False, False, False, True, False, False, False]))

+ 2 - 9
integration/test_main.py

@@ -4,14 +4,7 @@ from utils import run_file
 
 
 class TestMain(unittest.TestCase):
-    def test_po_main(self):
-        self.main("PO")
-
-    def test_co_main(self):
-        self.main("CO")
-
-    def main(self, mode):
+    def test_main(self):
         self.assertTrue(run_file(["main.alc", "primitives.alc"],
             [],
-            ["Hello, world!", "Hello, world!", "Hello, world!"],
-            mode))
+            ["Hello, world!", "Hello, world!", "Hello, world!"]))

+ 24 - 75
integration/test_mvc.py

@@ -20,13 +20,7 @@ all_files = [   "core/mini_modify.alc",
             ]
 
 class TestModelverseCore(unittest.TestCase):
-    def test_po_list(self):
-        self.list("PO")
-
-    def test_co_list(self):
-        self.list("CO")
-
-    def list(self, mode):
+    def test_list(self):
         self.assertTrue(run_file(all_files,
             [ "root", "root", "root", 
                 "model_list",
@@ -42,13 +36,9 @@ class TestModelverseCore(unittest.TestCase):
                      "  CoreFormalism : SimpleClassDiagrams",
                      "  ActionLanguage : SimpleClassDiagrams",
                      "  core : CoreFormalism"]),
-            ],
-            mode))
+            ]))
 
-    def test_po_list_full(self):
-        self.list_full("PO")
-
-    def list_full(self, mode):
+    def test_list_full(self):
         self.assertTrue(run_file(all_files,
             [ "root", "root", "root", 
                 "model_list_full",
@@ -64,13 +54,9 @@ class TestModelverseCore(unittest.TestCase):
                      "  221  root admin   CoreFormalism : SimpleClassDiagrams",
                      "  221  root admin   ActionLanguage : SimpleClassDiagrams",
                      "  200  root admin   core : CoreFormalism"]),
-            ],
-            mode))
-
-    def test_po_model_add_empty(self):
-        self.model_add_empty("PO")
+            ]))
 
-    def model_add_empty(self, mode):
+    def test_model_add_empty(self):
         self.assertTrue(run_file(all_files,
             [ "root", "root", "root", 
                 "model_add",
@@ -104,13 +90,9 @@ class TestModelverseCore(unittest.TestCase):
                      "  200  root nobody   Empty : SimpleClassDiagrams",
                      "  221  root admin   ActionLanguage : SimpleClassDiagrams",
                      "  200  root admin   core : CoreFormalism"]),
-            ],
-            mode))
-
-    def test_po_model_empty_modify(self):
-        self.model_empty_modify("PO")
+            ]))
 
-    def model_empty_modify(self, mode):
+    def test_model_empty_modify(self):
         self.assertTrue(run_file(all_files,
             [ "root", "root", "root", 
                 "model_add",
@@ -167,13 +149,9 @@ class TestModelverseCore(unittest.TestCase):
                      "  200  root nobody   Empty : SimpleClassDiagrams",
                      "  200  root admin   core : CoreFormalism"]),
                 "Ready for command...",
-            ],
-            mode))
+            ]))
 
-    def test_po_model_overwrite(self):
-        self.model_overwrite("PO")
-
-    def model_overwrite(self, mode):
+    def test_model_overwrite(self):
         self.assertTrue(run_file(all_files,
             [ "root", "root", "root", 
                 "model_add",
@@ -258,13 +236,9 @@ class TestModelverseCore(unittest.TestCase):
                      "  C : Class"]),
                 "Please give your command.",
                 "Ready for command...",
-            ],
-            mode))
-
-    def test_po_transform_add_MT_language(self):
-        self.transform_add_MT_language("PO")
+            ]))
 
-    def transform_add_MT_language(self, mode):
+    def test_transform_add_MT_language(self):
         self.assertTrue(run_file(all_files,
             [ "root", "root", "root", 
                 "model_add",
@@ -308,13 +282,9 @@ class TestModelverseCore(unittest.TestCase):
                      "  221  root admin   ActionLanguage : SimpleClassDiagrams",
                      "  200  root admin   core : CoreFormalism"]),
                 "Ready for command...",
-            ],
-            mode))
-
-    def test_po_transform_add_MT_instance(self):
-        self.transform_add_MT_instance("PO")
+            ]))
 
-    def transform_add_MT_instance(self, mode):
+    def test_transform_add_MT_instance(self):
         self.assertTrue(run_file(all_files,
             [ "root", "root", "root", 
                 "model_add",
@@ -394,13 +364,9 @@ class TestModelverseCore(unittest.TestCase):
                 set(["  200  root nobody   [ModelTransformation] PetriNets_Print : PetriNets_RAM"
                     ]),
                 "Ready for command...",
-            ],
-            mode))
+            ]))
 
-    def test_po_transform_add_MT_pn_print_upload(self):
-        self.transform_add_MT_pn_print_upload("PO")
-
-    def transform_add_MT_pn_print_upload(self, mode):
+    def test_transform_add_MT_pn_print_upload(self):
         self.assertTrue(run_file(all_files,
             [ "root", "root", "root", 
                 "model_add",
@@ -466,13 +432,9 @@ class TestModelverseCore(unittest.TestCase):
                 set(["  200  root nobody   [ModelTransformation] PetriNets_Print : PetriNets_RAM"
                     ]),
                 "Ready for command...",
-            ],
-            mode))
-
-    def test_po_transform_add_MT_pn_print_exec(self):
-        self.transform_add_MT_pn_print_exec("PO")
+            ]))
 
-    def transform_add_MT_pn_print_exec(self, mode):
+    def test_transform_add_MT_pn_print_exec(self):
         self.assertTrue(run_file(all_files,
             [ "root", "root", "root", 
                 "model_add",
@@ -562,13 +524,9 @@ class TestModelverseCore(unittest.TestCase):
                     ]),
                 "Transformation executed with result: True",
                 "Ready for command...",
-            ],
-            mode))
-
-    def test_po_transform_add_MT_pn_simulate(self):
-        self.transform_add_MT_pn_simulate("PO")
+            ]))
 
-    def transform_add_MT_pn_simulate(self, mode):
+    def test_transform_add_MT_pn_simulate(self):
         self.assertTrue(run_file(all_files,
             [ "root", "root", "root", 
                 "model_add",
@@ -871,14 +829,10 @@ class TestModelverseCore(unittest.TestCase):
                     ]),
                 "Transformation executed with result: True",
                 "Ready for command...",
-            ],
-            mode))
+            ]))
 
     @slow
-    def test_po_transform_add_MT_pn_simulate_larger(self):
-        self.transform_add_MT_pn_simulate_larger("PO")
-
-    def transform_add_MT_pn_simulate_larger(self, mode):
+    def test_transform_add_MT_pn_simulate_larger(self):
         def step_and_print():
             return [ \
                 # transformation_execute (pn_step)
@@ -1187,13 +1141,9 @@ class TestModelverseCore(unittest.TestCase):
                 "Ready for command...",
                 ] + \
                     step_and_print() * 10 +
-                [],
-            mode))
-
-    def test_po_transform_add_AL_pn_simulate(self):
-        self.transform_add_AL_pn_simulate("PO")
+                []))
 
-    def transform_add_AL_pn_simulate(self, mode):
+    def test_transform_add_AL_pn_simulate(self):
         self.assertTrue(run_file(all_files,
             [ "root", "root", "root", 
                 "model_add",
@@ -1488,5 +1438,4 @@ class TestModelverseCore(unittest.TestCase):
                     ]),
                 "Transformation executed with result: True",
                 "Ready for command...",
-            ],
-            mode))
+            ]))

+ 2 - 8
integration/test_power.py

@@ -4,13 +4,7 @@ from utils import run_file
 
 
 class TestPower(unittest.TestCase):
-    def test_po_power(self):
-        self.power("PO")
-
-    def test_cs_power(self):
-        self.power("CO")
-
-    def power(self, mode):
+    def test_power(self):
         self.assertTrue(run_file(["power.alc", "primitives.alc"],
             [1, 0, 2, 1, 5, 0, 2, 2, 3, 2, 10, 2, 10, 10],
-            [1, 2, 1, 4, 9, 100, 10000000000], mode))
+            [1, 2, 1, 4, 9, 100, 10000000000]))

+ 2 - 9
integration/test_remainder.py

@@ -2,15 +2,8 @@ import unittest
 
 from utils import run_file
 
-
 class TestRemainder(unittest.TestCase):
-    def test_po_remainder(self):
-        self.remainder("PO")
-
-    def test_cs_remainder(self):
-        self.remainder("CO")
-
-    def remainder(self, mode):
+    def test_remainder(self):
         self.assertTrue(run_file(["remainder.alc", "primitives.alc"],
             [1, 2, 20, 2, 99, 100, 17, 3],
-            [1, 0, 99, 2], mode))
+            [1, 0, 99, 2]))

+ 2 - 10
integration/test_revert.py

@@ -2,16 +2,8 @@ import unittest
 
 from utils import run_file
 
-
 class TestRevert(unittest.TestCase):
-    def test_po_revert(self):
-        self.revert("PO")
-
-    def test_cs_revert(self):
-        self.revert("CO")
-
-    def revert(self, mode):
+    def test_revert(self):
         self.assertTrue(run_file(["revert.alc", "primitives.alc"],
             ["abc", "defghi", "This is a very simple test case!", "abccba"],
-            ["cba", "ihgfed", "!esac tset elpmis yrev a si sihT", "abccba"],
-            mode))
+            ["cba", "ihgfed", "!esac tset elpmis yrev a si sihT", "abccba"]))

+ 6 - 7
integration/utils.py

@@ -97,7 +97,7 @@ def compile_file(address, mod_filename, filename, mode, proc):
         except UnboundLocalError:
             pass
 
-def run_file(files, parameters, expected, mode, wait=False):
+def run_file(files, parameters, expected, wait=False):
     # Resolve file
     import os.path
 
@@ -131,7 +131,7 @@ def run_file(files, parameters, expected, mode, wait=False):
                 model_mode = "MO"
                 mod_files.remove(mod_filename)
             else:
-                model_mode = mode
+                model_mode = "CO"
             if parallel_push:
                 import threading
                 threads.append(threading.Thread(target=compile_file, args=[address, mod_filename, mod_filename, model_mode, proc]))
@@ -143,11 +143,10 @@ def run_file(files, parameters, expected, mode, wait=False):
             for t in threads:
                 t.join()
 
-        if mode[-1] == "O":
-            # Fire up the linker
-            val = execute("link_and_load", [address, taskname] + mod_files, wait=True)
-            if val != 0:
-                raise Exception("Linking error")
+        # Fire up the linker
+        val = execute("link_and_load", [address, taskname] + mod_files, wait=True)
+        if val != 0:
+            raise Exception("Linking error")
 
         # Send the request ...
         flush_data(address, parameters)