[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30878] branches/soc-2010-leifandersen: 1.

Leif Andersen leif.a.andersen at gmail.com
Thu Jul 29 19:14:52 CEST 2010


Revision: 30878
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30878
Author:   leifandersen
Date:     2010-07-29 19:14:50 +0200 (Thu, 29 Jul 2010)

Log Message:
-----------
1.  Did a tone of code cleanup:

a.  Tests module is now essentually a struct of fields for the tests operators to place data, stil not entirely with blender's paradigm, but it's much closer.

b.  Cleaned up some of the older render tests to not use some of those calls that once were in the tests module.  Now they assume bpy.ops.wm.read_homefile() works (which causes all tests to fail at the moment).

c.  Cleaned up a bunch of superfluous folders.

Modified Paths:
--------------
    branches/soc-2010-leifandersen/release/scripts/modules/tests/__init__.py
    branches/soc-2010-leifandersen/tests/pyunit/CMakeLists.txt
    branches/soc-2010-leifandersen/tests/pyunit/data/lamps.py
    branches/soc-2010-leifandersen/tests/pyunit/data/meshes.py
    branches/soc-2010-leifandersen/tests/pyunit/data/scenes.py

Added Paths:
-----------
    branches/soc-2010-leifandersen/tests/pyunit/ops/physics/render/cube_hair_0001.png
    branches/soc-2010-leifandersen/tests/pyunit/ops/physics/render/cube_hair_group_0001.png
    branches/soc-2010-leifandersen/tests/pyunit/ops/physics/render/cube_hair_object_0001.png

Removed Paths:
-------------
    branches/soc-2010-leifandersen/release/scripts/modules/tests/build/
    branches/soc-2010-leifandersen/release/scripts/modules/tests/lamps.py
    branches/soc-2010-leifandersen/release/scripts/modules/tests/meshes.py
    branches/soc-2010-leifandersen/release/scripts/modules/tests/objects.py
    branches/soc-2010-leifandersen/release/scripts/modules/tests/scenes.py
    branches/soc-2010-leifandersen/tests/pyunit/app/
    branches/soc-2010-leifandersen/tests/pyunit/blends/
    branches/soc-2010-leifandersen/tests/pyunit/context/
    branches/soc-2010-leifandersen/tests/pyunit/ops/physics/render/cube_hair.png
    branches/soc-2010-leifandersen/tests/pyunit/ops/physics/render/cube_hair_group.png
    branches/soc-2010-leifandersen/tests/pyunit/ops/physics/render/cube_hair_object.png
    branches/soc-2010-leifandersen/tests/pyunit/props/
    branches/soc-2010-leifandersen/tests/pyunit/types/
    branches/soc-2010-leifandersen/tests/pyunit/utils/

Modified: branches/soc-2010-leifandersen/release/scripts/modules/tests/__init__.py
===================================================================
--- branches/soc-2010-leifandersen/release/scripts/modules/tests/__init__.py	2010-07-29 15:37:11 UTC (rev 30877)
+++ branches/soc-2010-leifandersen/release/scripts/modules/tests/__init__.py	2010-07-29 17:14:50 UTC (rev 30878)
@@ -16,4 +16,4 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
-from tests import scenes, objects, meshes, lamps, hashfile, build, render
+from tests import hashfile, render

Deleted: branches/soc-2010-leifandersen/release/scripts/modules/tests/lamps.py
===================================================================
--- branches/soc-2010-leifandersen/release/scripts/modules/tests/lamps.py	2010-07-29 15:37:11 UTC (rev 30877)
+++ branches/soc-2010-leifandersen/release/scripts/modules/tests/lamps.py	2010-07-29 17:14:50 UTC (rev 30878)
@@ -1,7 +0,0 @@
-import bpy
-
-def reset_lamps():
-    while len(bpy.data.lamps) > 0:
-        bpy.data.lamps[0].user_clear()
-        bpy.data.lamps.remove(bpy.data.lamps[0])
-

Deleted: branches/soc-2010-leifandersen/release/scripts/modules/tests/meshes.py
===================================================================
--- branches/soc-2010-leifandersen/release/scripts/modules/tests/meshes.py	2010-07-29 15:37:11 UTC (rev 30877)
+++ branches/soc-2010-leifandersen/release/scripts/modules/tests/meshes.py	2010-07-29 17:14:50 UTC (rev 30878)
@@ -1,26 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-import bpy
-
-
-#Don't use for now, this could cause blender to crash.
-def reset_meshes():
-    while len(bpy.data.meshes) > 0:
-        bpy.data.meshes[0].user_clear()
-        bpy.data.meshes.remove(bpy.data.meshes[0])   

Deleted: branches/soc-2010-leifandersen/release/scripts/modules/tests/objects.py
===================================================================
--- branches/soc-2010-leifandersen/release/scripts/modules/tests/objects.py	2010-07-29 15:37:11 UTC (rev 30877)
+++ branches/soc-2010-leifandersen/release/scripts/modules/tests/objects.py	2010-07-29 17:14:50 UTC (rev 30878)
@@ -1,24 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-
-import bpy
-
-def reset_objects():
-    bpy.ops.object.select_all()
-    bpy.ops.object.delete()

Deleted: branches/soc-2010-leifandersen/release/scripts/modules/tests/scenes.py
===================================================================
--- branches/soc-2010-leifandersen/release/scripts/modules/tests/scenes.py	2010-07-29 15:37:11 UTC (rev 30877)
+++ branches/soc-2010-leifandersen/release/scripts/modules/tests/scenes.py	2010-07-29 17:14:50 UTC (rev 30878)
@@ -1,45 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-import bpy
-
-# Generates a hashcode
-def hashcode(scene):
-    hashcode = 0
-    hashcode += hash(scene.name)
-    for ob in scene.objects:
-        hashcode += hash(ob.name)
-        for num in ob.rotation_euler:
-            hashcode += hash(round(num, 6))
-        hashcode += hash(ob.type)
-        if ob.type == 'MESH':
-            for vert in ob.data.verts:
-                for co in vert.co:
-                    hashcode += hash(co)
-    return hashcode
-
-
-# Assuming the default blend file, or a file that has only been modified by one of the
-# tests in this suite, it will clear all of the scenes, and create one that it calls "Test"
-def reset_scenes():
-    bpy.data.scenes.new("Test")
-    while len(bpy.data.scenes) > 1:
-        bpy.data.scenes.remove(bpy.data.scenes[0])
-    if bpy.data.scenes[0].name != "Test":
-        bpy.data.scenes.new("Test")
-        bpy.data.scenes.remove(bpy.data.scenes[1])

Modified: branches/soc-2010-leifandersen/tests/pyunit/CMakeLists.txt
===================================================================
--- branches/soc-2010-leifandersen/tests/pyunit/CMakeLists.txt	2010-07-29 15:37:11 UTC (rev 30877)
+++ branches/soc-2010-leifandersen/tests/pyunit/CMakeLists.txt	2010-07-29 17:14:50 UTC (rev 30878)
@@ -24,10 +24,5 @@
 #
 # ***** END GPL LICENSE BLOCK *****
 
-add_subdirectory(app)
-add_subdirectory(context)
 add_subdirectory(data)
 add_subdirectory(ops)
-add_subdirectory(props)
-add_subdirectory(types)
-add_subdirectory(utils)

Modified: branches/soc-2010-leifandersen/tests/pyunit/data/lamps.py
===================================================================
--- branches/soc-2010-leifandersen/tests/pyunit/data/lamps.py	2010-07-29 15:37:11 UTC (rev 30877)
+++ branches/soc-2010-leifandersen/tests/pyunit/data/lamps.py	2010-07-29 17:14:50 UTC (rev 30878)
@@ -4,7 +4,7 @@
 
 class TestLampCreationAndRemoval(unittest.TestCase):
     def setUp(self):
-        tests.lamps.reset_lamps()
+     	bpy.ops.wm.read_homefile(factory=True)
 
     def test_lamp_creation(self):
         pass

Modified: branches/soc-2010-leifandersen/tests/pyunit/data/meshes.py
===================================================================
--- branches/soc-2010-leifandersen/tests/pyunit/data/meshes.py	2010-07-29 15:37:11 UTC (rev 30877)
+++ branches/soc-2010-leifandersen/tests/pyunit/data/meshes.py	2010-07-29 17:14:50 UTC (rev 30878)
@@ -3,13 +3,7 @@
 
 class TestMeshCreation(unittest.TestCase):
     def setUp(self):
-        bpy.data.meshes.new("Test")
-        while len(bpy.data.meshes) > 1:
-            bpy.data.meshes[0].user_clear()
-            bpy.data.meshes.remove(bpy.data.meshes[0])
-        if bpy.data.meshes[0].name != "Test":
-            bpy.data.meshes.new("Test")
-            bpy.data.meshes.remove(bpy.data.meshes[1])
+        bpy.ops.wm.read_homefile(factory=True)
 
     def test_mesh_count(self):
         self.assertEqual(1,len(bpy.data.meshes))

Modified: branches/soc-2010-leifandersen/tests/pyunit/data/scenes.py
===================================================================
--- branches/soc-2010-leifandersen/tests/pyunit/data/scenes.py	2010-07-29 15:37:11 UTC (rev 30877)
+++ branches/soc-2010-leifandersen/tests/pyunit/data/scenes.py	2010-07-29 17:14:50 UTC (rev 30878)
@@ -33,6 +33,10 @@
 
 class TestSceneCreationAndRemoval(unittest.TestCase):
     def setUp(self):
+	bpy.ops.wm.read_homefile()
+	bpy.data.scenes.new("Test")
+	bpy.data.scenes.remove(bpy.data.scenes['Scene'])
+
         tests.scenes.reset_scenes()
 
     def test_scene_count(self):

Deleted: branches/soc-2010-leifandersen/tests/pyunit/ops/physics/render/cube_hair.png
===================================================================
(Binary files differ)

Copied: branches/soc-2010-leifandersen/tests/pyunit/ops/physics/render/cube_hair_0001.png (from rev 30858, branches/soc-2010-leifandersen/tests/pyunit/ops/physics/render/cube_hair.png)
===================================================================
(Binary files differ)

Deleted: branches/soc-2010-leifandersen/tests/pyunit/ops/physics/render/cube_hair_group.png
===================================================================
(Binary files differ)

Copied: branches/soc-2010-leifandersen/tests/pyunit/ops/physics/render/cube_hair_group_0001.png (from rev 30858, branches/soc-2010-leifandersen/tests/pyunit/ops/physics/render/cube_hair_group.png)
===================================================================
(Binary files differ)

Deleted: branches/soc-2010-leifandersen/tests/pyunit/ops/physics/render/cube_hair_object.png
===================================================================
(Binary files differ)

Copied: branches/soc-2010-leifandersen/tests/pyunit/ops/physics/render/cube_hair_object_0001.png (from rev 30858, branches/soc-2010-leifandersen/tests/pyunit/ops/physics/render/cube_hair_object.png)
===================================================================
(Binary files differ)





More information about the Bf-blender-cvs mailing list