[ovito] 08/10: Cherry-pick upstream fix for tests for builds without CrystanAnalysis

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Fri Jan 13 20:38:28 UTC 2017


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository ovito.

commit aec42f37f49dddf1824fdc3c3a3c4d52bb7212e6
Author: Ghislain Antony Vaillant <ghisvail at gmail.com>
Date:   Fri Jan 13 15:40:16 2017 +0000

    Cherry-pick upstream fix for tests for builds without CrystanAnalysis
    
    - New patch 0003-Fixing-issue-4-Tests-that-depend-on-the-CrystalAnaly.patch
    
    Gbp-Dch: full
---
 ...e-4-Tests-that-depend-on-the-CrystalAnaly.patch | 226 +++++++++++++++++++++
 debian/patches/series                              |   1 +
 2 files changed, 227 insertions(+)

diff --git a/debian/patches/0003-Fixing-issue-4-Tests-that-depend-on-the-CrystalAnaly.patch b/debian/patches/0003-Fixing-issue-4-Tests-that-depend-on-the-CrystalAnaly.patch
new file mode 100644
index 0000000..7459929
--- /dev/null
+++ b/debian/patches/0003-Fixing-issue-4-Tests-that-depend-on-the-CrystalAnaly.patch
@@ -0,0 +1,226 @@
+From: Alexander Stukowski <stukowski at mm.tu-darmstadt.de>
+Date: Mon, 9 Jan 2017 21:42:28 +0100
+Subject: Fixing issue #4: Tests that depend on the CrystalAnalysis module
+ fail when the module was disabled in the build.
+
+---
+ .../example_snippets/construct_surface_modifier.py |  3 ++
+ .../dislocation_analysis_modifier.py               |  3 ++
+ doc/python/example_snippets/surface_mesh.py        |  3 ++
+ src/plugins/CMakeLists.txt                         | 33 +++++++++++-----------
+ .../crystalanalysis/scripting/PythonInterface.cpp  |  9 ++++--
+ .../particles/scripting/PythonInterface.cpp        |  3 +-
+ src/plugins/pyscript/python/ovito/__init__.py      |  1 +
+ .../test_suite/construct_surface_modifier.py       |  3 ++
+ .../test_suite/dislocation_analysis_modifier.py    |  3 ++
+ .../elastic_strain_calculation_modifier.py         |  3 ++
+ 10 files changed, 44 insertions(+), 20 deletions(-)
+
+diff --git a/doc/python/example_snippets/construct_surface_modifier.py b/doc/python/example_snippets/construct_surface_modifier.py
+index 67ceeba5..f51e45dd 100644
+--- a/doc/python/example_snippets/construct_surface_modifier.py
++++ b/doc/python/example_snippets/construct_surface_modifier.py
+@@ -1,3 +1,6 @@
++import sys
++if "ovito.modifiers.crystalanalysis" not in sys.modules: sys.exit()
++
+ from ovito.io import import_file
+ from ovito.modifiers import ConstructSurfaceModifier
+ 
+diff --git a/doc/python/example_snippets/dislocation_analysis_modifier.py b/doc/python/example_snippets/dislocation_analysis_modifier.py
+index 8affc158..b9d98164 100644
+--- a/doc/python/example_snippets/dislocation_analysis_modifier.py
++++ b/doc/python/example_snippets/dislocation_analysis_modifier.py
+@@ -1,3 +1,6 @@
++import sys
++if "ovito.modifiers.crystalanalysis" not in sys.modules: sys.exit()
++
+ from ovito.io import import_file, export_file
+ from ovito.modifiers import DislocationAnalysisModifier
+ 
+diff --git a/doc/python/example_snippets/surface_mesh.py b/doc/python/example_snippets/surface_mesh.py
+index e5934c86..26ccdc47 100644
+--- a/doc/python/example_snippets/surface_mesh.py
++++ b/doc/python/example_snippets/surface_mesh.py
+@@ -1,3 +1,6 @@
++import sys
++if "ovito.modifiers.crystalanalysis" not in sys.modules: sys.exit()
++
+ from ovito.io import import_file
+ from ovito.modifiers import ConstructSurfaceModifier
+ 
+diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt
+index dd9a8cc5..7bf9af27 100755
+--- a/src/plugins/CMakeLists.txt
++++ b/src/plugins/CMakeLists.txt
+@@ -19,62 +19,63 @@
+ #
+ ###############################################################################
+ 
+-# Create the plugins directory.
+-FILE(MAKE_DIRECTORY ${OVITO_PLUGINS_DIRECTORY})
++# Create the plugins library and manifest directories.
++FILE(MAKE_DIRECTORY "${OVITO_PLUGINS_DIRECTORY}")
++FILE(MAKE_DIRECTORY "${OVITO_PLUGIN_MANIFESTS_DIRECTORY}")
+ 
+ IF(OVITO_BUILD_PLUGIN_PYSCRIPT)
+ 	ADD_SUBDIRECTORY(pyscript)
+ 	SET(OVITOS_EXECUTABLE ${OVITOS_EXECUTABLE} PARENT_SCOPE)
+ ELSE()
+-	FILE(REMOVE ${OVITO_PLUGINS_DIRECTORY}/PyScript.json)
+-	FILE(REMOVE ${OVITO_PLUGINS_DIRECTORY}/PyScriptGui.json)
++	FILE(REMOVE ${OVITO_PLUGIN_MANIFESTS_DIRECTORY}/PyScript.json)
++	FILE(REMOVE ${OVITO_PLUGIN_MANIFESTS_DIRECTORY}/PyScriptGui.json)
+ ENDIF()
+ 
+ IF(OVITO_BUILD_PLUGIN_PARTICLES)
+ 	ADD_SUBDIRECTORY(particles)
+ ELSE()
+-	FILE(REMOVE ${OVITO_PLUGINS_DIRECTORY}/Particles.json)
+-	FILE(REMOVE ${OVITO_PLUGINS_DIRECTORY}/ParticlesGui.json)
++	FILE(REMOVE ${OVITO_PLUGIN_MANIFESTS_DIRECTORY}/Particles.json)
++	FILE(REMOVE ${OVITO_PLUGIN_MANIFESTS_DIRECTORY}/ParticlesGui.json)
+ ENDIF()
+ 
+ IF(OVITO_BUILD_PLUGIN_TACHYON)
+ 	ADD_SUBDIRECTORY(tachyon)
+ ELSE()
+-	FILE(REMOVE ${OVITO_PLUGINS_DIRECTORY}/Tachyon.json)
+-	FILE(REMOVE ${OVITO_PLUGINS_DIRECTORY}/TachyonGui.json)
++	FILE(REMOVE ${OVITO_PLUGIN_MANIFESTS_DIRECTORY}/Tachyon.json)
++	FILE(REMOVE ${OVITO_PLUGIN_MANIFESTS_DIRECTORY}/TachyonGui.json)
+ ENDIF()
+ 
+ IF(OVITO_BUILD_PLUGIN_MESH)
+ 	ADD_SUBDIRECTORY(mesh)
+ ELSE()
+-	FILE(REMOVE ${OVITO_PLUGINS_DIRECTORY}/Mesh.json)
++	FILE(REMOVE ${OVITO_PLUGIN_MANIFESTS_DIRECTORY}/Mesh.json)
+ ENDIF()
+ 
+ IF(OVITO_BUILD_PLUGIN_CRYSTALANALYSIS)
+ 	ADD_SUBDIRECTORY(crystalanalysis)
+ ELSE()
+-	FILE(REMOVE ${OVITO_PLUGINS_DIRECTORY}/CrystalAnalysis.json)
+-	FILE(REMOVE ${OVITO_PLUGINS_DIRECTORY}/CrystalAnalysisGui.json)
++	FILE(REMOVE ${OVITO_PLUGIN_MANIFESTS_DIRECTORY}/CrystalAnalysis.json)
++	FILE(REMOVE ${OVITO_PLUGIN_MANIFESTS_DIRECTORY}/CrystalAnalysisGui.json)
+ ENDIF()
+ 
+ IF(OVITO_BUILD_PLUGIN_NETCDFPLUGIN)
+ 	ADD_SUBDIRECTORY(netcdf)
+ ELSE()
+-	FILE(REMOVE ${OVITO_PLUGINS_DIRECTORY}/NetCDFPlugin.json)
+-	FILE(REMOVE ${OVITO_PLUGINS_DIRECTORY}/NetCDFPluginGui.json)
++	FILE(REMOVE ${OVITO_PLUGIN_MANIFESTS_DIRECTORY}/NetCDFPlugin.json)
++	FILE(REMOVE ${OVITO_PLUGIN_MANIFESTS_DIRECTORY}/NetCDFPluginGui.json)
+ ENDIF()
+ 
+ IF(OVITO_BUILD_PLUGIN_POVRAY)
+ 	ADD_SUBDIRECTORY(povray)
+ ELSE()
+-	FILE(REMOVE ${OVITO_PLUGINS_DIRECTORY}/POVRay.json)
+-	FILE(REMOVE ${OVITO_PLUGINS_DIRECTORY}/POVRayGui.json)
++	FILE(REMOVE ${OVITO_PLUGIN_MANIFESTS_DIRECTORY}/POVRay.json)
++	FILE(REMOVE ${OVITO_PLUGIN_MANIFESTS_DIRECTORY}/POVRayGui.json)
+ ENDIF()
+ 
+ IF(OVITO_BUILD_PLUGIN_OPENBABELPLUGIN)
+ 	ADD_SUBDIRECTORY(openbabel)
+ ELSE()
+-	FILE(REMOVE ${OVITO_PLUGINS_DIRECTORY}/OpenBabelPlugin.json)
++	FILE(REMOVE ${OVITO_PLUGIN_MANIFESTS_DIRECTORY}/OpenBabelPlugin.json)
+ ENDIF()
+ 
+ # Propagate list of plugins to parent scope.
+diff --git a/src/plugins/crystalanalysis/scripting/PythonInterface.cpp b/src/plugins/crystalanalysis/scripting/PythonInterface.cpp
+index ab27d960..eb310ed2 100755
+--- a/src/plugins/crystalanalysis/scripting/PythonInterface.cpp
++++ b/src/plugins/crystalanalysis/scripting/PythonInterface.cpp
+@@ -74,7 +74,8 @@ PYBIND11_PLUGIN(CrystalAnalysis)
+ 			"   The volume of the solid region bounded by the surface mesh.\n"
+ 			"\n\n"
+ 			"Example:\n\n"
+-			".. literalinclude:: ../example_snippets/construct_surface_modifier.py"
++			".. literalinclude:: ../example_snippets/construct_surface_modifier.py\n"
++			"   :lines: 4-\n"
+ 			)
+ 		.def_property("radius", &ConstructSurfaceModifier::probeSphereRadius, &ConstructSurfaceModifier::setProbeSphereRadius,
+ 				"The radius of the probe sphere used in the surface construction algorithm."
+@@ -142,7 +143,8 @@ PYBIND11_PLUGIN(CrystalAnalysis)
+ 			"   The number of particles with local hexagonal diamond structure.\n"
+ 			"\n\n"
+ 			"Example:\n\n"
+-			".. literalinclude:: ../example_snippets/dislocation_analysis_modifier.py"
++			".. literalinclude:: ../example_snippets/dislocation_analysis_modifier.py\n"
++			"   :lines: 4-\n"
+ 			)
+ 		.def_property("trial_circuit_length", &DislocationAnalysisModifier::maxTrialCircuitSize, &DislocationAnalysisModifier::setMaxTrialCircuitSize,
+ 				"The maximum length of trial Burgers circuits constructed by the DXA to discover dislocations. "
+@@ -377,7 +379,8 @@ PYBIND11_PLUGIN(CrystalAnalysis)
+ 			"the :py:attr:`~DataObject.display` attribute of the :py:class:`~DataObject` base class."
+ 			"\n\n"
+ 			"Example:\n\n"
+-			".. literalinclude:: ../example_snippets/dislocation_analysis_modifier.py",
++			".. literalinclude:: ../example_snippets/dislocation_analysis_modifier.py\n"
++			"   :lines: 4-\n",
+ 			// Python class name:
+ 			"DislocationNetwork")
+ 
+diff --git a/src/plugins/particles/scripting/PythonInterface.cpp b/src/plugins/particles/scripting/PythonInterface.cpp
+index 231dbf8e..530659c4 100755
+--- a/src/plugins/particles/scripting/PythonInterface.cpp
++++ b/src/plugins/particles/scripting/PythonInterface.cpp
+@@ -669,7 +669,8 @@ PYBIND11_PLUGIN(Particles)
+ 			"of the :py:class:`~ovito.modifiers.ConstructSurfaceModifier` that created the surface mesh."
+ 			"\n\n"
+ 			"Example:\n\n"
+-			".. literalinclude:: ../example_snippets/surface_mesh.py"
++			".. literalinclude:: ../example_snippets/surface_mesh.py\n"
++			"   :lines: 4-\n"
+ 		)
+ 		.def_property("is_completely_solid", &SurfaceMesh::isCompletelySolid, &SurfaceMesh::setCompletelySolid)
+ 		.def("export_vtk", [](SurfaceMesh& mesh, const QString& filename, SimulationCellObject* simCellObj) {
+diff --git a/src/plugins/pyscript/python/ovito/__init__.py b/src/plugins/pyscript/python/ovito/__init__.py
+index dbc9b9f1..c7b889df 100644
+--- a/src/plugins/pyscript/python/ovito/__init__.py
++++ b/src/plugins/pyscript/python/ovito/__init__.py
+@@ -1,4 +1,5 @@
+ import os.path
++import sys
+ try:
+     # Python 3.x
+     import collections.abc as collections
+diff --git a/tests/scripts/test_suite/construct_surface_modifier.py b/tests/scripts/test_suite/construct_surface_modifier.py
+index 7cda4a8f..ad57023d 100644
+--- a/tests/scripts/test_suite/construct_surface_modifier.py
++++ b/tests/scripts/test_suite/construct_surface_modifier.py
+@@ -1,3 +1,6 @@
++import sys
++if "ovito.modifiers.crystalanalysis" not in sys.modules: sys.exit()
++
+ from ovito import *
+ from ovito.io import *
+ from ovito.modifiers import *
+diff --git a/tests/scripts/test_suite/dislocation_analysis_modifier.py b/tests/scripts/test_suite/dislocation_analysis_modifier.py
+index 033b5f73..6b246559 100644
+--- a/tests/scripts/test_suite/dislocation_analysis_modifier.py
++++ b/tests/scripts/test_suite/dislocation_analysis_modifier.py
+@@ -1,3 +1,6 @@
++import sys
++if "ovito.modifiers.crystalanalysis" not in sys.modules: sys.exit()
++
+ from ovito import *
+ from ovito.io import *
+ from ovito.modifiers import *
+diff --git a/tests/scripts/test_suite/elastic_strain_calculation_modifier.py b/tests/scripts/test_suite/elastic_strain_calculation_modifier.py
+index b3047cee..a44741e3 100644
+--- a/tests/scripts/test_suite/elastic_strain_calculation_modifier.py
++++ b/tests/scripts/test_suite/elastic_strain_calculation_modifier.py
+@@ -1,3 +1,6 @@
++import sys
++if "ovito.modifiers.crystalanalysis" not in sys.modules: sys.exit()
++
+ from ovito import *
+ from ovito.io import *
+ from ovito.data import *
diff --git a/debian/patches/series b/debian/patches/series
index 52fe7d2..d92b3b4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 0001-Disable-povray-test.patch
 0002-Fixing-issue-3-Test-suite-can-fail-when-executed-in-.patch
+0003-Fixing-issue-4-Tests-that-depend-on-the-CrystalAnaly.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/ovito.git



More information about the debian-science-commits mailing list