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

Leif Andersen leif.a.andersen at gmail.com
Sat Jul 10 04:47:54 CEST 2010


Revision: 30170
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30170
Author:   leifandersen
Date:     2010-07-10 04:47:53 +0200 (Sat, 10 Jul 2010)

Log Message:
-----------
1.  Changes made to make the output cleaner.  It's still a bit clunky, but it does look like it matches blender a bit more now.

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

Added Paths:
-----------
    branches/soc-2010-leifandersen/tests/render/bg.png

Copied: branches/soc-2010-leifandersen/tests/render/bg.png (from rev 29883, branches/soc-2010-leifandersen/tests/render/_static/bg.png)
===================================================================
(Binary files differ)

Modified: branches/soc-2010-leifandersen/tests/render/run.py
===================================================================
--- branches/soc-2010-leifandersen/tests/render/run.py	2010-07-10 00:37:42 UTC (rev 30169)
+++ branches/soc-2010-leifandersen/tests/render/run.py	2010-07-10 02:47:53 UTC (rev 30170)
@@ -74,7 +74,7 @@
         self.test_path = test_path
         try:
             self.good_image = Image.open(good_path)
-            self.good_hash = self.generate_hash(self.good_image)
+            #self.good_hash = self.generate_hash(self.good_image)
         except IOError:
             self.good_image = None
             self.good_hash = -1
@@ -381,22 +381,27 @@
             cases.append(test_case)
     return cases
 
+def get_hashcodes(filename):
+    file = open(filename, 'r')
 
+    file.close()
+
 def console_output(cases):
     '''Displays the final output to the console.  The output that will be shown if the -v flag isn't used'''
     failed = []
     print ''
-    if not BUILDING_TESTS:
-        for test_case in cases:
-            if test_case.passed == False:
-                failed.append(test_case)
+    if BUILDING_TESTS:
+        print "Tests built successfully"
+        return
+
+    for test_case in cases:
+        if test_case.passed == False:
+            failed.append(test_case)
     
     if len(failed) > 0:
         print "The following tesets failed:"
         for test_case in failed:
             print test_case.name
-    elif BUILDING_TESTS:
-        print "Tests built successfully"
     else:
         print "All tests passed"
     print 'Check index.html for more information'
@@ -409,7 +414,11 @@
     file.write('<title>Render Test Output</title>\n</head>\n')
     file.write('<body>\n')
     file.write('<div class="noprint" id="navcontainer"><a href="http://www.blender.org/"><img width="140" height="50" title="blender.org home page" alt="blender.org home page" src="http://www.blender.org/fileadmin/site/_gfx/nav-home.png"></a><a href="http://www.blender.org/features-gallery/"><img width="140" height="50" title="Features & Gallery" alt="Features & Gallery" src="http://www.blender.org/fileadmin/site/_gfx/nav-features.png"></a><a href="http://www.blender.org/download/get-blender/"><img width="140" height="50" title="Download" alt="Download" src="http://www.blender.org/fileadmin/site/_gfx/nav-download.png"></a><a href="http://www.blender.org/education-help/"><img width="140" height="50" title="Tutorials & Help" alt="Tutorials & Help" src="http://www.blender.org/fileadmin/site/_gfx/nav-help.png"></a><a href="http://www.blender.org/community/user-community/"><img width="140" height="50" title="Community" alt="Community" src="http://www.blender.org/fileadmin/site/_gfx/nav-community.png"></a><a href="http://www.blender.org/development/"><img width="140" height="50" title="Development" alt="Development" src="http://www.blender.org/fileadmin/site/_gfx/nav-development-on.png"></a><a href="http://www.blender.org/e-shop/"><img width="140" height="50" title="e-Shop" alt="e-Shop" src="http://www.blender.org/fileadmin/site/_gfx/nav-eshop.png"></a></div> ')
-    file.write('<h1>Failed Images</h1>\n')
+    file.write('<div class="document">\n')
+    file.write('<div class="documentwrapper">\n<div class="bodywrapper">\n<div class="body">\n')
+    file.write('<div id="pageheader"></div>\n')
+    file.write('<h1>Images</h1>\n')
+    file.write('<h2>Failed Images</h2>\n')
     file.write('<table border="1">\n')
     file.write('<tr>\n')
     file.write('<th>Filename</th>\n')
@@ -423,9 +432,9 @@
         if image.passed == False:
             file.write('<tr>\n')
             file.write('<td>' +  image.name + '</td>\n')
-            file.write('<td><a href="' + os.path.join('render', string.replace(image.name, '.blend', '.png')) + '"><img src="' + os.path.join('render', string.replace(image.name, '.blend', '.png')) + '" alt="Good Image" width="200" height="150"></a></td>\n')
-            file.write('<td><a href="' + os.path.join('output', string.replace(image.name, '.blend', '_0001.png')) + '"><img src="' + os.path.join('output', string.replace(image.name, '.blend', '_0001.png')) + '" alt="Latest Render" width="200" height="150"></a></td>\n')
-            file.write('<td><a href="' + os.path.join('output', string.replace(image.name, '.blend', '_diff.png')) + '"><img src="' + os.path.join('output', string.replace(image.name, '.blend', '_diff.png')) + '" alt="Image Diff" width="200" height="150"></a></td>\n')
+            file.write('<td><a href="' + image.good_path + '"><img src="' + image.good_path + '" alt="Good Image" width="200" height="150"></a></td>\n')
+            file.write('<td><a href="' + image.test_path + '"><img src="' + image.test_path + '" alt="Latest Render" width="200" height="150"></a></td>\n')
+            file.write('<td><a href="' + image.diff_path + '"><img src="' + image.diff_path + '" alt="Image Diff" width="200" height="150"></a></td>\n')
             file.write('<td>')
             if image.passed:
                 file.write('<font color="ooffoo">OK</font>: ' + str(image.bad_pixels) + ' of ' + str(image.pixel_count) + ' pixels different, ' + str(image.difference) + '% different.')
@@ -436,7 +445,7 @@
             file.write('</td>\n</tr>\n')
     file.write('</table>\n')
 
-    file.write('<h1>Passed Images</h1>\n')
+    file.write('<h2>Passed Images</h2>\n')
     file.write('<table border="1">\n')
     file.write('<tr>\n')
     file.write('<th>Filename</th>\n')
@@ -450,9 +459,9 @@
         if image.passed == True:
             file.write('<tr>\n')
             file.write('<td>' +  image.name + '</td>\n')
-            file.write('<td><a href="' + os.path.join('render', string.replace(image.name, '.blend', '.png')) + '"><img src="' + os.path.join('render', string.replace(image.name, '.blend', '.png')) + '" alt="Good Image" width="200" height="150"></a></td>\n')
-            file.write('<td><a href="' + os.path.join('output', string.replace(image.name, '.blend', '_0001.png')) + '"><img src="' + os.path.join('output', string.replace(image.name, '.blend', '_0001.png')) + '" alt="Latest Render" width="200" height="150"></a></td>\n')
-            file.write('<td><a href="' + os.path.join('output', string.replace(image.name, '.blend', '_diff.png')) + '"><img src="' + os.path.join('output', string.replace(image.name, '.blend', '_diff.png')) + '" alt="Image Diff" width="200" height="150"></a></td>\n')
+            file.write('<td><a href="' + image.good_path + '"><img src="' + image.good_path + '" alt="Good Image" width="200" height="150"></a></td>\n')
+            file.write('<td><a href="' + image.test_path + '"><img src="' + image.test_path + '" alt="Latest Render" width="200" height="150"></a></td>\n')
+            file.write('<td><a href="' + image.diff_path + '"><img src="' + image.diff_path + '" alt="Image Diff" width="200" height="150"></a></td>\n')
             file.write('<td>')
             if image.passed:
                 file.write('<font color="ooffoo">OK</font>: ' + str(image.bad_pixels) + ' of ' + str(image.pixel_count) + ' pixels different, ' + str(image.difference) + '% different.')
@@ -462,8 +471,8 @@
                 file.write(" " + image.message)
             file.write('</td>\n</tr>\n')
     file.write('</table>\n')
-
-    file.write('</body>\n</html>')
+    file.write('</div>\n</div>\n</div>\n')
+    file.write('</div>\n</body>\n</html>')
     file.close()
 
 
@@ -498,10 +507,119 @@
 
 def generate_css(filepath):
     file = open(filepath, 'w')
-    file.write('#navcontainer {height: 50px;margin: 0 auto;position: relative;width: 980px;}\n')
-    file.write('#navcontainer img {width: 140px;height: 50px;}\n')
-    file.write('#pageheader  {background-image:url("bg.png");height:80px;position:relative;}\n')
-    file.write('body {font-family: "Lucida Grande","Lucida Sans Unicode","Lucida Sans","Lucida",Verdana,sans-serif;font-size: 12px;line-height: 145%;background-color: #000000;color: #ffffff;min-width: 980px;margin: 0;padding: 0;}\n')
+    file.write('''#navcontainer {height: 50px;margin: 0 auto;position: relative;width: 980px;}
+#navcontainer img {width: 140px;height: 50px;}
+#pageheader  {background-image:url("bg.png");height:80px;position:relative;}
+body {font-family: "Lucida Grande","Lucida Sans Unicode","Lucida Sans","Lucida",Verdana,sans-serif;font-size: 12px;line-height: 145%;background-color: #000000;color: #ffffff;min-width: 980px;margin: 0;padding: 0;}
+div.document {margin:20px auto 0;position:relative;text-align:left;width:980px;/*    background-color: #1c4e63;*/}
+div.documentwrapper {float: left;width: 100%;background-color: #232323;border-color: #363636;border-style:solid;border-width:0 1px;margin:0 auto;min-height:30em;padding:35px;/*    position:relative;*/text-align:left;width:908px;}
+div.bodywrapper {margin: 0 0 0 230px;}
+div.body {background-color: #232323;color: #ffffff;padding: 0;width: 640px;}
+div.bodywrapper {margin: 0 230px 0 0;}
+div.footer {background: #292929;border-left: 1px solid #363636;border-right: 1px solid #363636color: #ffffff;/*    width: 100%;*/margin: 0 auto;padding: 20px 20px 15px 35px;text-align: center;font-size: 75%;}
+div.footer+.round b {display: block;background: #292929;width: auto;}
+div.footer+.round #r1 {border-left: 1px solid #363636;border-right: 1px solid #363636;height: 2px;margin: 0 1px;}
+div.footer+.round #r2 {border-left: 1px solid #363636;border-right: 1px solid #363636;height: 1px;margin: 0 2px;}
+div.footer+.round #r3 {border-left: 1px solid #363636;border-right: 1px solid #363636;height: 1px;margin: 0 3px;}
+div.footer+.round #r4 {border-bottom: 1px solid #363636;height: 0px;margin: 0 5px;}
+div.footer a {color: #ffffff;text-decoration: underline;}
+.boxheader {background-color:#3E4D5E;}
+.subnav {height:auto !important;min-height:15px;padding:9px 0px 9px 37px;position:relative;}
+div.related {width:auto;font-size:100%;font-weight:400;background-color: #2C3845;line-height: 145%;color: #D3E0E9;}
+div.related li {font-size:0.9em;}
+div.related li.right {margin: 0;word-spacing: 3px;}

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list