Skip to content

Commit

Permalink
Refs #4316 enabled MantidPlot python test
Browse files Browse the repository at this point in the history
  • Loading branch information
Janik Zikovsky committed Dec 22, 2011
1 parent 2e2e44d commit b5152a1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Code/Mantid/MantidPlot/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,10 @@ set ( MANTIDPLOT_TEST_PY_FILES

# Make a ctest target for each file
foreach ( PYFILE ${MANTIDPLOT_TEST_PY_FILES} )
# ADD_TEST( ${PYFILE} ${CMAKE_BINARY_DIR}/${BIN_DIR}/MantidPlot -xq ${CMAKE_CURRENT_SOURCE_DIR}/test/${PYFILE} )
# Add the test. Name of test = name of the file
ADD_TEST( ${PYFILE} ${CMAKE_BINARY_DIR}/${BIN_DIR}/MantidPlot -x ${CMAKE_CURRENT_SOURCE_DIR}/test/${PYFILE} )
# Add an environment property so that the script can find the source of xmlrunner
set_tests_properties( ${PYFILE} PROPERTIES ENVIRONMENT "MANTID_SOURCE=${CMAKE_SOURCE_DIR}")
endforeach ()

###########################################################################
Expand Down
14 changes: 11 additions & 3 deletions Code/Mantid/MantidPlot/test/MantidPlotSliceViewerTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
this in the future?
"""
import sys
import sys
import os
import unittest
import time
from PyQt4 import Qt


CreateMDWorkspace(Dimensions='3',Extents='0,10,0,10,0,10',Names='x,y,z',Units='m,m,m',SplitInto='5',MaxRecursionDepth='20',OutputWorkspace='mdw')
FakeMDEventData("mdw", UniformParams="1e5")
FakeMDEventData("mdw", PeakParams="1e4, 2,4,6, 1.5")
Expand Down Expand Up @@ -83,4 +81,14 @@ def test_getSliceViewer_failure(self):
# Custom code to create and run this single test suite
suite = unittest.TestSuite()
suite.addTest( unittest.makeSuite(MantidPlotSliceViewerTest) )
unittest.TextTestRunner().run(suite)
# Get the XML runner if the environment variable was set
src = os.getenv('MANTID_SOURCE')
if src is None:
runner = unittest.TextTestRunner()
else:
sys.path.append( os.path.join(src, "TestingTools/unittest-xml-reporting/src") )
import xmlrunner
runner = xmlrunner.XMLTestRunner(output='Testing')
#Run using either runner
runner.run(suite)

0 comments on commit b5152a1

Please sign in to comment.