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

Leif Andersen leif.a.andersen at gmail.com
Fri Jul 30 21:24:41 CEST 2010


Revision: 30910
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30910
Author:   leifandersen
Date:     2010-07-30 21:24:41 +0200 (Fri, 30 Jul 2010)

Log Message:
-----------
1.  Started merging the trunk /lib/tests folder into my branch.

2.  Removed the superfluous output folder (as it's empty)

3.  Cleaned up the run.py code, so that it now only does one pass, but both renders in the one pass.  For some reason it takes much longer though (or at least feels to take much longer).

Modified Paths:
--------------
    branches/soc-2010-leifandersen/tests/render/run.py

Added Paths:
-----------
    branches/soc-2010-leifandersen/tests/export_import_testing/
    branches/soc-2010-leifandersen/tests/export_import_testing/MESH_GEOMETRY/
    branches/soc-2010-leifandersen/tests/export_import_testing/MESH_GEOMETRY/NURBS.blend
    branches/soc-2010-leifandersen/tests/export_import_testing/MESH_GEOMETRY/all_quads.blend
    branches/soc-2010-leifandersen/tests/export_import_testing/MESH_GEOMETRY/all_tris.blend
    branches/soc-2010-leifandersen/tests/export_import_testing/MESH_GEOMETRY/edges.blend
    branches/soc-2010-leifandersen/tests/export_import_testing/MESH_GEOMETRY/fgons.blend
    branches/soc-2010-leifandersen/tests/export_import_testing/MESH_GEOMETRY/mixed_quads_and_tris.blend
    branches/soc-2010-leifandersen/tests/export_import_testing/MESH_GEOMETRY/vertices.blend
    branches/soc-2010-leifandersen/tests/export_import_testing/blender export import test suite description.txt

Removed Paths:
-------------
    branches/soc-2010-leifandersen/tests/render/output/

Added: branches/soc-2010-leifandersen/tests/export_import_testing/MESH_GEOMETRY/NURBS.blend
===================================================================
(Binary files differ)


Property changes on: branches/soc-2010-leifandersen/tests/export_import_testing/MESH_GEOMETRY/NURBS.blend
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/soc-2010-leifandersen/tests/export_import_testing/MESH_GEOMETRY/all_quads.blend
===================================================================
(Binary files differ)


Property changes on: branches/soc-2010-leifandersen/tests/export_import_testing/MESH_GEOMETRY/all_quads.blend
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/soc-2010-leifandersen/tests/export_import_testing/MESH_GEOMETRY/all_tris.blend
===================================================================
(Binary files differ)


Property changes on: branches/soc-2010-leifandersen/tests/export_import_testing/MESH_GEOMETRY/all_tris.blend
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/soc-2010-leifandersen/tests/export_import_testing/MESH_GEOMETRY/edges.blend
===================================================================
(Binary files differ)


Property changes on: branches/soc-2010-leifandersen/tests/export_import_testing/MESH_GEOMETRY/edges.blend
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/soc-2010-leifandersen/tests/export_import_testing/MESH_GEOMETRY/fgons.blend
===================================================================
(Binary files differ)


Property changes on: branches/soc-2010-leifandersen/tests/export_import_testing/MESH_GEOMETRY/fgons.blend
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/soc-2010-leifandersen/tests/export_import_testing/MESH_GEOMETRY/mixed_quads_and_tris.blend
===================================================================
(Binary files differ)


Property changes on: branches/soc-2010-leifandersen/tests/export_import_testing/MESH_GEOMETRY/mixed_quads_and_tris.blend
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/soc-2010-leifandersen/tests/export_import_testing/MESH_GEOMETRY/vertices.blend
===================================================================
(Binary files differ)


Property changes on: branches/soc-2010-leifandersen/tests/export_import_testing/MESH_GEOMETRY/vertices.blend
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/soc-2010-leifandersen/tests/export_import_testing/blender export import test suite description.txt
===================================================================
--- branches/soc-2010-leifandersen/tests/export_import_testing/blender export import test suite description.txt	                        (rev 0)
+++ branches/soc-2010-leifandersen/tests/export_import_testing/blender export import test suite description.txt	2010-07-30 19:24:41 UTC (rev 30910)
@@ -0,0 +1,76 @@
+This is a list of files (and needed files) for conformance testing of exporters
+and importers The left hand column is the type of test and/or the folder the test is 
+located in. The right hand column is the name of the blend file the test is in.  
+If no blend file is listed then the test has not been created yet.
+If you wish to contribute, please create a blend that is as simple as 
+possible that can still test the functionality.  
+Try to limit a blend to testing one thing unless it is a a 'complex test'.
+
+SIMPLE TESTS
+
+	MESH_GEOMETRY
+		All Tris				all_tris.blend
+		Mixed Quads and Tri			mixed_quads_and_tris.blend
+		All Quads				all_quads.blend
+		FGons					fgons.blend
+		Vertices				vertics.blend
+		Edges					edges.blend
+
+	CURVE_GEOMETRY
+		Nurbs
+		Splines
+		Circles
+		Various tangent types
+		2D/3D
+
+	TExT
+
+	METABALL_GEOMETRY
+
+	MODIFIERS
+
+	TRANSFORMS
+		Location
+		Rotation
+		Scale
+
+	HIERARCY
+		Parent_Child
+		Parent_Multiple Child
+	
+	ARMATURES
+
+	SKINNGING
+
+	CONSTRAINTS
+
+	TEXTURE
+		UV Map
+		Double Sided
+
+	MATERIALS
+
+	LIGHTS
+		Spot
+		
+	CAMERAS
+
+	ANIMATION
+		Fcurves
+		NLA
+
+	PARTICLES
+
+	HAIR
+
+	PHYSICS
+
+	FLUIDS
+
+	SMOKE
+
+	CLOTH
+
+	SOFTBODY
+
+COMPLEX_TESTS

Modified: branches/soc-2010-leifandersen/tests/render/run.py
===================================================================
--- branches/soc-2010-leifandersen/tests/render/run.py	2010-07-30 17:18:16 UTC (rev 30909)
+++ branches/soc-2010-leifandersen/tests/render/run.py	2010-07-30 19:24:41 UTC (rev 30910)
@@ -93,7 +93,7 @@
             frame_num = '0' + frame_num
         return frame_num
 
-    def render_test(self, blender_bin, verbose):
+    def render_test(self, good_blender_bin, blender_bin, verbose):
         '''Renders the test image based on the given image path in the setup methods.
            Assumes there is a global VERBOSE and BLENDER_BIN variable to be used.
            Will only render the first frame of the image using the default settings (saving as a PNG though)
@@ -101,13 +101,18 @@
 
         # Render Based on whether or not it's verbose
         if verbose:
+            command = good_blender_bin + ' -b ' + self.blend_path + ' -o ' + self.good_path + '_#### -F PNG -x 1 -f 1'
+            os.system(command)
             command = blender_bin + ' -b ' + self.blend_path + ' -o ' + self.test_path + '_#### -F PNG -x 1 -f 1'
             os.system(command)
         else:
-            p = Popen([blender_bin, '-b', self.blend_path, '-o', self.test_path + '_####', '-F', 'PNG', '-x', '1', '-f', '1'], stdout=PIPE, stderr=PIPE, stdin=PIPE)
+            p = Popen([good_blender_bin, '-b', self.blend_path, '-o', self.good_path + '_####', '-F', 'PNG', '-x', '1', '-f', '1'], stdout=PIPE, stderr=PIPE, stdin=PIPE)
+            q = Popen([blender_bin, '-b', self.blend_path, '-o', self.test_path + '_####', '-F', 'PNG', '-x', '1', '-f', '1'], stdout=PIPE, stderr=PIPE, stdin=PIPE)
             p.wait()
+            q.wait()
 
         # Modify the test path as needed
+        self.good_path += '_0001.png'
         self.test_path += '_0001.png'
 
     def image_test(self):
@@ -204,21 +209,8 @@
            test_path: the path for the output folder of the test when it's rendered'''
         self.name = os.path.split(blend_path)[1]
         self.blend_path = blend_path
-        try:
-            for imagename in os.listdir(good_path):
-                if imagename.find('.png') != -1:
-                    self.good_path_arr.append(os.path.join(good_path, imagename))
-        except OSError:
-            self.good_path_arr.append(good_path)
-        finally:
-            self.good_path_arr.sort()
-            self.mode = 'Image'
-            for imagename in self.good_path_arr:
-                (imagepath, blendname) = os.path.split(imagename)
-                self.test_path_arr.append(os.path.join(test_path, blendname))
-            if len(self.good_path_arr) > 0:
-                self.good_path = self.good_path_arr[0]
-            self.test_path = test_path
+        self.good_path = good_path
+        self.test_path = test_path
             
     def get_image_frame(self, frame_num):
         '''Gets a good image, and a test image (which assumes it's rendered) from the animation, based on their
@@ -236,7 +228,7 @@
             self.passed = False
             return (good_image, test_image, diff_image)
 
-    def render_test(self, blender_bin, verbose):
+    def render_test(self, good_blender_bin, blender_bin, verbose):
         '''Renders the test animation based on the given animation path in the setup methods.
            Assumes there is a global VERBOSE and BLENDER_BIN variable to be used.
            Will only render the first frame of the image using the default settings (saving as a PNG though)
@@ -244,14 +236,34 @@
            
         # Render depending on the verbosity needed
         if verbose:
+            command = good_blender_bin + ' -b ' + self.blend_path + " -o " + os.path.join(self.good_path,string.replace(self.name,'.blend','_####')) + ' -F PNG -x 1 -j 30 -a'
+            os.system(command)
             command = blender_bin + ' -b ' + self.blend_path + " -o " + os.path.join(self.test_path,string.replace(self.name,'.blend','_####')) + ' -F PNG -x 1 -j 30 -a'
             os.system(command)
         else:
-            p = Popen([blender_bin, '-b', self.blend_path, '-o', os.path.join(self.test_path,string.replace(self.name,'.blend','_####')), '-F', 'PNG', '-x', '1', '-j', '30', '-a'], stdout=None, stderr=None, stdin=None)
+            p = Popen([good_blender_bin, '-b', self.blend_path, '-o', os.path.join(self.good_path,string.replace(self.name,'.blend','_####')), '-F', 'PNG', '-x', '1', '-j', '30', '-a'], stdout=None, stderr=None, stdin=None)
+            q = Popen([blender_bin, '-b', self.blend_path, '-o', os.path.join(self.test_path,string.replace(self.name,'.blend','_####')), '-F', 'PNG', '-x', '1', '-j', '30', '-a'], stdout=None, stderr=None, stdin=None)
             p.wait()
+            q.wait()
             
         # Modify self.test_path for later use
-        self.test_path = self.test_path_arr[0]
+        self.good_path_arr = []
+        self.test_path_arr = []
+        for filename in os.listdir(self.good_path):
+            self.good_path_arr.append(os.path.join(self.good_path, filename))
+        for filename in os.listdir(self.test_path):
+            self.test_path_arr.append(os.path.join(self.test_path, filename))
+        self.good_path_arr.sort()
+        self.test_path_arr.sort()
+        if len(self.good_path_arr) > 0:
+            self.good_path = self.good_path_arr[0]
+            while len(self.test_path_arr) < len(self.good_path_arr):
+                self.test_path_arr.append('')
+            self.test_path = self.test_path_arr[0]
+        else:
+            self.good_path_arr.append(self.good_path)
+            self.test_path_arr.append(self.test_path)
+
                 
     def image_test(self):

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list