1 # /*-------------------------------------------------------------------------*\
3 # \\ / F ield | foam-extend: Open Source CFD
5 # \\ / A nd | For copyright notice see file Copyright
7 # -----------------------------------------------------------------------------
9 # This file is part of foam-extend.
11 # foam-extend is free software: you can redistribute it and/or modify it
12 # under the terms of the GNU General Public License as published by the
13 # Free Software Foundation, either version 3 of the License, or (at your
14 # option) any later version.
16 # foam-extend is distributed in the hope that it will be useful, but
17 # WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 # General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
25 # CMakeLists.txt file for implementing a test harness for the
26 # Turbomachinery OSIG test cases
28 # The results will be submitted to the CDash server identified by
32 # Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
35 # \*-------------------------------------------------------------------------*/
37 cmake_minimum_required (VERSION 2.8)
39 PROJECT(Turbomachinery-1.5-dev)
41 #-----------------------------------------------------------------------------
42 # Initialization of CTest specific variables
44 # Initialize the site name
46 IF (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "")
47 # We can override the site name with the environment variable
48 # $CDASH_SUBMIT_LOCAL_HOST_ID
50 SITENAME $ENV{CDASH_SUBMIT_LOCAL_HOST_ID}
51 CACHE STRING "Name of the local site"
53 ELSE (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "")
54 # Grab the hostname FQN; will be used for the sitename
57 OUTPUT_VARIABLE SITENAME
59 ENDIF (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "")
61 MESSAGE("Initializing the name of this local site to: ${SITENAME}")
65 CACHE STRING "Name of the local site"
68 #Grab the Turbomachinery OSIG base directory
70 TURBOMACHINERY_OSIG_ROOT $ENV{BREEDER_OSIG_TURBOMACHINERY_DIR}
71 CACHE INTERNAL "Turbomachinery OSIG root directory."
74 # Construct the build name.
75 # No need to add $WM_PROJECT_VERSION to the name of the build,
76 # the test harness name should have taken care of that.
78 BUILDNAME $ENV{WM_OPTIONS}
79 CACHE STRING "Build ID"
82 # Find out the version of the compiler being used.
83 # Add this information to the buildname
85 IF(CMAKE_COMPILER_IS_GNUCC)
86 EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
88 OUTPUT_VARIABLE COMPILER_VERSION
90 SET(BUILDNAME "${BUILDNAME}-gcc${COMPILER_VERSION}")
91 ENDIF(CMAKE_COMPILER_IS_GNUCC)
93 # We will support more compilers eventually.
96 # Timeout for running all this: 4 hours: 4 x 3600 seconds
98 DART_TESTING_TIMEOUT 14400
99 CACHE STRING "Maximum time allowed (4 hours) before CTest will kill the test."
103 CMAKE_VERBOSE_MAKEFILE TRUE
108 #-----------------------------------------------------------------------------
109 set (UPDATE_TYPE svn)
113 #--------------------------------------------------------------------------------
116 add_custom_target (Turbo_Libs-src-$ENV{WM_PROJECT_VERSION} ALL
118 WORKING_DIRECTORY ${TURBOMACHINERY_OSIG_ROOT}/src
121 TARGET Turbo_Libs-src-$ENV{WM_PROJECT_VERSION}
122 PROPERTY LABELS Turbo_Libs-src-$ENV{WM_PROJECT_VERSION}
125 # rotorStatorInterfaces is not compiled by default
127 add_custom_target (Turbo_Libs-rotorStatorInterfaces-$ENV{WM_PROJECT_VERSION}
129 WORKING_DIRECTORY ${TURBOMACHINERY_OSIG_ROOT}/rotorStatorInterfaces
132 TARGET Turbo_Libs-rotorStatorInterfaces-$ENV{WM_PROJECT_VERSION}
133 PROPERTY LABELS Turbo_Libs-rotorStatorInterfaces-$ENV{WM_PROJECT_VERSION}
136 # We need the Breeder's simpleFunctionObjects library
137 add_custom_target (Breeder_Libs-simpleFunctionObjects-$ENV{WM_PROJECT_VERSION} ALL
139 WORKING_DIRECTORY $ENV{BREEDER_15_DIR}/libraries/simpleFunctionObjects
142 TARGET Breeder_Libs-simpleFunctionObjects-$ENV{WM_PROJECT_VERSION}
143 PROPERTY LABELS Breeder_Libs-simpleFunctionObjects-$ENV{WM_PROJECT_VERSION}
148 add_custom_target (Turbo_Apps-Utilities-$ENV{WM_PROJECT_VERSION} ALL
150 WORKING_DIRECTORY ${TURBOMACHINERY_OSIG_ROOT}/applications/utilities
153 TARGET Turbo_Apps-Utilities-$ENV{WM_PROJECT_VERSION}
154 PROPERTY LABELS Turbo_Apps-Utilities-$ENV{WM_PROJECT_VERSION}
157 add_custom_target (Turbo_Apps-Solvers-$ENV{WM_PROJECT_VERSION} ALL
159 WORKING_DIRECTORY ${TURBOMACHINERY_OSIG_ROOT}/applications/solvers
162 TARGET Turbo_Apps-Solvers-$ENV{WM_PROJECT_VERSION}
163 PROPERTY LABELS Turbo_Apps-Solvers-$ENV{WM_PROJECT_VERSION}
166 add_custom_target (Turbo_Apps-SingleChannelPump-initalizeRotation-$ENV{WM_PROJECT_VERSION} ALL
168 WORKING_DIRECTORY ${TURBOMACHINERY_OSIG_ROOT}/singleChannelPump/initializeRotation
171 TARGET Turbo_Apps-SingleChannelPump-initalizeRotation-$ENV{WM_PROJECT_VERSION}
172 PROPERTY LABELS Turbo_Apps-SingleChannelPump-initalizeRotation-$ENV{WM_PROJECT_VERSION}
175 # Adding target-level dependencies so the building is made in proper order
177 Turbo_Apps-Utilities-$ENV{WM_PROJECT_VERSION} Turbo_Libs-src-$ENV{WM_PROJECT_VERSION}
181 #-----------------------------------------------------------------------------
183 #Enable testing and dashboard
187 SET (CTEST_UPDATE_COMMAND "svn")
190 CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 1000
191 CACHE INTERNAL "Max number of errors"
194 CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 1000
195 CACHE INTERNAL "Max number of warnings"
200 # Modify this variable if you want the full length test case simulations
201 # Beware, this might take a long time to execute.
202 # Otherwise, the default behaviour is to run each test case for 1 "timestep"
203 #SET(RUN_FROM_ONE_TIMESTEP 0)
204 SET(RUN_FROM_ONE_TIMESTEP 1)
206 IF(RUN_FROM_ONE_TIMESTEP)
207 SET(testIdSuffix "_oneTimeStep")
208 ENDIF(RUN_FROM_ONE_TIMESTEP)
210 # Definition of the test suite:
212 # Run the suite of Turbomachinery test cases
214 INCLUDE($ENV{FOAM_TEST_HARNESS_DIR}/CMakeFiles/TurbomachineryTestsuites_ercoftacConicalDiffuser.cmake)
215 INCLUDE($ENV{FOAM_TEST_HARNESS_DIR}/CMakeFiles/TurbomachineryTestsuites_ercoftacCentrifugalPump.cmake)
216 INCLUDE($ENV{FOAM_TEST_HARNESS_DIR}/CMakeFiles/TurbomachineryTestsuites_singleChannelPump.cmake)
217 INCLUDE($ENV{FOAM_TEST_HARNESS_DIR}/CMakeFiles/TurbomachineryTestsuites_tutorials.cmake)
219 # Add a dummy test (/bin/true, just for debugging)
221 Turbo_Dummy_Test-$ENV{WM_PROJECT_VERSION} true
224 IF(RUN_FROM_ONE_TIMESTEP)
225 # Modify the cases controlDict file in order to run for only one time step
226 MESSAGE("${testRunTimeDirectory}: Modifying the controlDict files for running only one time step in directory: TurbomachineryTestSuites${testIdSuffix}")
228 COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForOneTimeStep.sh TurbomachineryTestSuites${testIdSuffix}
231 ENDIF(RUN_FROM_ONE_TIMESTEP)