Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions AliceO2_test.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
################################################################################
# Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
# #
# This software is distributed under the terms of the #
# GNU Lesser General Public Licence version 3 (LGPL) version 3, #
# copied verbatim in the file "LICENSE" #
################################################################################
SET (CTEST_SOURCE_DIRECTORY $ENV{SOURCEDIR})
SET (CTEST_BINARY_DIRECTORY $ENV{BUILDDIR})
SET (CTEST_SITE $ENV{SITE})
SET (CTEST_BUILD_NAME $ENV{LABEL})
SET (CTEST_CMAKE_GENERATOR "Unix Makefiles")
SET (CTEST_PROJECT_NAME "FAIRROOT")

Find_program(CTEST_GIT_COMMAND NAMES git)
Set(CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}")

#If($ENV{ctest_model} MATCHES Continuous)
# Set(CTEST_SVN_UPDATE_OPTIONS "$ENV{REVISION}")
#EndIf($ENV{ctest_model} MATCHES Continuous)

SET (BUILD_COMMAND "make")
SET (CTEST_BUILD_COMMAND "${BUILD_COMMAND} -j$ENV{number_of_processors}")

If($ENV{ctest_model} MATCHES Nightly)

Set (CTEST_CONFIGURE_COMMAND " \"${CMAKE_EXECUTABLE_NAME}\" \"-DCMAKE_BUILD_TYPE=NIGHTLY\" \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\" ")

# get the information about conflicting or localy modified files
# from svn, extract the relavant information about the file name
# and put the result in the output variable
# execute_process(COMMAND svn stat -u
# COMMAND grep ^[CM]
# COMMAND cut -c21-
# OUTPUT_VARIABLE FILELIST
# )

# create out of the output a cmake list. This step is done to convert the
# stream into seperated filenames.
# The trick is to exchange an "\n" by an ";" which is the separartor in
# a list created by cmake
# STRING(REGEX REPLACE "\n" ";" _result "${FILELIST}")

# FOREACH(_file ${_result})
# STRING(STRIP "${_file}" _file1)
# SET (CTEST_NOTES_FILES ${CTEST_NOTES_FILES} "${CTEST_SOURCE_DIRECTORY}/${_file1}")
# ENDFOREACH(_file ${_result})

CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})

endif($ENV{ctest_model} MATCHES Nightly)

configure_file(${CTEST_SOURCE_DIRECTORY}/CTestCustom.cmake
${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake
)
ctest_read_custom_files("${CTEST_BINARY_DIRECTORY}")

CTEST_START ($ENV{ctest_model})
CTEST_UPDATE (SOURCE "${CTEST_SOURCE_DIRECTORY}")
CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}")
CTEST_BUILD (BUILD "${CTEST_BINARY_DIRECTORY}")
CTEST_TEST (BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL $ENV{number_of_processors})
CTEST_SUBMIT ()

4 changes: 2 additions & 2 deletions CTestConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
################################################################################
# Dashboard is opened for submissions for a 24 hour period starting at
# the specified NIGHLY_START_TIME. Time is specified in 24 hour format.
set(CTEST_PROJECT_NAME "MyProj")
set(CTEST_PROJECT_NAME "AliceO2")
set(CTEST_NIGHTLY_START_TIME "00:00:00 CEST")

set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "cdash.gsi.de")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=MyProj")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=AliceO2")
set(CTEST_DROP_SITE_CDASH TRUE)

set(CTEST_TESTING_TIMEOUT 60)
112 changes: 112 additions & 0 deletions Dart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
#!/bin/bash


function print_example(){
echo "##################################################################"
echo "# To set the required parameters as source and the build #"
echo "# directory for ctest, the linux flavour and the SIMPATH #"
echo "# put the export commands below to a separate file which is read #"
echo "# during execution and which is defined on the command line. #"
echo "# Set all parameters according to your needs. #"
echo "# LINUX_FLAVOUR should be set to the distribution you are using #"
echo "# eg Debian, SuSe etc. #"
echo "# An additional varibale NCPU can overwrite the default number #"
echo "# of parallel processes used to compile the project. #"
echo "# This can be usefull if one can use a distributed build system #"
echo "# like icecream. #"
echo "# For example #"
echo "#!/bin/bash #"
echo "#export LINUX_FLAVOUR=Ubuntu14.x #"
echo "#export FAIRSOFT_VERSION="july14p3" #"
echo "#export SIMPATH=<path_to_installation_of_external_packages> #"
echo "#export BUILDDIR=/tmp/AliceO2/build_\${FAIRSOFT_VERSION} #"
echo "#export SOURCEDIR=~/AliceO2 #"
echo "#export NCPU=8 #"
echo "##################################################################"
}

if [ "$#" -lt "2" ]; then
echo ""
echo "-- Error -- Please start script with two parameters"
echo "-- Error -- The first parameter is the ctest model."
echo "-- Error -- Possible arguments are Nightly and Experimental ."
echo "-- Error -- The second parameter is the file containg the"
echo "-- Error -- Information about the setup at the client"
echo "-- Error -- installation (see example below)."
echo ""
print_example
exit 1
fi

# test if a ctest model is either Experimantal or Nightly
if [ "$1" == "Experimental" -o "$1" == "Nightly" -o "$1" == "Continuous" ]; then
echo ""
else
echo "-- Error -- This ctest model is not supported."
echo "-- Error -- Possible arguments are Nightly, Experimental or Continuous."
exit 1
fi

# test if the input file exists and execute it
if [ -e "$2" ];then
source $2
else
echo "-- Error -- Input file does not exist."
echo "-- Error -- Please choose existing input file."
exit 1
fi

# set the ctest model to command line parameter
export ctest_model=$1

# test for architecture
arch=$(uname -s | tr '[A-Z]' '[a-z]')
chip=$(uname -m | tr '[A-Z]' '[a-z]')

# extract information about the system and the machine and set
# environment variables used by ctest
SYSTEM=$arch-$chip
if test -z $CXX ; then
COMPILER=gcc;
GCC_VERSION=$(gcc -dumpversion)
else
COMPILER=$CXX;
GCC_VERSION=$($CXX -dumpversion)
fi

export LABEL1=${LINUX_FLAVOUR}-$SYSTEM-$COMPILER$GCC_VERSION-fairroot_$GIT_BRANCH-fairsoft_$FAIRSOFT_VERSION
export LABEL=$(echo $LABEL1 | sed -e 's#/#_#g')

# get the number of processors
# and information about the host
if [ "$arch" = "linux" ];
then
if [ "$NCPU" != "" ];
then
export number_of_processors=$NCPU
else
export number_of_processors=$(cat /proc/cpuinfo | grep processor | wc -l)
fi
export SITE=$(hostname -f)
elif [ "$arch" = "darwin" ];
then
if [ "$NCPU" != "" ];
then
export number_of_processors=$NCPU
else
export number_of_processors=$(sysctl -n hw.ncpu)
fi
export SITE=$(hostname -s)
fi

echo "************************"
date
echo "LABEL: " $LABEL
echo "SITE: " $SITE
echo "Model: " ${ctest_model}
echo "Nr. of processes: " $number_of_processors
echo "************************"

cd $SOURCEDIR

ctest -S $SOURCEDIR/AliceO2_test.cmake -V --VV