Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 11467_fix_leaks_in_…
Browse files Browse the repository at this point in the history
…ComputeResourInfo_XML_parsing
  • Loading branch information
FedeMPouzols committed Apr 1, 2015
2 parents 9e5fea3 + 1580f5a commit 58cabf6
Show file tree
Hide file tree
Showing 443 changed files with 4,468 additions and 4,786 deletions.
1 change: 0 additions & 1 deletion Code/Mantid/Build/CMake/CommonVatesSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Framework/API
Framework/Geometry
Framework/Kernel
Framework/DataObjects
Framework/MDEvents
)

set ( COMMONVATES_SETUP_DONE TRUE )
80 changes: 45 additions & 35 deletions Code/Mantid/Build/Jenkins/buildscript
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,46 @@ BUILDPKG=true
cmake --version
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
###############################################################################
Expand All @@ -38,11 +78,11 @@ if [[ $USE_CLANG ]]; then
export CXX=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.
if [[ -e $WORKSPACE/build/CMakeCache.txt ]] && [[ ${JOB_NAME} != *clean* ]]; then
COMPILERFILEPATH=`grep 'CMAKE_CXX_COMPILER:FILEPATH' $WORKSPACE/build/CMakeCache.txt`
if [[ -e $BUILD_DIR/CMakeCache.txt ]] && [[ ${JOB_NAME} != *clean* ]]; then
COMPILERFILEPATH=`grep 'CMAKE_CXX_COMPILER:FILEPATH' $BUILD_DIR/CMakeCache.txt`
if [[ $COMPILERFILEPATH != *clang++* ]]; then
# Removing the build directory entirely guarantees clang is used.
rm -rf $WORKSPACE/build
rm -rf $BUILD_DIR
fi
fi
fi
Expand Down Expand Up @@ -89,21 +129,6 @@ if [[ ${NODE_LABELS} == *rhel7* ]]; then
ON_RHEL7=true
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
###############################################################################
Expand All @@ -125,31 +150,16 @@ if [[ "$BUILDPKG" == true ]]; then
fi

###############################################################################
# Setup the build directory
# Work in the build directory
###############################################################################
if [[ "$CLEANBUILD" == true ]]; then
rm -rf $WORKSPACE/build
fi
[ -d $WORKSPACE/build ] || mkdir $WORKSPACE/build
cd $WORKSPACE/build
cd $BUILD_DIR

###############################################################################
# Clean up any artifacts from last build so that if it fails
# they don't get archived again
###############################################################################
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
###############################################################################
Expand Down
44 changes: 26 additions & 18 deletions Code/Mantid/Build/Jenkins/buildscript.bat
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,31 @@ if not "%JOB_NAME%" == "%JOB_NAME:clean=%" (
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=%" (
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
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Expand All @@ -57,14 +72,7 @@ if "%BUILDPKG%" == "yes" (
set PACKAGE_DOCS=-DPACKAGE_DOCS=ON
)

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Setup the build directory
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
if "%CLEANBUILD%" == "yes" (
rmdir /S /Q %WORKSPACE%\build
)
md %WORKSPACE%\build
cd %WORKSPACE%\build
cd %BUILD_DIR%

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Clean up any artifacts from last build so that if it fails
Expand Down Expand Up @@ -132,7 +140,7 @@ if "%BUILDPKG%" == "yes" (
if not "%JOB_NAME%"=="%JOB_NAME:pull_requests=%" (
:: Install package
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
del /Q C:\MantidInstall\bin\Mantid.user.properties
Expand All @@ -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

:: Run tests
cd %WORKSPACE%\build\docs
cd %BUILD_DIR%\docs
C:\MantidInstall\bin\MantidPlot.exe -xq runsphinx_doctest.py
set RETCODE=!ERRORLEVEL!

:: Remove Mantid
cd %WORKSPACE%\build
python !SYSTEMTESTS_DIR!\scripts\mantidinstaller.py uninstall %WORKSPACE%\build
cd %BUILD_DIR%
python !SYSTEMTESTS_DIR!\scripts\mantidinstaller.py uninstall %BUILD_DIR%
if !RETCODE! NEQ 0 exit /B 1
)

2 changes: 1 addition & 1 deletion Code/Mantid/Framework/API/inc/MantidAPI/IMDNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class IMDNode {
*/

public:
virtual ~IMDNode(){};
virtual ~IMDNode(){}
//---------------- ISAVABLE
/**Return the pointer to the structure responsible for saving the box on disk
* if the workspace occupies too much memory */
Expand Down
3 changes: 0 additions & 3 deletions Code/Mantid/Framework/Algorithms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ set ( SRC_FILES
src/ConvertAxisByFormula.cpp
src/ConvertEmptyToTof.cpp
src/ConvertFromDistribution.cpp
src/ConvertMDHistoToMatrixWorkspace.cpp
src/ConvertSpectrumAxis.cpp
src/ConvertSpectrumAxis2.cpp
src/ConvertTableToMatrixWorkspace.cpp
Expand Down Expand Up @@ -300,7 +299,6 @@ set ( INC_FILES
inc/MantidAlgorithms/ConvertAxisByFormula.h
inc/MantidAlgorithms/ConvertEmptyToTof.h
inc/MantidAlgorithms/ConvertFromDistribution.h
inc/MantidAlgorithms/ConvertMDHistoToMatrixWorkspace.h
inc/MantidAlgorithms/ConvertSpectrumAxis.h
inc/MantidAlgorithms/ConvertSpectrumAxis2.h
inc/MantidAlgorithms/ConvertTableToMatrixWorkspace.h
Expand Down Expand Up @@ -568,7 +566,6 @@ set ( TEST_FILES
ConvertAxisByFormulaTest.h
ConvertEmptyToTofTest.h
ConvertFromDistributionTest.h
ConvertMDHistoToMatrixWorkspaceTest.h
ConvertSpectrumAxis2Test.h
ConvertSpectrumAxisTest.h
ConvertTableToMatrixWorkspaceTest.h
Expand Down
8 changes: 4 additions & 4 deletions Code/Mantid/Framework/Algorithms/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ if ( CXXTEST_FOUND )
configure_file ( PlusMinusTest.in.h ${CMAKE_CURRENT_SOURCE_DIR}/MinusTest.h)

# 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.
# 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
../../TestHelpers/src/ComponentCreationHelper.cpp
../../TestHelpers/src/WorkspaceCreationHelper.cpp
../../TestHelpers/src/SANSInstrumentCreationHelper.cpp
../../TestHelpers/src/MDEventsTestHelper.cpp
../../TestHelpers/src/MDEventsTestHelper.cpp
../../TestHelpers/src/ScopedFileHelper.cpp
)
cxxtest_add_test ( AlgorithmsTest ${TEST_FILES} )
target_link_libraries ( AlgorithmsTest Algorithms DataHandling MDEvents ${GMOCK_LIBRARIES} )
add_dependencies ( AlgorithmsTest Crystal CurveFitting MDAlgorithms )
target_link_libraries ( AlgorithmsTest Algorithms DataHandling ${GMOCK_LIBRARIES} )
add_dependencies ( AlgorithmsTest Crystal CurveFitting )
add_dependencies ( FrameworkTests AlgorithmsTest )
# Test data
add_dependencies ( AlgorithmsTest StandardTestData )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,20 @@
#include "MantidKernel/UnitFactory.h"
#include "MantidDataObjects/EventWorkspace.h"
#include "MantidDataObjects/PeaksWorkspace.h"
#include "MantidMDEvents/MDHistoWorkspace.h"
#include "MantidDataObjects/MDHistoWorkspace.h"
#include "MantidTestHelpers/WorkspaceCreationHelper.h"
#include "MantidTestHelpers/MDEventsTestHelper.h"
#include "MantidDataObjects/Workspace2D.h"
#include "MantidAlgorithms/CreatePeaksWorkspace.h"
#include "MantidAPI/MatrixWorkspace.h"
#include "MantidGeometry/Instrument.h"
#include "MantidMDEvents/MDBoxBase.h"
#include "MantidDataObjects/MDBoxBase.h"
#include "MantidKernel/V3D.h"

using namespace Mantid::Algorithms;
using namespace Mantid::API;
using namespace Mantid::DataObjects;
using namespace Mantid::Geometry;
using namespace Mantid::MDEvents;

class CheckWorkspacesMatchTest : public CxxTest::TestSuite
{
Expand Down Expand Up @@ -218,8 +217,8 @@ class CheckWorkspacesMatchTest : public CxxTest::TestSuite
void testMDEvents_matches()
{
if ( !checker.isInitialized() ) checker.initialize();
MDEventWorkspace3Lean::sptr mdews1 = MDEventsTestHelper::makeFileBackedMDEW("mdev1", false);
MDEventWorkspace3Lean::sptr mdews2 = MDEventsTestHelper::makeFileBackedMDEW("mdev2", false);
MDEventWorkspace3Lean::sptr mdews1 = MDEventsTestHelper::makeFakeMDEventWorkspace("mdev1");
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("Workspace2", boost::dynamic_pointer_cast<IMDWorkspace>(mdews2)) );
TS_ASSERT( checker.execute() );
Expand Down
5 changes: 2 additions & 3 deletions Code/Mantid/Framework/Algorithms/test/CloneWorkspaceTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "MantidTestHelpers/WorkspaceCreationHelper.h"
#include "MantidTestHelpers/ComponentCreationHelper.h"
#include "MantidAPI/AnalysisDataService.h"
#include "MantidMDEvents/MDEventFactory.h"
#include "MantidDataObjects/MDEventFactory.h"
#include "MantidTestHelpers/MDEventsTestHelper.h"
#include "MantidGeometry/Instrument.h"
#include "MantidDataObjects/PeaksWorkspace.h"
Expand All @@ -19,8 +19,7 @@ using namespace Mantid;
using namespace Mantid::Geometry;
using namespace Mantid::API;
using namespace Mantid::DataObjects;
using namespace Mantid::MDEvents;
using Mantid::MDEvents::MDEventsTestHelper::makeMDEW;
using Mantid::DataObjects::MDEventsTestHelper::makeMDEW;

class CloneWorkspaceTest : public CxxTest::TestSuite
{
Expand Down
5 changes: 5 additions & 0 deletions Code/Mantid/Framework/Algorithms/test/ConvertEmptyToTofTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "MantidAlgorithms/ConvertEmptyToTof.h"
#include "MantidAPI/AnalysisDataService.h"
#include "MantidAPI/FrameworkManager.h"
#include "MantidTestHelpers/WorkspaceCreationHelper.h"
#include "MantidDataObjects/Workspace2D.h"
#include "MantidGeometry/Instrument/ComponentHelper.h"
Expand All @@ -25,6 +26,10 @@ class ConvertEmptyToTofTest: public CxxTest::TestSuite {
delete suite;
}

ConvertEmptyToTofTest() {
FrameworkManager::Instance();
}

void test_Init() {
ConvertEmptyToTof alg;
TS_ASSERT_THROWS_NOTHING(alg.initialize())
Expand Down
10 changes: 3 additions & 7 deletions Code/Mantid/Framework/Algorithms/test/CopySampleTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#define MANTID_ALGORITHMS_COPYSAMPLETEST_H_

#include <cxxtest/TestSuite.h>
#include "MantidKernel/Timer.h"
#include <iostream>
#include <iomanip>

#include "MantidAlgorithms/CopySample.h"
#include "MantidDataObjects/WorkspaceSingleValue.h"
Expand All @@ -16,9 +13,9 @@
#include "MantidGeometry/Instrument/ObjComponent.h"
#include "MantidGeometry/Objects/Object.h"

#include "MantidMDEvents/MDEvent.h"
#include "MantidMDEvents/MDEventFactory.h"
#include "MantidMDEvents/MDEventWorkspace.h"
#include "MantidDataObjects/MDEvent.h"
#include "MantidDataObjects/MDEventFactory.h"
#include "MantidDataObjects/MDEventWorkspace.h"
#include "MantidTestHelpers/ComponentCreationHelper.h"

using namespace Mantid;
Expand All @@ -27,7 +24,6 @@ using namespace Mantid::API;
using namespace Mantid::DataObjects;
using namespace Mantid::Geometry;
using namespace Mantid::Kernel;
using namespace Mantid::MDEvents;

class CopySampleTest : public CxxTest::TestSuite
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <cxxtest/TestSuite.h>

#include "MantidAPI/FrameworkManager.h"
#include "MantidGeometry/Instrument.h"
#include "MantidGeometry/IComponent.h"
#include "MantidGeometry/Instrument/ReferenceFrame.h"
Expand All @@ -25,6 +26,9 @@ class CreateSampleWorkspaceTest : public CxxTest::TestSuite
static CreateSampleWorkspaceTest *createSuite() { return new CreateSampleWorkspaceTest(); }
static void destroySuite( CreateSampleWorkspaceTest *suite ) { delete suite; }

CreateSampleWorkspaceTest() {
FrameworkManager::Instance();
}

void test_Init()
{
Expand Down

0 comments on commit 58cabf6

Please sign in to comment.