[Bf-blender-cvs] [f2452bc] master: Test: blacklist loading addons /w known problems

Campbell Barton noreply at git.blender.org
Fri Apr 10 05:42:38 CEST 2015


Commit: f2452bc9ab9797293c4b51fa022f6a6de82d52e3
Author: Campbell Barton
Date:   Fri Apr 10 11:38:30 2015 +1000
Branches: master
https://developer.blender.org/rBf2452bc9ab9797293c4b51fa022f6a6de82d52e3

Test: blacklist loading addons /w known problems

The test now runs without warnings

===================================================================

M	tests/python/bl_load_addons.py

===================================================================

diff --git a/tests/python/bl_load_addons.py b/tests/python/bl_load_addons.py
index 227edf4..85b2f12 100644
--- a/tests/python/bl_load_addons.py
+++ b/tests/python/bl_load_addons.py
@@ -34,11 +34,28 @@ import imp
 BLACKLIST_DIRS = (
     os.path.join(bpy.utils.resource_path('USER'), "scripts"),
     ) + tuple(addon_utils.paths()[1:])
+BLACKLIST_ADDONS = set()
+
+def _init_addon_blacklist():
+
+    # in case we built without cycles
+    if not bpy.app.build_options.cycles:
+        BLACKLIST_ADDONS.add("cycles")
+
+    # in case we built without freestyle
+    if not bpy.app.build_options.freestyle:
+        BLACKLIST_ADDONS.add("render_freestyle_svg")
+
+    # netrender has known problems re-registering
+    BLACKLIST_ADDONS.add("netrender")
 
 
 def addon_modules_sorted():
     modules = addon_utils.modules({})
-    modules[:] = [mod for mod in modules if not mod.__file__.startswith(BLACKLIST_DIRS)]
+    modules[:] = [
+            mod for mod in modules
+            if not (mod.__file__.startswith(BLACKLIST_DIRS))
+            if not (mod.__name__ in BLACKLIST_ADDONS)]
     modules.sort(key=lambda mod: mod.__name__)
     return modules
 
@@ -64,7 +81,7 @@ def test_load_addons():
         mod_name = mod.__name__
         print("\tenabling:", mod_name)
         addon_utils.enable(mod_name, default_set=True)
-        if mod_name not in addons:
+        if (mod_name not in addons) and (mod_name not in BLACKLIST_ADDONS):
             addons_fail.append(mod_name)
 
     if addons_fail:
@@ -106,6 +123,9 @@ def reload_addons(do_reload=True, do_reverse=True):
 
 
 def main():
+
+    _init_addon_blacklist()
+
     # first load addons, print a list of all addons that fail
     test_load_addons()




More information about the Bf-blender-cvs mailing list