Revision: 30679 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30679 Author: leifandersen Date: 2010-07-24 02:42:27 +0200 (Sat, 24 Jul 2010)
Log Message: ----------- 1. Fixed a nasty bug when accessing the render tests with folders that don't exist. 2. Improved the hashcode algorithm. (It takes a few more object level stuff into account). 3. Fixed some of the output the hash and render tests give. Modified Paths: -------------- branches/soc-2010-leifandersen/release/scripts/op/tests_hash.py branches/soc-2010-leifandersen/release/scripts/op/tests_render.py branches/soc-2010-leifandersen/tests/render/run.py Modified: branches/soc-2010-leifandersen/release/scripts/op/tests_hash.py =================================================================== --- branches/soc-2010-leifandersen/release/scripts/op/tests_hash.py 2010-07-24 00:24:58 UTC (rev 30678) +++ branches/soc-2010-leifandersen/release/scripts/op/tests_hash.py 2010-07-24 00:42:27 UTC (rev 30679) @@ -31,6 +31,10 @@ for num in ob.rotation_euler: hashcode += hash(round(num, 6)) hashcode += hash(ob.type) + for num in ob.location: + hashcode += hash(num) + for num in ob.scale: + hashcode += hash(num) for point in ob.bound_box: for num in point: hashcode += hash(num) Modified: branches/soc-2010-leifandersen/release/scripts/op/tests_render.py =================================================================== --- branches/soc-2010-leifandersen/release/scripts/op/tests_render.py 2010-07-24 00:24:58 UTC (rev 30678) +++ branches/soc-2010-leifandersen/release/scripts/op/tests_render.py 2010-07-24 00:42:27 UTC (rev 30679) @@ -50,12 +50,11 @@ filepath = StringProperty(name="File Path", description="Filepath used", maxlen= 1024, default= "") directory = StringProperty(name="File Directory", description="File Directory used", maxlen= 1024, default= "") - test_passed = True - def poll(self, context): return True def execute(self, context): + test_passed = True (directory, filename) = os.path.split(self.properties.filepath) for file in os.listdir(directory): if file.find('.blend') != -1: Modified: branches/soc-2010-leifandersen/tests/render/run.py =================================================================== --- branches/soc-2010-leifandersen/tests/render/run.py 2010-07-24 00:24:58 UTC (rev 30678) +++ branches/soc-2010-leifandersen/tests/render/run.py 2010-07-24 00:42:27 UTC (rev 30679) @@ -214,7 +214,12 @@ (good_image, test_image, diff_image) = self.get_images() if diff_image != None: self.diff_path = output_path - diff_image.save(output_path) + try: + os.makedirs(os.path.split(output_path)[0]) + except OSError: + pass + finally: + diff_image.save(output_path) class AnimationTestCase(ImageTestCase): '''A Render Test Case only for use with animations. It can either be used to directly @@ -452,7 +457,12 @@ for frame_num in range(0, len(self.good_path_arr)): (good_image, test_image, diff_image) = self.get_image_frame(frame_num) self.diff_path_arr.append(output_path + '_diff_' + self.format_frame(frame_num + 1) + '.png') - diff_image.save(self.diff_path_arr[frame_num]) + try: + os.makedirs(os.path.split(self.diff_path_arr[frame_num])[0]) + except OSError: + pass + finally: + diff_image.save(self.diff_path_arr[frame_num]) else: # Fill up the diff_path with emptie strings...for later use in HTML for image in self.good_path_arr: _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs