[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37343] trunk/blender/source/tests: update for tests, error out when duplicate modules are found, all ctest tests pass again.

Campbell Barton ideasman42 at gmail.com
Thu Jun 9 18:20:02 CEST 2011


Revision: 37343
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37343
Author:   campbellbarton
Date:     2011-06-09 16:20:00 +0000 (Thu, 09 Jun 2011)
Log Message:
-----------
update for tests, error out when duplicate modules are found, all ctest tests pass again.

Modified Paths:
--------------
    trunk/blender/source/tests/CMakeLists.txt
    trunk/blender/source/tests/bl_load_py_modules.py

Modified: trunk/blender/source/tests/CMakeLists.txt
===================================================================
--- trunk/blender/source/tests/CMakeLists.txt	2011-06-09 16:12:10 UTC (rev 37342)
+++ trunk/blender/source/tests/CMakeLists.txt	2011-06-09 16:20:00 UTC (rev 37343)
@@ -111,7 +111,7 @@
 	--run={'FINISHED'}&bpy.ops.export_scene.obj\(filepath='${TEST_OUT_DIR}/export_obj_all_objects.obj',use_selection=False,use_nurbs=True\)
 	--md5_source=${TEST_OUT_DIR}/export_obj_all_objects.obj
 	--md5_source=${TEST_OUT_DIR}/export_obj_all_objects.mtl
-	--md5=d06bd49e6c084e4e3348fa397a88790c --md5_method=FILE
+	--md5=01c123948efadc6a71ab2c09a5925756 --md5_method=FILE
 )
 
 
@@ -212,7 +212,7 @@
 	--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
 	--run={'FINISHED'}&bpy.ops.export_scene.x3d\(filepath='${TEST_OUT_DIR}/export_x3d_all_objects.x3d',use_selection=False\)
 	--md5_source=${TEST_OUT_DIR}/export_x3d_all_objects.x3d
-	--md5=cef017805f684f27c311fdf4ba87462a --md5_method=FILE
+	--md5=d7d6574e833f3f051b65ef4577485fa9 --md5_method=FILE
 )
 
 

Modified: trunk/blender/source/tests/bl_load_py_modules.py
===================================================================
--- trunk/blender/source/tests/bl_load_py_modules.py	2011-06-09 16:12:10 UTC (rev 37342)
+++ trunk/blender/source/tests/bl_load_py_modules.py	2011-06-09 16:20:00 UTC (rev 37343)
@@ -65,6 +65,10 @@
     # paths blender stores scripts in.
     paths = bpy.utils.script_paths()
 
+    print("Paths:")
+    for script_path in paths:
+        print("\t'%s'" % script_path)
+
     #
     # find all sys.path we added
     for script_path in paths:
@@ -74,11 +78,18 @@
 
     #
     # collect modules from our paths.
+    module_names = set()
     for mod_dir in module_paths:
         # print("mod_dir", mod_dir)
         for mod, mod_full in bpy.path.module_names(mod_dir):
+            if mod in module_names:
+                raise Exception("Module found twice %r" % mod)
+
             modules.append(__import__(mod))
 
+            module_names.add(mod)
+    del module_names
+
     #
     # now submodules
     for m in modules:




More information about the Bf-blender-cvs mailing list