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

Leif Andersen leif.a.andersen at gmail.com
Sat May 29 05:34:36 CEST 2010


Revision: 29060
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29060
Author:   leifandersen
Date:     2010-05-29 05:34:06 +0200 (Sat, 29 May 2010)

Log Message:
-----------
1.  Created a psuedo hashfile file format.  Which is any text file, lines have to be formed as:

<hashname> = <hashcode>

# makes a comment, and whitespace is ignored.

2.  Added a submodule for the tests module that reads and writes to hashfile files.  No code uses these modules yet.  This means ctest can be run in the root of the build folder.

3.  Moved the ctest code from tests/CMakeLists.txt to CMakeLists.txt in the root directory, where I believe it belongs.

4.  Created a Demo Cdash dashboard for the project.  Not complete yet.  It can be found at: http://my.cdash.org/index.php?project=Leif-Blender, I think, that may be for projects you're only a member of.  Either way, it is supposedly a public dashboard.

5.  Added CMake/CTest code to talk to the CDash dashboard listed above.  Now, the command ctest -D Experimental will not only run the ctest, but it will submit it to the dashboard, and the results can be viewed from the dashboard, along with various components about your hardware/compiler/os/etc.

Modified Paths:
--------------
    branches/soc-2010-leifandersen/CMakeLists.txt
    branches/soc-2010-leifandersen/release/scripts/modules/tests/__init__.py
    branches/soc-2010-leifandersen/tests/CMakeLists.txt
    branches/soc-2010-leifandersen/tests/hashtests/scenes.py

Added Paths:
-----------
    branches/soc-2010-leifandersen/CTestConfig.cmake
    branches/soc-2010-leifandersen/release/scripts/modules/tests/hashfile.py
    branches/soc-2010-leifandersen/tests/hashtests/hashcodes.txt

Modified: branches/soc-2010-leifandersen/CMakeLists.txt
===================================================================
--- branches/soc-2010-leifandersen/CMakeLists.txt	2010-05-29 01:42:42 UTC (rev 29059)
+++ branches/soc-2010-leifandersen/CMakeLists.txt	2010-05-29 03:34:06 UTC (rev 29060)
@@ -706,4 +706,7 @@
 OPTION(WITH_TESTS "Includes a test suite for blender" ON)
 IF(WITH_TESTS)
 	ADD_SUBDIRECTORY(tests)
+	ENABLE_TESTING()
+	ADD_CUSTOM_TARGET(test COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS blender)
+	include(CTest)
 ENDIF(WITH_TESTS)

Added: branches/soc-2010-leifandersen/CTestConfig.cmake
===================================================================
--- branches/soc-2010-leifandersen/CTestConfig.cmake	                        (rev 0)
+++ branches/soc-2010-leifandersen/CTestConfig.cmake	2010-05-29 03:34:06 UTC (rev 29060)
@@ -0,0 +1,13 @@
+## This file should be placed in the root directory of your project.
+## Then modify the CMakeLists.txt file in the root directory of your
+## project to incorporate the testing dashboard.
+## # The following are required to uses Dart and the Cdash dashboard
+##   ENABLE_TESTING()
+##   INCLUDE(CTest)
+set(CTEST_PROJECT_NAME "Leif-Blender")
+set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
+
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "my.cdash.org")
+set(CTEST_DROP_LOCATION "/submit.php?project=Leif-Blender")
+set(CTEST_DROP_SITE_CDASH TRUE)

Modified: branches/soc-2010-leifandersen/release/scripts/modules/tests/__init__.py
===================================================================
--- branches/soc-2010-leifandersen/release/scripts/modules/tests/__init__.py	2010-05-29 01:42:42 UTC (rev 29059)
+++ branches/soc-2010-leifandersen/release/scripts/modules/tests/__init__.py	2010-05-29 03:34:06 UTC (rev 29060)
@@ -16,4 +16,4 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
-from tests import scenes, objects, meshes
+from tests import scenes, objects, meshes, hashfile

Added: branches/soc-2010-leifandersen/release/scripts/modules/tests/hashfile.py
===================================================================
--- branches/soc-2010-leifandersen/release/scripts/modules/tests/hashfile.py	                        (rev 0)
+++ branches/soc-2010-leifandersen/release/scripts/modules/tests/hashfile.py	2010-05-29 03:34:06 UTC (rev 29060)
@@ -0,0 +1,55 @@
+# coding: utf-8
+# ##### 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 #####
+__author__ = ["Leif Andersen"]
+__url__ = ("blenderartists.org", "www.blender.org")
+__version__ = "0.01"
+__bpydoc__ = """\
+
+A set of files for writing and reading into a hasfile format.  A line in hashfile format is: <name> = <hash_number>.  Hashfile format can have comments starting with #.  Hashfile data formats that are returned from reading this file is an array of tuples.  For example, the file:
+
+# Hashfile
+empty_scene = -1504849438355502056
+empty_mesh = 3297148919719683587
+
+is read in as:
+[['empty_scene', -1504849438355502056], ['empty_mesh', 3297148919719683587]]
+"""
+
+# Writes a hash file based on the path given, and the data tuple array given.
+def write(file, data):
+	file = open(file, 'w')
+	for tuple in data:
+		file.write(tuple[0]+" = "+str(tuple[1])+"\n")
+	file.close()
+	return
+
+# Creates a data tuple array of hashes based on the hashfile path given
+def read(file):
+	file = open(file, 'r')
+	line = file.readline()
+	data = []
+	while line != "":
+		while line.strip().startswith('#') or line.startswith("\n") or line.isspace():
+			line = file.readline()
+		split = line.split()
+		data.append([split[0],int(split[2])])
+		line = file.readline()
+	print(data)
+	file.close()
+	return data

Modified: branches/soc-2010-leifandersen/tests/CMakeLists.txt
===================================================================
--- branches/soc-2010-leifandersen/tests/CMakeLists.txt	2010-05-29 01:42:42 UTC (rev 29059)
+++ branches/soc-2010-leifandersen/tests/CMakeLists.txt	2010-05-29 03:34:06 UTC (rev 29060)
@@ -23,8 +23,6 @@
 # Contributor(s): Andrea Weikert, Leif Andersen.
 #
 # ***** END GPL LICENSE BLOCK *****
-ENABLE_TESTING()
-ADD_CUSTOM_TARGET(test COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS blender)
 
 ADD_SUBDIRECTORY(gtest)
 ADD_SUBDIRECTORY(pyunit)

Added: branches/soc-2010-leifandersen/tests/hashtests/hashcodes.txt
===================================================================
--- branches/soc-2010-leifandersen/tests/hashtests/hashcodes.txt	                        (rev 0)
+++ branches/soc-2010-leifandersen/tests/hashtests/hashcodes.txt	2010-05-29 03:34:06 UTC (rev 29060)
@@ -0,0 +1,3 @@
+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-29 01:42:42 UTC (rev 29059)
+++ branches/soc-2010-leifandersen/tests/hashtests/scenes.py	2010-05-29 03:34:06 UTC (rev 29060)
@@ -62,4 +62,4 @@
     return unittest.TestSuite([unittest.TestLoader().loadTestsFromTestCase(TestEmptyScene)])
 
 if __name__ == "__main__":
-    unittest.TextTestRunner(verbosity=2).run(suite())
+    unittest.TextTestRunner(verbosity=2).run(suite())
\ No newline at end of file





More information about the Bf-blender-cvs mailing list