[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29093] branches/soc-2010-leifandersen: 1.
Leif Andersen
leif.a.andersen at gmail.com
Mon May 31 04:39:29 CEST 2010
Revision: 29093
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29093
Author: leifandersen
Date: 2010-05-31 04:39:28 +0200 (Mon, 31 May 2010)
Log Message:
-----------
1. Added a method in the hashcodes submodule to change a specific hashcode in ahash file. Will start writing a simple program for this when I figure out why raw_input isn't working.
2. Added a build target for Cdash, your results can be sent to the CDash Dashboard by typing in make make report.
3. Started adding a PIL based framework.
4. Made a howto for compiling the project (Thanks to Luca). http://wiki.blender.org/index.php/User:LeifAndersen/GSoC2010/Howto
Modified Paths:
--------------
branches/soc-2010-leifandersen/CMakeLists.txt
branches/soc-2010-leifandersen/release/scripts/modules/tests/hashfile.py
branches/soc-2010-leifandersen/tests/hashtests/hashcodes.txt
branches/soc-2010-leifandersen/tests/hashtests/scenes.py
Added Paths:
-----------
branches/soc-2010-leifandersen/tests/hashtests/hashchanger.py
branches/soc-2010-leifandersen/tests/render/
Modified: branches/soc-2010-leifandersen/CMakeLists.txt
===================================================================
--- branches/soc-2010-leifandersen/CMakeLists.txt 2010-05-30 21:17:59 UTC (rev 29092)
+++ branches/soc-2010-leifandersen/CMakeLists.txt 2010-05-31 02:39:28 UTC (rev 29093)
@@ -708,5 +708,6 @@
ADD_SUBDIRECTORY(tests)
ENABLE_TESTING()
ADD_CUSTOM_TARGET(test COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS blender)
+ ADD_CUSTOM_TARGET(report COMMAND ${CMAKE_CTEST_COMMAND} -D Experimental DEPENDS blender)
include(CTest)
ENDIF(WITH_TESTS)
Modified: branches/soc-2010-leifandersen/release/scripts/modules/tests/hashfile.py
===================================================================
--- branches/soc-2010-leifandersen/release/scripts/modules/tests/hashfile.py 2010-05-30 21:17:59 UTC (rev 29092)
+++ branches/soc-2010-leifandersen/release/scripts/modules/tests/hashfile.py 2010-05-31 02:39:28 UTC (rev 29093)
@@ -53,3 +53,17 @@
print(data)
file.close()
return data
+
+# Changes the value of a hash in a hashfile. If you have multiple hashes in the same hashfile that share the same name, than you have the option of returning which hash in the file it has that name.
+#param: pathname, hashname, new hash code, hash location (only needed for clashing names)
+def changehash(path, hashname, hashcode, number=1):
+ data = tests.hashfile.read(path)
+ hash_locations = []
+ i = 0
+ for tuple in data:
+ if tuple[0] == hashname:
+ hash_locations.append(i)
+ i+=1
+ change_index = hash_locations[number-1]
+ data[change_index][1] = hashcode
+ tests.hashfile.write(path, data)
Added: branches/soc-2010-leifandersen/tests/hashtests/hashchanger.py
===================================================================
--- branches/soc-2010-leifandersen/tests/hashtests/hashchanger.py (rev 0)
+++ branches/soc-2010-leifandersen/tests/hashtests/hashchanger.py 2010-05-31 02:39:28 UTC (rev 29093)
@@ -0,0 +1,17 @@
+import tests
+import sys
+
+def changehash(path, hashname, hashcode, number=1):
+ data = tests.hashfile.read(path)
+ hash_locations = []
+ i = 0
+ for tuple in data:
+ if tuple[0] == hashname:
+ hash_locations.append(i)
+ i+=1
+ change_index = hash_locations[number-1]
+ data[change_index][1] = hashcode
+ tests.hashfile.write(path, data)
+
+if __name__ == '__main__':
+ changehash("/home/leif/blender-svn/soc-2010-leifandersen/tests/hashtests/hashcodes.txt", "empty_scene", -1504849438355502056)
Modified: branches/soc-2010-leifandersen/tests/hashtests/hashcodes.txt
===================================================================
--- branches/soc-2010-leifandersen/tests/hashtests/hashcodes.txt 2010-05-30 21:17:59 UTC (rev 29092)
+++ branches/soc-2010-leifandersen/tests/hashtests/hashcodes.txt 2010-05-31 02:39:28 UTC (rev 29093)
@@ -1,3 +1,2 @@
empty_scene = -1504849438355502056
- # Foo
empty_mesh = 3297148919719683587
Modified: branches/soc-2010-leifandersen/tests/hashtests/scenes.py
===================================================================
--- branches/soc-2010-leifandersen/tests/hashtests/scenes.py 2010-05-30 21:17:59 UTC (rev 29092)
+++ branches/soc-2010-leifandersen/tests/hashtests/scenes.py 2010-05-31 02:39:28 UTC (rev 29093)
@@ -25,9 +25,11 @@
# A list of all of the hash codes
# TODO: Add an easier way to update?
-empty_scene = -1504849438355502056
-empty_mesh = 3297148919719683587
+path = "/home/leif/blender-svn/soc-2010-leifandersen/tests/hashtests/hashcodes.txt"
+empty_scene = 0
+empty_mesh = 0
+
class TestEmptyScene(unittest.TestCase):
def setUp(self):
tests.scenes.reset_scenes()
@@ -62,4 +64,7 @@
return unittest.TestSuite([unittest.TestLoader().loadTestsFromTestCase(TestEmptyScene)])
if __name__ == "__main__":
+ hashlist = tests.hashfile.read(path)
+ empty_scene = hashlist[0][1]
+ empty_mesh = hashlist[1][1]
unittest.TextTestRunner(verbosity=2).run(suite())
\ No newline at end of file
More information about the Bf-blender-cvs
mailing list