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

Merge remote-tracking branch 'origin/master' into 11457_launch_scripts

parents 75667094 fb047181
No related branches found
No related tags found
No related merge requests found
Showing
with 128 additions and 88 deletions
...@@ -7,7 +7,6 @@ Framework/API ...@@ -7,7 +7,6 @@ Framework/API
Framework/Geometry Framework/Geometry
Framework/Kernel Framework/Kernel
Framework/DataObjects Framework/DataObjects
Framework/MDEvents
) )
set ( COMMONVATES_SETUP_DONE TRUE ) set ( COMMONVATES_SETUP_DONE TRUE )
...@@ -19,6 +19,46 @@ BUILDPKG=true ...@@ -19,6 +19,46 @@ BUILDPKG=true
cmake --version cmake --version
echo "SHA1=${sha1}" echo "SHA1=${sha1}"
###############################################################################
# Check job requirements from the name
###############################################################################
if [[ ${JOB_NAME} == *clean* ]]; then
CLEANBUILD=true
fi
if [[ ${JOB_NAME} == *debug* ]]; then
BUILD_CONFIG="Debug"
elif [[ ${JOB_NAME} == *relwithdbg* ]]; then
BUILD_CONFIG="RelWithDbg"
else
BUILD_CONFIG="Release"
fi
###############################################################################
# Setup the build directory
# For a clean build the entire thing is removed to guarantee it is clean. All
# other build types are assumed to be incremental and the following items
# are removed to ensure stale build objects don't interfere with each other:
# - build/bin/**: if libraries are removed from cmake they are not deleted
# from bin and can cause random failures
# - build/ExternalData/**: data files will change over time and removing
# the links helps keep it fresh
###############################################################################
BUILD_DIR=$WORKSPACE/build
if [ -z "$BUILD_DIR" ]; then
echo "Build directory not set. Cannot continue"
exit 1
fi
if [[ "$CLEANBUILD" == true ]]; then
rm -rf $BUILD_DIR
fi
if [ -d $BUILD_DIR ]; then
rm -rf $BUILD_DIR/bin $BUILD_DIR/ExternalData
else
mkdir $BUILD_DIR
fi
############################################################################### ###############################################################################
# Setup clang # Setup clang
############################################################################### ###############################################################################
...@@ -38,11 +78,11 @@ if [[ $USE_CLANG ]]; then ...@@ -38,11 +78,11 @@ if [[ $USE_CLANG ]]; then
export CXX=clang++ export CXX=clang++
#check if CMakeCache.txt exists and if so that the cxx compiler is clang++ #check if CMakeCache.txt exists and if so that the cxx compiler is clang++
#only needed with incremental builds. Clean builds delete this directory in a later step. #only needed with incremental builds. Clean builds delete this directory in a later step.
if [[ -e $WORKSPACE/build/CMakeCache.txt ]] && [[ ${JOB_NAME} != *clean* ]]; then if [[ -e $BUILD_DIR/CMakeCache.txt ]] && [[ ${JOB_NAME} != *clean* ]]; then
COMPILERFILEPATH=`grep 'CMAKE_CXX_COMPILER:FILEPATH' $WORKSPACE/build/CMakeCache.txt` COMPILERFILEPATH=`grep 'CMAKE_CXX_COMPILER:FILEPATH' $BUILD_DIR/CMakeCache.txt`
if [[ $COMPILERFILEPATH != *clang++* ]]; then if [[ $COMPILERFILEPATH != *clang++* ]]; then
# Removing the build directory entirely guarantees clang is used. # Removing the build directory entirely guarantees clang is used.
rm -rf $WORKSPACE/build rm -rf $BUILD_DIR
fi fi
fi fi
fi fi
...@@ -89,21 +129,6 @@ if [[ ${NODE_LABELS} == *rhel7* ]]; then ...@@ -89,21 +129,6 @@ if [[ ${NODE_LABELS} == *rhel7* ]]; then
ON_RHEL7=true ON_RHEL7=true
fi fi
###############################################################################
# Check job requirements from the name
###############################################################################
if [[ ${JOB_NAME} == *clean* ]]; then
CLEANBUILD=true
fi
if [[ -e $WORKSPACE/build/CMakeCache.txt ]]; then
# Temporary while the builds flick between old & new TestingTools locations
TESTINGTOOLS_DIR=$(grep 'Code/Mantid/TestingTools/cxxtest' $WORKSPACE/build/CMakeCache.txt || true)
if [ ! -z "$TESTINGTOOLS_DIR" ]; then
rm -fr $WORKSPACE/build
fi
fi
############################################################################### ###############################################################################
# Packaging options # Packaging options
############################################################################### ###############################################################################
...@@ -125,13 +150,9 @@ if [[ "$BUILDPKG" == true ]]; then ...@@ -125,13 +150,9 @@ if [[ "$BUILDPKG" == true ]]; then
fi fi
############################################################################### ###############################################################################
# Setup the build directory # Work in the build directory
############################################################################### ###############################################################################
if [[ "$CLEANBUILD" == true ]]; then cd $BUILD_DIR
rm -rf $WORKSPACE/build
fi
[ -d $WORKSPACE/build ] || mkdir $WORKSPACE/build
cd $WORKSPACE/build
############################################################################### ###############################################################################
# Clean up any artifacts from last build so that if it fails # Clean up any artifacts from last build so that if it fails
...@@ -139,17 +160,6 @@ cd $WORKSPACE/build ...@@ -139,17 +160,6 @@ cd $WORKSPACE/build
############################################################################### ###############################################################################
rm -f *.dmg *.rpm *.deb *.tar.gz rm -f *.dmg *.rpm *.deb *.tar.gz
###############################################################################
## Check the required build configuration
###############################################################################
if [[ ${JOB_NAME} == *debug* ]]; then
BUILD_CONFIG="Debug"
elif [[ ${JOB_NAME} == *relwithdbg* ]]; then
BUILD_CONFIG="RelWithDbg"
else
BUILD_CONFIG="Release"
fi
############################################################################### ###############################################################################
# CMake configuration # CMake configuration
############################################################################### ###############################################################################
......
...@@ -39,16 +39,31 @@ if not "%JOB_NAME%" == "%JOB_NAME:clean=%" ( ...@@ -39,16 +39,31 @@ if not "%JOB_NAME%" == "%JOB_NAME:clean=%" (
set BUILDPKG=yes set BUILDPKG=yes
) )
if EXIST %WORKSPACE%\build\CMakeCache.txt (
FINDSTR "Code/Mantid/TestingTools/cxxtest" %WORKSPACE%\build\CMakeCache.txt && (
rmdir /S /Q %WORKSPACE%\build
)
)
if not "%JOB_NAME%" == "%JOB_NAME:pull_requests=%" ( if not "%JOB_NAME%" == "%JOB_NAME:pull_requests=%" (
set BUILDPKG=yes set BUILDPKG=yes
) )
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Setup the build directory
:: For a clean build the entire thing is removed to guarantee it is clean. All
:: other build types are assumed to be incremental and the following items
:: are removed to ensure stale build objects don't interfere with each other:
:: - build/bin: if libraries are removed from cmake they are not deleted
:: from bin and can cause random failures
:: - build/ExternalData/**: data files will change over time and removing
:: the links helps keep it fresh
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set BUILD_DIR=%WORKSPACE%\build
if "%CLEANBUILD%" == "yes" (
rmdir /S /Q %BUILD_DIR%
)
if EXIST %BUILD_DIR% (
rmdir /S /Q %BUILD_DIR%\bin %BUILD_DIR%\ExternalData
) else (
md %BUILD_DIR%
)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Packaging options :: Packaging options
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
...@@ -57,14 +72,7 @@ if "%BUILDPKG%" == "yes" ( ...@@ -57,14 +72,7 @@ if "%BUILDPKG%" == "yes" (
set PACKAGE_DOCS=-DPACKAGE_DOCS=ON set PACKAGE_DOCS=-DPACKAGE_DOCS=ON
) )
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: cd %BUILD_DIR%
:: Setup the build directory
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
if "%CLEANBUILD%" == "yes" (
rmdir /S /Q %WORKSPACE%\build
)
md %WORKSPACE%\build
cd %WORKSPACE%\build
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Clean up any artifacts from last build so that if it fails :: Clean up any artifacts from last build so that if it fails
...@@ -132,7 +140,7 @@ if "%BUILDPKG%" == "yes" ( ...@@ -132,7 +140,7 @@ if "%BUILDPKG%" == "yes" (
if not "%JOB_NAME%"=="%JOB_NAME:pull_requests=%" ( if not "%JOB_NAME%"=="%JOB_NAME:pull_requests=%" (
:: Install package :: Install package
set SYSTEMTESTS_DIR=%WORKSPACE%\Code\Mantid\Testing\SystemTests set SYSTEMTESTS_DIR=%WORKSPACE%\Code\Mantid\Testing\SystemTests
python !SYSTEMTESTS_DIR!\scripts\mantidinstaller.py install %WORKSPACE%\build python !SYSTEMTESTS_DIR!\scripts\mantidinstaller.py install %BUILD_DIR%
::Remove user properties, disable instrument updating & usage reports and add data paths ::Remove user properties, disable instrument updating & usage reports and add data paths
del /Q C:\MantidInstall\bin\Mantid.user.properties del /Q C:\MantidInstall\bin\Mantid.user.properties
...@@ -144,13 +152,13 @@ if not "%JOB_NAME%"=="%JOB_NAME:pull_requests=%" ( ...@@ -144,13 +152,13 @@ if not "%JOB_NAME%"=="%JOB_NAME:pull_requests=%" (
echo datasearch.directories = !DATA_ROOT!/UnitTest;!DATA_ROOT!/DocTest;!WORKSPACE_UNIX_STYLE!/Code/Mantid/instrument >> C:\MantidInstall\bin\Mantid.user.properties echo datasearch.directories = !DATA_ROOT!/UnitTest;!DATA_ROOT!/DocTest;!WORKSPACE_UNIX_STYLE!/Code/Mantid/instrument >> C:\MantidInstall\bin\Mantid.user.properties
:: Run tests :: Run tests
cd %WORKSPACE%\build\docs cd %BUILD_DIR%\docs
C:\MantidInstall\bin\MantidPlot.exe -xq runsphinx_doctest.py C:\MantidInstall\bin\MantidPlot.exe -xq runsphinx_doctest.py
set RETCODE=!ERRORLEVEL! set RETCODE=!ERRORLEVEL!
:: Remove Mantid :: Remove Mantid
cd %WORKSPACE%\build cd %BUILD_DIR%
python !SYSTEMTESTS_DIR!\scripts\mantidinstaller.py uninstall %WORKSPACE%\build python !SYSTEMTESTS_DIR!\scripts\mantidinstaller.py uninstall %BUILD_DIR%
if !RETCODE! NEQ 0 exit /B 1 if !RETCODE! NEQ 0 exit /B 1
) )
...@@ -53,7 +53,7 @@ class IMDNode { ...@@ -53,7 +53,7 @@ class IMDNode {
*/ */
public: public:
virtual ~IMDNode(){}; virtual ~IMDNode(){}
//---------------- ISAVABLE //---------------- ISAVABLE
/**Return the pointer to the structure responsible for saving the box on disk /**Return the pointer to the structure responsible for saving the box on disk
* if the workspace occupies too much memory */ * if the workspace occupies too much memory */
......
...@@ -43,7 +43,6 @@ set ( SRC_FILES ...@@ -43,7 +43,6 @@ set ( SRC_FILES
src/ConvertAxisByFormula.cpp src/ConvertAxisByFormula.cpp
src/ConvertEmptyToTof.cpp src/ConvertEmptyToTof.cpp
src/ConvertFromDistribution.cpp src/ConvertFromDistribution.cpp
src/ConvertMDHistoToMatrixWorkspace.cpp
src/ConvertSpectrumAxis.cpp src/ConvertSpectrumAxis.cpp
src/ConvertSpectrumAxis2.cpp src/ConvertSpectrumAxis2.cpp
src/ConvertTableToMatrixWorkspace.cpp src/ConvertTableToMatrixWorkspace.cpp
...@@ -300,7 +299,6 @@ set ( INC_FILES ...@@ -300,7 +299,6 @@ set ( INC_FILES
inc/MantidAlgorithms/ConvertAxisByFormula.h inc/MantidAlgorithms/ConvertAxisByFormula.h
inc/MantidAlgorithms/ConvertEmptyToTof.h inc/MantidAlgorithms/ConvertEmptyToTof.h
inc/MantidAlgorithms/ConvertFromDistribution.h inc/MantidAlgorithms/ConvertFromDistribution.h
inc/MantidAlgorithms/ConvertMDHistoToMatrixWorkspace.h
inc/MantidAlgorithms/ConvertSpectrumAxis.h inc/MantidAlgorithms/ConvertSpectrumAxis.h
inc/MantidAlgorithms/ConvertSpectrumAxis2.h inc/MantidAlgorithms/ConvertSpectrumAxis2.h
inc/MantidAlgorithms/ConvertTableToMatrixWorkspace.h inc/MantidAlgorithms/ConvertTableToMatrixWorkspace.h
...@@ -568,7 +566,6 @@ set ( TEST_FILES ...@@ -568,7 +566,6 @@ set ( TEST_FILES
ConvertAxisByFormulaTest.h ConvertAxisByFormulaTest.h
ConvertEmptyToTofTest.h ConvertEmptyToTofTest.h
ConvertFromDistributionTest.h ConvertFromDistributionTest.h
ConvertMDHistoToMatrixWorkspaceTest.h
ConvertSpectrumAxis2Test.h ConvertSpectrumAxis2Test.h
ConvertSpectrumAxisTest.h ConvertSpectrumAxisTest.h
ConvertTableToMatrixWorkspaceTest.h ConvertTableToMatrixWorkspaceTest.h
......
...@@ -27,19 +27,19 @@ if ( CXXTEST_FOUND ) ...@@ -27,19 +27,19 @@ if ( CXXTEST_FOUND )
configure_file ( PlusMinusTest.in.h ${CMAKE_CURRENT_SOURCE_DIR}/MinusTest.h) configure_file ( PlusMinusTest.in.h ${CMAKE_CURRENT_SOURCE_DIR}/MinusTest.h)
# Make the rest of the tests # Make the rest of the tests
include_directories ( ../../CurveFitting/inc ../../DataHandling/inc ../../Nexus/inc ../../TestHelpers/inc ../../MDEvents/inc) include_directories ( ../../CurveFitting/inc ../../DataHandling/inc ../../Nexus/inc ../../TestHelpers/inc )
# This variable is used within the cxxtest_add_test macro to build these helper classes into the test executable. # This variable is used within the cxxtest_add_test macro to build these helper classes into the test executable.
# It will go out of scope at the end of this file so doesn't need un-setting # It will go out of scope at the end of this file so doesn't need un-setting
set ( TESTHELPER_SRCS ../../TestHelpers/src/TearDownWorld.cpp set ( TESTHELPER_SRCS ../../TestHelpers/src/TearDownWorld.cpp
../../TestHelpers/src/ComponentCreationHelper.cpp ../../TestHelpers/src/ComponentCreationHelper.cpp
../../TestHelpers/src/WorkspaceCreationHelper.cpp ../../TestHelpers/src/WorkspaceCreationHelper.cpp
../../TestHelpers/src/SANSInstrumentCreationHelper.cpp ../../TestHelpers/src/SANSInstrumentCreationHelper.cpp
../../TestHelpers/src/MDEventsTestHelper.cpp ../../TestHelpers/src/MDEventsTestHelper.cpp
../../TestHelpers/src/ScopedFileHelper.cpp ../../TestHelpers/src/ScopedFileHelper.cpp
) )
cxxtest_add_test ( AlgorithmsTest ${TEST_FILES} ) cxxtest_add_test ( AlgorithmsTest ${TEST_FILES} )
target_link_libraries ( AlgorithmsTest Algorithms DataHandling MDEvents ${GMOCK_LIBRARIES} ) target_link_libraries ( AlgorithmsTest Algorithms DataHandling ${GMOCK_LIBRARIES} )
add_dependencies ( AlgorithmsTest Crystal CurveFitting MDAlgorithms ) add_dependencies ( AlgorithmsTest Crystal CurveFitting )
add_dependencies ( FrameworkTests AlgorithmsTest ) add_dependencies ( FrameworkTests AlgorithmsTest )
# Test data # Test data
add_dependencies ( AlgorithmsTest StandardTestData ) add_dependencies ( AlgorithmsTest StandardTestData )
......
...@@ -8,21 +8,20 @@ ...@@ -8,21 +8,20 @@
#include "MantidKernel/UnitFactory.h" #include "MantidKernel/UnitFactory.h"
#include "MantidDataObjects/EventWorkspace.h" #include "MantidDataObjects/EventWorkspace.h"
#include "MantidDataObjects/PeaksWorkspace.h" #include "MantidDataObjects/PeaksWorkspace.h"
#include "MantidMDEvents/MDHistoWorkspace.h" #include "MantidDataObjects/MDHistoWorkspace.h"
#include "MantidTestHelpers/WorkspaceCreationHelper.h" #include "MantidTestHelpers/WorkspaceCreationHelper.h"
#include "MantidTestHelpers/MDEventsTestHelper.h" #include "MantidTestHelpers/MDEventsTestHelper.h"
#include "MantidDataObjects/Workspace2D.h" #include "MantidDataObjects/Workspace2D.h"
#include "MantidAlgorithms/CreatePeaksWorkspace.h" #include "MantidAlgorithms/CreatePeaksWorkspace.h"
#include "MantidAPI/MatrixWorkspace.h" #include "MantidAPI/MatrixWorkspace.h"
#include "MantidGeometry/Instrument.h" #include "MantidGeometry/Instrument.h"
#include "MantidMDEvents/MDBoxBase.h" #include "MantidDataObjects/MDBoxBase.h"
#include "MantidKernel/V3D.h" #include "MantidKernel/V3D.h"
using namespace Mantid::Algorithms; using namespace Mantid::Algorithms;
using namespace Mantid::API; using namespace Mantid::API;
using namespace Mantid::DataObjects; using namespace Mantid::DataObjects;
using namespace Mantid::Geometry; using namespace Mantid::Geometry;
using namespace Mantid::MDEvents;
class CheckWorkspacesMatchTest : public CxxTest::TestSuite class CheckWorkspacesMatchTest : public CxxTest::TestSuite
{ {
...@@ -218,8 +217,8 @@ public: ...@@ -218,8 +217,8 @@ public:
void testMDEvents_matches() void testMDEvents_matches()
{ {
if ( !checker.isInitialized() ) checker.initialize(); if ( !checker.isInitialized() ) checker.initialize();
MDEventWorkspace3Lean::sptr mdews1 = MDEventsTestHelper::makeFileBackedMDEW("mdev1", false); MDEventWorkspace3Lean::sptr mdews1 = MDEventsTestHelper::makeFakeMDEventWorkspace("mdev1");
MDEventWorkspace3Lean::sptr mdews2 = MDEventsTestHelper::makeFileBackedMDEW("mdev2", false); MDEventWorkspace3Lean::sptr mdews2 = MDEventsTestHelper::makeFakeMDEventWorkspace("mdev2");
TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1", boost::dynamic_pointer_cast<IMDWorkspace>(mdews1)) ); TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1", boost::dynamic_pointer_cast<IMDWorkspace>(mdews1)) );
TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2", boost::dynamic_pointer_cast<IMDWorkspace>(mdews2)) ); TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2", boost::dynamic_pointer_cast<IMDWorkspace>(mdews2)) );
TS_ASSERT( checker.execute() ); TS_ASSERT( checker.execute() );
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "MantidTestHelpers/WorkspaceCreationHelper.h" #include "MantidTestHelpers/WorkspaceCreationHelper.h"
#include "MantidTestHelpers/ComponentCreationHelper.h" #include "MantidTestHelpers/ComponentCreationHelper.h"
#include "MantidAPI/AnalysisDataService.h" #include "MantidAPI/AnalysisDataService.h"
#include "MantidMDEvents/MDEventFactory.h" #include "MantidDataObjects/MDEventFactory.h"
#include "MantidTestHelpers/MDEventsTestHelper.h" #include "MantidTestHelpers/MDEventsTestHelper.h"
#include "MantidGeometry/Instrument.h" #include "MantidGeometry/Instrument.h"
#include "MantidDataObjects/PeaksWorkspace.h" #include "MantidDataObjects/PeaksWorkspace.h"
...@@ -19,8 +19,7 @@ using namespace Mantid; ...@@ -19,8 +19,7 @@ using namespace Mantid;
using namespace Mantid::Geometry; using namespace Mantid::Geometry;
using namespace Mantid::API; using namespace Mantid::API;
using namespace Mantid::DataObjects; using namespace Mantid::DataObjects;
using namespace Mantid::MDEvents; using Mantid::DataObjects::MDEventsTestHelper::makeMDEW;
using Mantid::MDEvents::MDEventsTestHelper::makeMDEW;
class CloneWorkspaceTest : public CxxTest::TestSuite class CloneWorkspaceTest : public CxxTest::TestSuite
{ {
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "MantidAlgorithms/ConvertEmptyToTof.h" #include "MantidAlgorithms/ConvertEmptyToTof.h"
#include "MantidAPI/AnalysisDataService.h" #include "MantidAPI/AnalysisDataService.h"
#include "MantidAPI/FrameworkManager.h"
#include "MantidTestHelpers/WorkspaceCreationHelper.h" #include "MantidTestHelpers/WorkspaceCreationHelper.h"
#include "MantidDataObjects/Workspace2D.h" #include "MantidDataObjects/Workspace2D.h"
#include "MantidGeometry/Instrument/ComponentHelper.h" #include "MantidGeometry/Instrument/ComponentHelper.h"
...@@ -25,6 +26,10 @@ public: ...@@ -25,6 +26,10 @@ public:
delete suite; delete suite;
} }
ConvertEmptyToTofTest() {
FrameworkManager::Instance();
}
void test_Init() { void test_Init() {
ConvertEmptyToTof alg; ConvertEmptyToTof alg;
TS_ASSERT_THROWS_NOTHING(alg.initialize()) TS_ASSERT_THROWS_NOTHING(alg.initialize())
......
...@@ -2,9 +2,6 @@ ...@@ -2,9 +2,6 @@
#define MANTID_ALGORITHMS_COPYSAMPLETEST_H_ #define MANTID_ALGORITHMS_COPYSAMPLETEST_H_
#include <cxxtest/TestSuite.h> #include <cxxtest/TestSuite.h>
#include "MantidKernel/Timer.h"
#include <iostream>
#include <iomanip>
#include "MantidAlgorithms/CopySample.h" #include "MantidAlgorithms/CopySample.h"
#include "MantidDataObjects/WorkspaceSingleValue.h" #include "MantidDataObjects/WorkspaceSingleValue.h"
...@@ -16,9 +13,9 @@ ...@@ -16,9 +13,9 @@
#include "MantidGeometry/Instrument/ObjComponent.h" #include "MantidGeometry/Instrument/ObjComponent.h"
#include "MantidGeometry/Objects/Object.h" #include "MantidGeometry/Objects/Object.h"
#include "MantidMDEvents/MDEvent.h" #include "MantidDataObjects/MDEvent.h"
#include "MantidMDEvents/MDEventFactory.h" #include "MantidDataObjects/MDEventFactory.h"
#include "MantidMDEvents/MDEventWorkspace.h" #include "MantidDataObjects/MDEventWorkspace.h"
#include "MantidTestHelpers/ComponentCreationHelper.h" #include "MantidTestHelpers/ComponentCreationHelper.h"
using namespace Mantid; using namespace Mantid;
...@@ -27,7 +24,6 @@ using namespace Mantid::API; ...@@ -27,7 +24,6 @@ using namespace Mantid::API;
using namespace Mantid::DataObjects; using namespace Mantid::DataObjects;
using namespace Mantid::Geometry; using namespace Mantid::Geometry;
using namespace Mantid::Kernel; using namespace Mantid::Kernel;
using namespace Mantid::MDEvents;
class CopySampleTest : public CxxTest::TestSuite class CopySampleTest : public CxxTest::TestSuite
{ {
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <cxxtest/TestSuite.h> #include <cxxtest/TestSuite.h>
#include "MantidAPI/FrameworkManager.h"
#include "MantidGeometry/Instrument.h" #include "MantidGeometry/Instrument.h"
#include "MantidGeometry/IComponent.h" #include "MantidGeometry/IComponent.h"
#include "MantidGeometry/Instrument/ReferenceFrame.h" #include "MantidGeometry/Instrument/ReferenceFrame.h"
...@@ -25,6 +26,9 @@ public: ...@@ -25,6 +26,9 @@ public:
static CreateSampleWorkspaceTest *createSuite() { return new CreateSampleWorkspaceTest(); } static CreateSampleWorkspaceTest *createSuite() { return new CreateSampleWorkspaceTest(); }
static void destroySuite( CreateSampleWorkspaceTest *suite ) { delete suite; } static void destroySuite( CreateSampleWorkspaceTest *suite ) { delete suite; }
CreateSampleWorkspaceTest() {
FrameworkManager::Instance();
}
void test_Init() void test_Init()
{ {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>
#include "MantidAPI/FrameworkManager.h"
#include "MantidKernel/System.h" #include "MantidKernel/System.h"
#include "MantidAlgorithms/ConvertUnits.h" #include "MantidAlgorithms/ConvertUnits.h"
...@@ -24,6 +24,14 @@ using namespace Mantid::Kernel::Units; ...@@ -24,6 +24,14 @@ using namespace Mantid::Kernel::Units;
class ElasticWindowTest : public CxxTest::TestSuite class ElasticWindowTest : public CxxTest::TestSuite
{ {
public: public:
// This pair of boilerplate methods prevent the suite being created statically
// This means the constructor isn't called when running other tests
static ElasticWindowTest *createSuite() { return new ElasticWindowTest(); }
static void destroySuite( ElasticWindowTest *suite ) { delete suite; }
ElasticWindowTest() {
FrameworkManager::Instance();
}
void setUp() void setUp()
{ {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <algorithm> #include <algorithm>
#include "MantidAlgorithms/ReflectometryReductionOne.h" #include "MantidAlgorithms/ReflectometryReductionOne.h"
#include "MantidAPI/AlgorithmManager.h" #include "MantidAPI/AlgorithmManager.h"
#include "MantidAPI/FrameworkManager.h"
#include "MantidAPI/MatrixWorkspace.h" #include "MantidAPI/MatrixWorkspace.h"
#include "MantidTestHelpers/WorkspaceCreationHelper.h" #include "MantidTestHelpers/WorkspaceCreationHelper.h"
#include "MantidGeometry/Instrument/ReferenceFrame.h" #include "MantidGeometry/Instrument/ReferenceFrame.h"
...@@ -36,6 +37,7 @@ public: ...@@ -36,6 +37,7 @@ public:
ReflectometryReductionOneTest() ReflectometryReductionOneTest()
{ {
FrameworkManager::Instance();
m_tinyReflWS = create2DWorkspaceWithReflectometryInstrument(); m_tinyReflWS = create2DWorkspaceWithReflectometryInstrument();
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define MUONREMOVEEXPDECAYTEST_H_ #define MUONREMOVEEXPDECAYTEST_H_
#include <cxxtest/TestSuite.h> #include <cxxtest/TestSuite.h>
#include "MantidAPI/FrameworkManager.h"
#include "MantidAlgorithms/RemoveExpDecay.h" #include "MantidAlgorithms/RemoveExpDecay.h"
#include "MantidTestHelpers/WorkspaceCreationHelper.h" #include "MantidTestHelpers/WorkspaceCreationHelper.h"
...@@ -14,6 +14,15 @@ const std::string outputName = "MuonRemoveExpDecay_Output"; ...@@ -14,6 +14,15 @@ const std::string outputName = "MuonRemoveExpDecay_Output";
class RemoveExpDecayTest : public CxxTest::TestSuite class RemoveExpDecayTest : public CxxTest::TestSuite
{ {
public: public:
// This pair of boilerplate methods prevent the suite being created statically
// This means the constructor isn't called when running other tests
static RemoveExpDecayTest *createSuite() { return new RemoveExpDecayTest(); }
static void destroySuite( RemoveExpDecayTest *suite ) { delete suite; }
RemoveExpDecayTest() {
FrameworkManager::Instance();
}
void testInit() void testInit()
{ {
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "MantidAlgorithms/StripPeaks.h" #include "MantidAlgorithms/StripPeaks.h"
#include "MantidAPI/AnalysisDataService.h" #include "MantidAPI/AnalysisDataService.h"
#include "MantidAPI/FrameworkManager.h"
#include "MantidKernel/UnitFactory.h" #include "MantidKernel/UnitFactory.h"
using namespace Mantid::API; using namespace Mantid::API;
...@@ -20,6 +21,7 @@ public: ...@@ -20,6 +21,7 @@ public:
StripPeaksTest() StripPeaksTest()
{ {
FrameworkManager::Instance();
MatrixWorkspace_sptr WS = WorkspaceCreationHelper::Create2DWorkspaceBinned(2,200,0.5,0.02); MatrixWorkspace_sptr WS = WorkspaceCreationHelper::Create2DWorkspaceBinned(2,200,0.5,0.02);
WS->getAxis(0)->unit() = Mantid::Kernel::UnitFactory::Instance().create("dSpacing"); WS->getAxis(0)->unit() = Mantid::Kernel::UnitFactory::Instance().create("dSpacing");
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <cxxtest/TestSuite.h> #include <cxxtest/TestSuite.h>
#include "MantidAlgorithms/WienerSmooth.h" #include "MantidAlgorithms/WienerSmooth.h"
#include "MantidAPI/FrameworkManager.h"
#include "MantidAPI/WorkspaceFactory.h" #include "MantidAPI/WorkspaceFactory.h"
#include <algorithm> #include <algorithm>
...@@ -19,6 +20,10 @@ public: ...@@ -19,6 +20,10 @@ public:
static WienerSmoothTest *createSuite() { return new WienerSmoothTest(); } static WienerSmoothTest *createSuite() { return new WienerSmoothTest(); }
static void destroySuite( WienerSmoothTest *suite ) { delete suite; } static void destroySuite( WienerSmoothTest *suite ) { delete suite; }
WienerSmoothTest() {
FrameworkManager::Instance();
}
void test_Init() void test_Init()
{ {
...@@ -261,4 +266,4 @@ private: ...@@ -261,4 +266,4 @@ private:
}; };
#endif /* MANTID_ALGORITHMS_WIENERSMOOTHTEST_H_ */ #endif /* MANTID_ALGORITHMS_WIENERSMOOTHTEST_H_ */
\ No newline at end of file
...@@ -125,7 +125,6 @@ if ( CXXTEST_FOUND ) ...@@ -125,7 +125,6 @@ if ( CXXTEST_FOUND )
endif () endif ()
add_subdirectory (MDAlgorithms) add_subdirectory (MDAlgorithms)
add_subdirectory (MDEvents)
add_subdirectory (Doxygen) add_subdirectory (Doxygen)
add_subdirectory (ScriptRepository) add_subdirectory (ScriptRepository)
add_subdirectory (ISISLiveData) add_subdirectory (ISISLiveData)
...@@ -137,7 +136,7 @@ add_subdirectory (ISISLiveData) ...@@ -137,7 +136,7 @@ add_subdirectory (ISISLiveData)
set ( FRAMEWORK_LIBS Kernel Geometry API PythonKernelModule set ( FRAMEWORK_LIBS Kernel Geometry API PythonKernelModule
PythonGeometryModule PythonAPIModule DataObjects PythonGeometryModule PythonAPIModule DataObjects
DataHandling Nexus Algorithms CurveFitting ICat DataHandling Nexus Algorithms CurveFitting ICat
Crystal MDAlgorithms MDEvents WorkflowAlgorithms Crystal MDAlgorithms WorkflowAlgorithms
LiveData ISISLiveData RemoteAlgorithms SINQ LiveData ISISLiveData RemoteAlgorithms SINQ
) )
......
if ( CXXTEST_FOUND ) if ( CXXTEST_FOUND )
include_directories ( SYSTEM ${CXXTEST_INCLUDE_DIR} ${GMOCK_INCLUDE_DIR} ${GTEST_INCLUDE_DIR} ) include_directories ( SYSTEM ${CXXTEST_INCLUDE_DIR} ${GMOCK_INCLUDE_DIR} ${GTEST_INCLUDE_DIR} )
include_directories ( ../../DataHandling/inc ../../MDEvents/inc ../../TestHelpers/inc ) include_directories ( ../../DataHandling/inc ../../TestHelpers/inc )
# This variable is used within the cxxtest_add_test macro to build these helper classes into the test executable. # This variable is used within the cxxtest_add_test macro to build these helper classes into the test executable.
# It will go out of scope at the end of this file so doesn't need un-setting # It will go out of scope at the end of this file so doesn't need un-setting
set ( TESTHELPER_SRCS ../../TestHelpers/src/TearDownWorld.cpp set ( TESTHELPER_SRCS ../../TestHelpers/src/TearDownWorld.cpp
...@@ -9,7 +9,7 @@ if ( CXXTEST_FOUND ) ...@@ -9,7 +9,7 @@ if ( CXXTEST_FOUND )
../../TestHelpers/src/WorkspaceCreationHelper.cpp ../../TestHelpers/src/WorkspaceCreationHelper.cpp
../../TestHelpers/src/MDEventsTestHelper.cpp ) ../../TestHelpers/src/MDEventsTestHelper.cpp )
cxxtest_add_test ( CrystalTest ${TEST_FILES} ) cxxtest_add_test ( CrystalTest ${TEST_FILES} )
target_link_libraries ( CrystalTest Crystal DataHandling MDEvents MDAlgorithms ${GMOCK_LIBRARIES} ${GTEST_LIBRARIES}) target_link_libraries ( CrystalTest Crystal DataHandling MDAlgorithms ${GMOCK_LIBRARIES} ${GTEST_LIBRARIES})
add_dependencies ( CrystalTest Algorithms CurveFitting ) add_dependencies ( CrystalTest Algorithms CurveFitting )
add_dependencies ( FrameworkTests CrystalTest ) add_dependencies ( FrameworkTests CrystalTest )
# Test data # Test data
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
#include "MantidDataObjects/TableWorkspace.h" #include "MantidDataObjects/TableWorkspace.h"
using Mantid::Crystal::ClearUB; using Mantid::Crystal::ClearUB;
using namespace Mantid::MDEvents;
using namespace Mantid::API; using namespace Mantid::API;
using namespace Mantid::DataObjects;
using namespace Mantid::Geometry; using namespace Mantid::Geometry;
class ClearUBTest : public CxxTest::TestSuite class ClearUBTest : public CxxTest::TestSuite
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "MantidTestHelpers/MDEventsTestHelper.h" #include "MantidTestHelpers/MDEventsTestHelper.h"
#include "MantidTestHelpers/WorkspaceCreationHelper.h" #include "MantidTestHelpers/WorkspaceCreationHelper.h"
#include "MantidTestHelpers/ComponentCreationHelper.h" #include "MantidTestHelpers/ComponentCreationHelper.h"
#include "MantidAPI/FrameworkManager.h"
#include "MantidAPI/AlgorithmManager.h" #include "MantidAPI/AlgorithmManager.h"
#include "MantidAPI/Workspace.h" #include "MantidAPI/Workspace.h"
#include "MantidKernel/V3D.h" #include "MantidKernel/V3D.h"
...@@ -24,9 +23,8 @@ ...@@ -24,9 +23,8 @@
using namespace Mantid::API; using namespace Mantid::API;
using namespace Mantid::Kernel; using namespace Mantid::Kernel;
using namespace Mantid::MDEvents;
using namespace Mantid::Geometry;
using namespace Mantid::DataObjects; using namespace Mantid::DataObjects;
using namespace Mantid::Geometry;
// Helper typedef // Helper typedef
typedef boost::tuple<IMDHistoWorkspace_sptr, IPeaksWorkspace_sptr> MDHistoPeaksWSTuple; typedef boost::tuple<IMDHistoWorkspace_sptr, IPeaksWorkspace_sptr> MDHistoPeaksWSTuple;
......
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