Skip to content

Commit

Permalink
Merge branch 'master' into 12541_new_resnorm_algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
DanNixon committed Jun 15, 2015
2 parents 5d92328 + 2fc6d61 commit 4054137
Show file tree
Hide file tree
Showing 284 changed files with 99,096 additions and 3,759 deletions.
15 changes: 13 additions & 2 deletions Code/Mantid/Build/Jenkins/buildscript
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ if [[ ${NODE_LABELS} == *rhel7* ]]; then
ON_RHEL7=true
fi

if [[ ${NODE_LABELS} == *ubuntu* ]]; then
ON_UBUNTU=true
fi

###############################################################################
# Packaging options
###############################################################################
Expand Down Expand Up @@ -197,13 +201,20 @@ $SCL_ON_RHEL6 "cmake --build . -- -j$BUILD_THREADS"
$SCL_ON_RHEL6 "cmake --build . --target AllTests -- -j$BUILD_THREADS"

###############################################################################
# Run the tests
# Run the unit tests
###############################################################################
# Remove any Mantid.user.properties file
userprops=~/.mantid/Mantid.user.properties
rm -f $userprops
$SCL_ON_RHEL6 "ctest -j$BUILD_THREADS --schedule-random --output-on-failure"

###############################################################################
# Run the documentation tests on Ubuntu when doing a pull request build.
###############################################################################
if [[ "${ON_UBUNTU}" == true ]] && [[ ${JOB_NAME} == *pull_requests* ]]; then
$SCL_ON_RHEL6 "cmake --build . --target docs-test"
fi

###############################################################################
# Create the install kit if required. This includes building the Qt help
# documentation
Expand All @@ -230,7 +241,7 @@ if [[ "$BUILDPKG" == true ]]; then
fi

###############################################################################
# Run the system tests on RHEL6 when doing a pull request build. Run
# Run the system tests on RHEL7 when doing a pull request build. Run
# from a package to have at least one Linux checks it install okay
###############################################################################
if [[ "${ON_RHEL7}" == true ]] && [[ ${JOB_NAME} == *pull_requests* ]]; then
Expand Down
29 changes: 0 additions & 29 deletions Code/Mantid/Build/Jenkins/buildscript.bat
Original file line number Diff line number Diff line change
Expand Up @@ -138,32 +138,3 @@ if "%BUILDPKG%" == "yes" (
::if ERRORLEVEL 1 exit /B %ERRORLEVEL%
"%CMAKE_BIN_DIR%\cpack.exe" -C %BUILD_CONFIG% --config CPackConfig.cmake
)

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Run the doc tests when doing a pull request build. Run from a package
:: from a package to have at least one Linux checks it install okay
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
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 %BUILD_DIR%

::Remove user properties, disable instrument updating & usage reports and add data paths
del /Q C:\MantidInstall\bin\Mantid.user.properties
echo UpdateInstrumentDefinitions.OnStartup = 0 > C:\MantidInstall\bin\Mantid.user.properties
echo usagereports.enabled = 0 >> C:\MantidInstall\bin\Mantid.user.properties
:: User properties file cannot contain backslash characters
set WORKSPACE_UNIX_STYLE=%WORKSPACE:\=/%
set DATA_ROOT=!WORKSPACE_UNIX_STYLE!/build/ExternalData/Testing/Data
echo datasearch.directories = !DATA_ROOT!/UnitTest;!DATA_ROOT!/DocTest;!WORKSPACE_UNIX_STYLE!/Code/Mantid/instrument >> C:\MantidInstall\bin\Mantid.user.properties

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

:: Remove Mantid
cd %BUILD_DIR%
start "Uninstall Mantid" /B /WAIT python !SYSTEMTESTS_DIR!\scripts\mantidinstaller.py uninstall %BUILD_DIR%
if !RETCODE! NEQ 0 exit /B 1
)
84 changes: 84 additions & 0 deletions Code/Mantid/Build/Jenkins/doctests
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#!/bin/bash -ex
###############################################################################
# LINUX/MAC SCRIPT TO DRIVE THE JENKINS DOCUMENTATION TESTS OF MANTID.
#
# Notes:
#
# WORKSPACE, JOB_NAME, NODE_LABEL GIT_COMMIT are environment variables that
# are set by Jenkins. The last one corresponds to any labels set on a slave.
# MANTID_DATA_STORE should be set in the configuration of each
# slave.
###############################################################################

###############################################################################
# Print out the versions of things we are using
###############################################################################
cmake --version

#####################################################################################
# Find and install package
#####################################################################################
python $WORKSPACE/Code/Mantid/Testing/SystemTests/scripts/mantidinstaller.py install $WORKSPACE

###############################################################################
# Set up the location for the local object store outside of the build and
# source tree, which can be shared by multiple builds.
# It defaults to a MantidExternalData directory within the HOME directory.
# It can be overridden by setting the MANTID_DATA_STORE environment variable.
###############################################################################
if [ -z "$MANTID_DATA_STORE" ]; then
export MANTID_DATA_STORE=$HOME/MantidExternalData
fi

###############################################################################
# RHEL6 setup steps - nodes must have a "rhel6" label set (in lowercase)
###############################################################################
if [[ ${NODE_LABELS} == *rhel6* ]]; then
SCL_ON_RHEL6="scl enable mantidlibs34"
ON_RHEL6=true
else
SCL_ON_RHEL6="eval"
fi

###############################################################################
# Create the build directory if it doesn't exist
###############################################################################
[ -d $WORKSPACE/build ] || mkdir $WORKSPACE/build
cd $WORKSPACE/build

###############################################################################
# CMake configuration. We only need a minimal configuration as we will actually
# just run from the package
###############################################################################
$SCL_ON_RHEL6 "cmake -DMANTID_DATA_STORE=${MANTID_DATA_STORE} ../Code/Mantid"

###############################################################################
# Build step
###############################################################################
$SCL_ON_RHEL6 "cmake --build . -- StandardTestData"

#####################################################################################
# Run tests
#####################################################################################
# Create clean user properties with UsageData search path
userprops=~/.mantid/Mantid.user.properties
rm -f $userprops

data_binary_root=${WORKSPACE}/build/ExternalData
testdata_dir=${data_binary_root}/Testing/Data
instrument_dir=${WORKSPACE}/Code/Mantid/instrument
echo "datasearch.directories=${testdata_dir}/DocTest;${testdata_dir}/UnitTest;${instrument_dir}" > $userprops
echo "UpdateInstrumentDefinitions.OnStartup = 0" >> $userprops
echo "usagereports.enabled = 0" >> $userprops

set +e #don't immediately exit on failure so that we can remove the package
/opt/mantidnightly/bin/MantidPlot -xq docs/runsphinx_doctest.py
status=$?
set -e #exit on failures from now on

#####################################################################################
# Remove package
#####################################################################################
python $WORKSPACE/Code/Mantid/Testing/SystemTests/scripts/mantidinstaller.py uninstall $WORKSPACE

exit $status
95 changes: 95 additions & 0 deletions Code/Mantid/Build/Jenkins/doctests.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
setlocal enableextensions enabledelayedexpansion
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: WINDOWS SCRIPT TO DRIVE THE DOCUMENTATION TESTS OF MANTID
::
:: Notes:
::
:: WORKSPACE, JOB_NAME & NODE_LABEL are environment variables that
:: are set by Jenkins. The last one corresponds to any labels set on a slave.
:: MANTID_DATA_STORE should be set in the configuration of each slave.
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Print out the versions of things we are using
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set CMAKE_BIN_DIR=C:\Program Files (x86)\CMake 2.8\bin
"%CMAKE_BIN_DIR%\cmake" --version
echo %sha1%

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Get or update the third party dependencies (basically just to get python)
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
cd %WORKSPACE%\Code
call fetch_Third_Party --libs-only win64
cd %WORKSPACE%

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Find and install package
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set PYTHON_EXE=%WORKSPACE%\Code\Third_Party\lib\win64\Python27\python.exe
set INSTALLER_SCRIPT=%WORKSPACE%/Code/Mantid/Testing/SystemTests/scripts/mantidinstaller.py
start "Install package" /B /WAIT %PYTHON_EXE% %INSTALLER_SCRIPT% install %WORKSPACE%
if ERRORLEVEL 1 exit /B %ERRORLEVEL%

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Update the PATH so that we can find everything for cmake
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set PATH_AT_START=%PATH%
set PATH=%WORKSPACE%\Code\Third_Party\lib\win64;%WORKSPACE%\Code\Third_Party\lib\win64\Python27;%PATH%

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Set up the location for local object store outside of the build and source
:: tree, which can be shared by multiple builds.
:: It defaults to a MantidExternalData directory within the USERPROFILE
:: directory. It can be overridden by setting the MANTID_DATA_STORE environment
:: variable.
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
if NOT DEFINED MANTID_DATA_STORE (
set MANTID_DATA_STORE=%USERPROFILE%\MantidExternalData
)

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Setup the build directory
:: Remove build/ExternalData/**: data files will change over time and removing
:: the links helps keep it fresh
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set BUILD_DIR=%WORKSPACE%\build
if EXIST %BUILD_DIR% (
rmdir /S /Q %BUILD_DIR%\ExternalData
) else (
md %BUILD_DIR%
)
cd %BUILD_DIR%

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: CMake configuration. We only need the doc-tests targets
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
"%CMAKE_BIN_DIR%\cmake" -G "Visual Studio 11 Win64" -DMANTID_DATA_STORE=!MANTID_DATA_STORE! ..\Code\Mantid

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Build step
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
msbuild /nologo /nr:false /p:Configuration=Release StandardTestData.vcxproj

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Run the tests
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Reset the PATH so we don't pick up the 3rd party directory and use the
:: package instead
set PATH=%PATH_AT_START%;C:\MantidInstall\bin

::Remove user properties, disable instrument updating & usage reports and add data paths
del /Q C:\MantidInstall\bin\Mantid.user.properties
echo UpdateInstrumentDefinitions.OnStartup = 0 > C:\MantidInstall\bin\Mantid.user.properties
echo usagereports.enabled = 0 >> C:\MantidInstall\bin\Mantid.user.properties
:: User properties file cannot contain backslash characters
set WORKSPACE_UNIX_STYLE=%WORKSPACE:\=/%
set DATA_ROOT=!WORKSPACE_UNIX_STYLE!/build/ExternalData/Testing/Data
echo datasearch.directories = !DATA_ROOT!/UnitTest;!DATA_ROOT!/DocTest;!WORKSPACE_UNIX_STYLE!/Code/Mantid/instrument >> C:\MantidInstall\bin\Mantid.user.properties

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

start "Remove package" /B /WAIT %PYTHON_EXE% %INSTALLER_SCRIPT% uninstall %WORKSPACE%
if !RETCODE! NEQ 0 exit /B 1
9 changes: 8 additions & 1 deletion Code/Mantid/Framework/API/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ set ( INC_FILES
inc/MantidAPI/IDomainCreator.h
inc/MantidAPI/IEventList.h
inc/MantidAPI/IEventWorkspace.h
inc/MantidAPI/IEventWorkspace_fwd.h
inc/MantidAPI/IFileLoader.h
inc/MantidAPI/IFuncMinimizer.h
inc/MantidAPI/IFunction.h
Expand All @@ -210,19 +211,23 @@ set ( INC_FILES
inc/MantidAPI/ILatticeFunction.h
inc/MantidAPI/ILiveListener.h
inc/MantidAPI/IMDEventWorkspace.h
inc/MantidAPI/IMDEventWorkspace_fwd.h
inc/MantidAPI/IMDHistoWorkspace.h
inc/MantidAPI/IMDHistoWorkspace_fwd.h
inc/MantidAPI/IMDIterator.h
inc/MantidAPI/IMDNode.h
inc/MantidAPI/IMDWorkspace.h
inc/MantidAPI/IMaskWorkspace.h
inc/MantidAPI/IPawleyFunction.h
inc/MantidAPI/IPeakFunction.h
inc/MantidAPI/IPeaksWorkspace.h
inc/MantidAPI/IPeaksWorkspace_fwd.h
inc/MantidAPI/IPowderDiffPeakFunction.h
inc/MantidAPI/IRemoteJobManager.h
inc/MantidAPI/ISpectrum.h
inc/MantidAPI/ISplittersWorkspace.h
inc/MantidAPI/ITableWorkspace.h
inc/MantidAPI/ITableWorkspace_fwd.h
inc/MantidAPI/ITransformScale.h
inc/MantidAPI/IWorkspaceProperty.h
inc/MantidAPI/IkedaCarpenterModerator.h
Expand All @@ -245,6 +250,7 @@ set ( INC_FILES
inc/MantidAPI/MDGeometry.h
inc/MantidAPI/MatrixWSIndexCalculator.h
inc/MantidAPI/MatrixWorkspace.h
inc/MantidAPI/MatrixWorkspace_fwd.h
inc/MantidAPI/MatrixWorkspaceMDIterator.h
inc/MantidAPI/MemoryManager.h
inc/MantidAPI/ModeratorModel.h
Expand Down Expand Up @@ -283,6 +289,7 @@ set ( INC_FILES
inc/MantidAPI/VectorParameter.h
inc/MantidAPI/VectorParameterParser.h
inc/MantidAPI/Workspace.h
inc/MantidAPI/Workspace_fwd.h
inc/MantidAPI/WorkspaceFactory.h
inc/MantidAPI/WorkspaceGroup.h
inc/MantidAPI/WorkspaceHistory.h
Expand Down Expand Up @@ -406,7 +413,7 @@ enable_precompiled_headers( inc/MantidAPI/PrecompiledHeader.h SRC_FILES )
# Add the target for this directory
add_library ( API ${SRC_FILES} ${INC_FILES})
# Set the name of the generated library
set_target_properties ( API PROPERTIES OUTPUT_NAME MantidAPI
set_target_properties ( API PROPERTIES OUTPUT_NAME MantidAPI
COMPILE_DEFINITIONS IN_MANTID_API )

if (OSX_VERSION VERSION_GREATER 10.8)
Expand Down
6 changes: 1 addition & 5 deletions Code/Mantid/Framework/API/inc/MantidAPI/IEventWorkspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "MantidAPI/MatrixWorkspace.h"
#include "MantidAPI/IEventList.h"
#include "MantidAPI/IEventWorkspace_fwd.h"

namespace Mantid {

Expand Down Expand Up @@ -58,11 +59,6 @@ class MANTID_API_DLL IEventWorkspace : public MatrixWorkspace {
protected:
virtual const std::string toString() const;
};

/// shared pointer to the matrix workspace base class
typedef boost::shared_ptr<IEventWorkspace> IEventWorkspace_sptr;
/// shared pointer to the matrix workspace base class (const version)
typedef boost::shared_ptr<const IEventWorkspace> IEventWorkspace_const_sptr;
}
}

Expand Down
43 changes: 43 additions & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/IEventWorkspace_fwd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#ifndef MANTID_API_IEVENTWORKSPACE_FWD_H_
#define MANTID_API_IEVENTWORKSPACE_FWD_H_

#include <boost/shared_ptr.hpp>

namespace Mantid {
namespace API {
/**
This file provides forward declarations for Mantid::API::IEventWorkspace
Copyright &copy; 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/

/// forward declare of Mantid::API::IEventWorkspace
class IEventWorkspace;
/// shared pointer to Mantid::API::IEventWorkspace
typedef boost::shared_ptr<IEventWorkspace> IEventWorkspace_sptr;
/// shared pointer to Mantid::API::IEventWorkspace (const version)
typedef boost::shared_ptr<const IEventWorkspace> IEventWorkspace_const_sptr;

} // namespace API
} // namespace Mantid

#endif // MANTID_API_IEVENTWORKSPACE_FWD_H_
7 changes: 1 addition & 6 deletions Code/Mantid/Framework/API/inc/MantidAPI/IMDEventWorkspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "MantidAPI/BoxController.h"
#include "MantidAPI/DllConfig.h"
#include "MantidAPI/ExperimentInfo.h"
#include "MantidAPI/IMDEventWorkspace_fwd.h"
#include "MantidAPI/IMDWorkspace.h"
#include "MantidAPI/ITableWorkspace.h"
#include "MantidAPI/MultipleExperimentInfos.h"
Expand Down Expand Up @@ -87,12 +88,6 @@ class MANTID_API_DLL IMDEventWorkspace : public API::IMDWorkspace,
bool m_fileNeedsUpdating;
};

/// Shared pointer to a generic IMDEventWorkspace
typedef boost::shared_ptr<IMDEventWorkspace> IMDEventWorkspace_sptr;

/// Shared pointer to a generic const IMDEventWorkspace
typedef boost::shared_ptr<const IMDEventWorkspace> IMDEventWorkspace_const_sptr;

} // namespace MDEvents

} // namespace Mantid
Expand Down

0 comments on commit 4054137

Please sign in to comment.