Skip to content
Snippets Groups Projects
Commit 6d252e62 authored by Peterson, Peter's avatar Peterson, Peter
Browse files

First set of python tests. Refs #1881.

parent f7ef059c
Branches add_pycharm_environment_file
No related tags found
No related merge requests found
......@@ -18,6 +18,8 @@ set ( INC_FILES inc/MantidPythonAPI/api_exports.h
set ( TEST_FILES test/PythonFrameworkTests.h
test/SimplePythonAPITest.h )
set ( TEST_PY_FILES test/ImportTest.py )
# Add local dependencies
set ( Boost_USE_DEBUG_PYTHON TRUE )
find_package ( Boost REQUIRED python )
......@@ -66,9 +68,6 @@ foreach ( PYFILE ${PYTHON_INSTALL_FILES} )
)
endforeach ( PYFILE ${PYTHON_INSTALL_FILES} )
add_test ( NAME PythonAPITest_import
COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_BINARY_DIR}/bin"
${PYTHON_EXECUTABLE} -c "from MantidFramework import mtd" )
if ( CXXTEST_FOUND )
include_directories ( ../DataHandling/inc ../DataObjects/inc ../TestHelpers/inc)
cxxtest_add_test ( PythonAPITest ${TEST_FILES} )
......@@ -77,3 +76,10 @@ if ( CXXTEST_FOUND )
# Add to the 'FrameworkTests' group in VS
set_property ( TARGET PythonAPITest PROPERTY FOLDER "FrameworkTests" )
endif ()
# python unit tests
if (PYUNITTEST_FOUND)
pyunittest_add_test ( VanillaPythonTest.py ${TEST_PY_FILES} )
add_dependencies ( VanillaPythonTest.py PythonAPI )
add_dependencies ( FrameworkTests VanillaPythonTest.py )
endif ()
import unittest
class ImportTest(unittest.TestCase):
def test_import(self):
from MantidFramework import mtd
mtd.initialise()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment