diff --git a/Dart.sh b/Dart.sh index b34aaf9d70..85d3915eee 100755 --- a/Dart.sh +++ b/Dart.sh @@ -16,11 +16,12 @@ 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=Etch32 #" -echo "#export FAIRSOFT_VERSION=mar08 #" -echo "#export SIMPATH= #" -echo "#export BUILDDIR=/tmp/fairroot/build_cbm_\${FAIRSOFT_VERSION} #" -echo "#export SOURCEDIR=/misc/uhlig/SVN/ctest/cbmroot #" +echo "export LINUX_FLAVOUR= #" +echo "export FAIRSOFT_VERSION= #" +echo "export SIMPATH= #" +echo "export GIT_BRANCH=< master or dev> #" +echo "export BUILDDIR= #" +echo "export SOURCEDIR= #" echo "#export NCPU=100 #" echo "##################################################################" } @@ -29,7 +30,8 @@ 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 -- Possible arguments are Nightly, Experimental, " + echo "-- Error -- Continuous or Profile." 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)." @@ -38,12 +40,12 @@ if [ "$#" -lt "2" ]; then exit 1 fi -# test if a ctest model is either Experimantal or Nightly -if [ "$1" == "Experimental" -o "$1" == "Nightly" -o "$1" == "Continuous" ]; then +# test if a valid ctest model is defined +if [ "$1" == "Experimental" -o "$1" == "Nightly" -o "$1" == "Continuous" -o "$1" == "Profile" ]; then echo "" else echo "-- Error -- This ctest model is not supported." - echo "-- Error -- Possible arguments are Nightly, Experimental or Continuous." + echo "-- Error -- Possible arguments are Nightly, Experimental, Continuous or Profile." exit 1 fi diff --git a/FairBase_test.cmake b/FairBase_test.cmake index c26817ce2f..d2470b0248 100644 --- a/FairBase_test.cmake +++ b/FairBase_test.cmake @@ -5,60 +5,50 @@ # 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_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(BUILD_COMMAND "make") +Set(CTEST_BUILD_COMMAND "${BUILD_COMMAND} -j$ENV{number_of_processors}") -Set (CTEST_CONFIGURE_COMMAND " \"${CMAKE_EXECUTABLE_NAME}\" \"-DCMAKE_BUILD_TYPE=NIGHTLY\" \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\" ") +If($ENV{ctest_model} MATCHES Nightly OR $ENV{ctest_model} MATCHES Profile) - # 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}") + Find_Program(GCOV_COMMAND gcov) + If(GCOV_COMMAND) + Message("Found GCOV: ${GCOV_COMMAND}") + Set(CTEST_COVERAGE_COMMAND ${GCOV_COMMAND}) + EndIf(GCOV_COMMAND) + + String(TOUPPER $ENV{ctest_model} _Model) + Set(ENV{ctest_model} Nightly) -# FOREACH(_file ${_result}) -# STRING(STRIP "${_file}" _file1) -# SET (CTEST_NOTES_FILES ${CTEST_NOTES_FILES} "${CTEST_SOURCE_DIRECTORY}/${_file1}") -# ENDFOREACH(_file ${_result}) + Set(CTEST_CONFIGURE_COMMAND " \"${CMAKE_EXECUTABLE_NAME}\" \"-DCMAKE_BUILD_TYPE=${_Model}\" \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\" ") CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) -endif($ENV{ctest_model} MATCHES Nightly) +EndIf() -configure_file(${CTEST_SOURCE_DIRECTORY}/CTestCustom.cmake +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 () +Ctest_Read_Custom_Files("${CTEST_BINARY_DIRECTORY}") + +Ctest_Start($ENV{ctest_model}) +If(NOT $ENV{ctest_model} MATCHES Experimental) + Ctest_Update(SOURCE "${CTEST_SOURCE_DIRECTORY}") +EndIf() +Ctest_Configure(BUILD "${CTEST_BINARY_DIRECTORY}") +Ctest_Build(BUILD "${CTEST_BINARY_DIRECTORY}") +Ctest_Test(BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL $ENV{number_of_processors}) +If(${_Model} MATCHES PROFILE) + Ctest_Coverage(BUILD "${CTEST_BINARY_DIRECTORY}") +EndIf() +Ctest_Submit()