Commit 2bc4f259 authored by Brian Panneton's avatar Brian Panneton
Browse files

FIX: Corrected accessing Version from Python

Example: XdmfVersion.getFull() returns a version string 'Xdmf 2.0'
         XdmfVersion.getShort() returns a version string '2.0'
         XdmfVersion.getMajor() returns an int for major '2'
         XdmfVersion.getMinor() returns an int for minor '0'
parent 913d4650
......@@ -23,6 +23,9 @@ swig -v -c++ -python -o XdmfCorePython.cpp XdmfCore.i
#include <XdmfSystemUtils.hpp>
#include <XdmfVisitor.hpp>
#include <XdmfWriter.hpp>
#include <ProjectVersion.hpp>
#include <XdmfVersion.hpp>
%}
#ifdef SWIGJAVA
......@@ -288,7 +291,6 @@ swig -v -c++ -python -o XdmfCorePython.cpp XdmfCore.i
%include XdmfItem.hpp
%include XdmfItemProperty.hpp
%include XdmfVisitor.hpp
%include XdmfHeavyDataController.hpp
%include XdmfHeavyDataWriter.hpp
......@@ -299,6 +301,15 @@ swig -v -c++ -python -o XdmfCorePython.cpp XdmfCore.i
%include XdmfHDF5Writer.hpp
%include XdmfWriter.hpp
%include CMake/VersionSuite/ProjectVersion.hpp
%include XdmfVersion.hpp
#ifdef SWIGPYTHON
%pythoncode
{
XdmfVersion = _XdmfCore.cvar.XdmfVersion
};
#endif
#ifdef XDMF_BUILD_DSM
%include XdmfHDF5ControllerDSM.hpp
%include XdmfHDF5WriterDSM.hpp
......
......@@ -14,6 +14,7 @@ ADD_TEST_PYTHON_PYTHONPATH("${CMAKE_BINARY_DIR}")
# ---------------------
ADD_TEST_PYTHON(TestXdmfArray)
ADD_TEST_PYTHON(TestXdmfEquals)
ADD_TEST_PYTHON(TestXdmfVersion)
# Add any python cleanup here:
# Note: We don't want to use a foreach loop to test the files incase we
......@@ -22,6 +23,7 @@ ADD_TEST_PYTHON(TestXdmfEquals)
# ---------------------------------------
CLEAN_TEST_PYTHON(TestXdmfArray)
CLEAN_TEST_PYTHON(TestXdmfEquals)
CLEAN_TEST_PYTHON(TestXdmfVersion)
# Add a custom target for all python tests
# Note: ${TARGETS} is set in ADD_TEST_PYTHON
......
from XdmfCore import *
if __name__ == "__main__":
print XdmfVersion.getFull()
print XdmfVersion.getShort()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment