diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-04-10 04:38:30 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-04-10 05:08:23 +0300 |
commit | f2452bc9ab9797293c4b51fa022f6a6de82d52e3 (patch) | |
tree | d2074e688b03cdfcb7c211fa6dc56b1d8099f961 /tests | |
parent | 52f511269b98efa804ce7fcc99039ef22190cf29 (diff) |
Test: blacklist loading addons /w known problems
The test now runs without warnings
Diffstat (limited to 'tests')
-rw-r--r-- | tests/python/bl_load_addons.py | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/tests/python/bl_load_addons.py b/tests/python/bl_load_addons.py index 227edf4164d..85b2f1270f5 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() |