Commits

Manuel Jacob committed 7cf9819

Unskip test_disable_logic(). Fix.

Comments (0)

Files changed (3)

rpython/translator/c/test/test_genc.py

         print "THE RESULT IS:", llrepr_out(res), ";"
         return 0
 
+    kwds = {}
+    if not backendopt:
+        kwds['backendopt.none'] = True
     t = Translation(entry_point, None, gc=gcpolicy, backend="c",
-                    policy=annotatorpolicy, thread=thread)
-    if not backendopt:
-        t.disable(["backendopt_lltype"])
+                    policy=annotatorpolicy, thread=thread, **kwds)
     t.driver.config.translation.countmallocs = True
     t.annotate()
     if py.test.config.option.view:

rpython/translator/driver.py

 
         self.done = {}
 
-        self.tasks = tasks = []
-        # expose tasks
-        def expose_task(task):
-            def proc():
-                return self.proceed(task)
-            tasks.append(task)
-            setattr(self, task.task_name, proc)
-
-        expose_task(self.task_annotate)
-        expose_task(self.task_rtype)
-        if config.translation.jit:
-            expose_task(self.task_pyjitpl)
-        if not config.translation.backendopt.none:
-            expose_task(self.task_backendopt)
-        if config.translation.type_system == 'lltype':
-            expose_task(self.task_stackcheckinsertion_lltype)
-        for task in backends[config.translation.backend](self).get_tasks():
-            expose_task(task)
-
     def set_backend_extra_options(self, extra_options):
         self._backend_extra_options = extra_options
 
 
         self.translator.driver_instrument_result = self.instrument_result
 
+        self.tasks = tasks = []
+        # expose tasks
+        def expose_task(task):
+            def proc():
+                return self.proceed(task)
+            tasks.append(task)
+            setattr(self, task.task_name, proc)
+
+        expose_task(self.task_annotate)
+        expose_task(self.task_rtype)
+        if self.config.translation.jit:
+            expose_task(self.task_pyjitpl)
+        if not self.config.translation.backendopt.none:
+            expose_task(self.task_backendopt)
+        if self.config.translation.type_system == 'lltype':
+            expose_task(self.task_stackcheckinsertion_lltype)
+        for task in backends[self.config.translation.backend](self).get_tasks():
+            expose_task(task)
+
     def instrument_result(self, args):
         backend = self.config.translation.backend
         if backend != 'c' or sys.platform == 'win32':

rpython/translator/test/test_driver.py

 
 def test_c_no_jit():
     td = TranslationDriver()
+    td.setup(None, None)
     names = ['annotate', 'rtype', 'backendopt', 'stackcheckinsertion_lltype',
              'database', 'source', 'compile']
     assert [task.task_name for task in td.tasks] == names
 
 def test_c_with_jit():
     td = TranslationDriver({'jit': True})
+    td.setup(None, None)
     names = ['annotate', 'rtype', 'pyjitpl', 'backendopt',
              'stackcheckinsertion_lltype', 'database', 'source', 'compile']
     assert [task.task_name for task in td.tasks] == names
 
 def test_no_backendopt():
     td = TranslationDriver({'backendopt.none': True})
+    td.setup(None, None)
     names = ['annotate', 'rtype', 'stackcheckinsertion_lltype', 'database',
              'source', 'compile']
     assert [task.task_name for task in td.tasks] == names
     assert 'source' in t.driver.done
 
 def test_disable_logic():
-    return # temporary skip
-
     def f(x,y):
         return x+y
 
-    t = Translation(f, [int, int])
-    t.disable(['backendopt'])
+    t = Translation(f, [int, int], **{'backendopt.none': True})
     t.source()
 
     assert 'backendopt' not in t.driver.done
     t.rtype()
     assert 'rtype' in t.driver.done
 
-    t = Translation(f, [int, int], backend='cli', type_system='ootype')
-    t.rtype()
-    assert 'rtype' in t.driver.done
+    #t = Translation(f, [int, int], backend='cli', type_system='ootype')
+    #t.rtype()
+    #assert 'rtype' in t.driver.done
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.