Add test loop scripts under the directory testHarness. Add the necessary CMake files

This commit is contained in:
Martin Beaudoin 2010-10-06 23:00:07 -04:00
parent 3aa57b52aa
commit 7e4a9cbd27
32 changed files with 2504 additions and 0 deletions

191
CMakeLists.txt Normal file
View file

@ -0,0 +1,191 @@
# /*---------------------------------------------------------------------------*\
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
# -------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Description
# CMakeLists.txt file for implementing a test harness for the compilation
# and test of OpenFOAM-1.5-dev using Kitware CTest./CMake/CDash
#
# The results will be submitted to the CDash server identified by the file
# CTestConfig.cmake
#
# Author
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
#
#
# \*---------------------------------------------------------------------------*/
cmake_minimum_required (VERSION 2.8)
PROJECT(OpenFOAM_1.5-dev)
#-----------------------------------------------------------------------------
# Initialization of CTest specific variables
# Initialize the site name
IF (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "")
# We can override the site name with the environment variable
# $CDASH_SUBMIT_LOCAL_HOST_ID
SET(
SITENAME $ENV{CDASH_SUBMIT_LOCAL_HOST_ID}
CACHE STRING "Name of the local site"
)
ELSE (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "")
# Grab the hostname FQN; will be used for the sitename
execute_process(
COMMAND hostname -f
OUTPUT_VARIABLE SITENAME
)
ENDIF (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "")
MESSAGE("Initializing the name of this local site to: ${SITENAME}")
SET(
SITE ${SITENAME}
CACHE STRING "Name of the local site"
)
#Grab the OpenFOAM installation directory.
SET(
OF_ROOT $ENV{WM_PROJECT_DIR}
CACHE INTERNAL "OpenFOAM root directory."
)
# Construct the build name.
# No need to add $WM_PROJECT_VERSION to the name of the build,
# the test harness name should have taken care of that.
SET(
BUILDNAME $ENV{WM_OPTIONS}
CACHE STRING "Build ID"
)
# Find out the version of the compiler being used.
# Add this information to the buildname
# This is for gcc
IF(CMAKE_COMPILER_IS_GNUCC)
EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
ARGS -dumpversion
OUTPUT_VARIABLE COMPILER_VERSION
)
SET(BUILDNAME "${BUILDNAME}-gcc${COMPILER_VERSION}")
ENDIF(CMAKE_COMPILER_IS_GNUCC)
#
# We will support more compilers eventually.
#
# Timeout for running all this: 4 hours: 4 x 3600 seconds
#SET(
# DART_TESTING_TIMEOUT 14400
# CACHE STRING "Maximum time allowed (4 hours) before CTest will kill the test."
#)
# Timeout for running all this: 10 minutes : 600 secondes
SET(
DART_TESTING_TIMEOUT 600
CACHE STRING "Maximum time allowed (10 minutes) before CTest will kill the test."
)
SET(
CMAKE_VERBOSE_MAKEFILE TRUE
)
# Update section
#-----------------------------------------------------------------------------
set (UPDATE_TYPE svn)
# Build section
#-----------------------------------------------------------------------------
# Compile OpenFOAM, libs and apps
add_custom_target (OpenFOAM-$ENV{WM_PROJECT_VERSION} ALL
${OF_ROOT}/Allwmake
)
set_property(
TARGET OpenFOAM-$ENV{WM_PROJECT_VERSION}
PROPERTY LABELS OpenFOAM-$ENV{WM_PROJECT_VERSION}
)
# Compile the OpenFOAM unit tests located under applications/test
# This part will not be compiled and run by default.
# This would be a good candidate for a sub-project
add_custom_target (OpenFOAM-$ENV{WM_PROJECT_VERSION}_unitTests
wmake all ${OF_ROOT}/applications/test
)
# Test section
#-----------------------------------------------------------------------------
#Enable testing and dashboard
ENABLE_TESTING()
INCLUDE(CTest)
SET (CTEST_UPDATE_COMMAND "svn")
SET(
CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 1000
CACHE INTERNAL "Max number of errors"
)
SET(
CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 1000
CACHE INTERNAL "Max number of warnings"
)
IF(BUILD_TESTING)
# Modify this variable if you want the full length test case simulations
# Beware, this might take a long time to execute.
# Otherwise, the default behaviour is to run each tutorial for 1 "timestep"
#SET(RUN_FROM_ONE_TIMESTEP 0)
SET(RUN_FROM_ONE_TIMESTEP 1)
IF(RUN_FROM_ONE_TIMESTEP)
SET(testIdSuffix "_oneTimeStep")
ENDIF(RUN_FROM_ONE_TIMESTEP)
# OpenFOAM will run against this test suite:
# Add the suite of OpenFOAM tutorials
#
INCLUDE($ENV{FOAM_TEST_HARNESS_DIR}/CMakeFiles/OpenFOAM_Tutorials.cmake)
# Add a dummy test (/bin/true, just for debugging)
ADD_TEST(
OpenFOAM-$ENV{WM_PROJECT_VERSION}_Dummy_Test true
)
IF(RUN_FROM_ONE_TIMESTEP)
# Modify the cases controlDict file in order to run for only one time step
MESSAGE("${testRunTimeDirectory}: Modifying the controlDict files for running only one time step in directory: ${TEST_CASE_DIR}")
EXECUTE_PROCESS(
COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForOneTimeStep.sh ${TEST_CASE_DIR}
WORKING_DIRECTORY .
)
ENDIF(RUN_FROM_ONE_TIMESTEP)
ENDIF(BUILD_TESTING)
# That's it.
#

13
CTestConfig.cmake Normal file
View file

@ -0,0 +1,13 @@
## This file should be placed in the root directory of your project.
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
## # The following are required to uses Dart and the Cdash dashboard
## ENABLE_TESTING()
## INCLUDE(CTest)
set(CTEST_PROJECT_NAME "OpenFOAM-1.6-ext_testing")
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "openfoam-extend.sourceforge.net")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=OpenFOAM-1.6-ext_testing")
set(CTEST_DROP_SITE_CDASH TRUE)

View file

@ -0,0 +1,237 @@
# /*---------------------------------------------------------------------------*\
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
# -------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Description
# CMakeLists.txt file for implementing a test harness for the
# Turbomachinery OSIG test cases
#
# The results will be submitted to the CDash server identified by the file
# CTestConfig.cmake
#
# Author
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
#
#
# \*---------------------------------------------------------------------------*/
cmake_minimum_required (VERSION 2.8)
PROJECT(Turbomachinery-1.5-dev)
#-----------------------------------------------------------------------------
# Initialization of CTest specific variables
# Initialize the site name
IF (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "")
# We can override the site name with the environment variable
# $CDASH_SUBMIT_LOCAL_HOST_ID
SET(
SITENAME $ENV{CDASH_SUBMIT_LOCAL_HOST_ID}
CACHE STRING "Name of the local site"
)
ELSE (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "")
# Grab the hostname FQN; will be used for the sitename
execute_process(
COMMAND hostname -f
OUTPUT_VARIABLE SITENAME
)
ENDIF (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "")
MESSAGE("Initializing the name of this local site to: ${SITENAME}")
SET(
SITE ${SITENAME}
CACHE STRING "Name of the local site"
)
#Grab the Turbomachinery OSIG base directory
SET(
TURBOMACHINERY_OSIG_ROOT $ENV{BREEDER_OSIG_TURBOMACHINERY_DIR}
CACHE INTERNAL "Turbomachinery OSIG root directory."
)
# Construct the build name.
# No need to add $WM_PROJECT_VERSION to the name of the build,
# the test harness name should have taken care of that.
SET(
BUILDNAME $ENV{WM_OPTIONS}
CACHE STRING "Build ID"
)
# Find out the version of the compiler being used.
# Add this information to the buildname
# This is for gcc
IF(CMAKE_COMPILER_IS_GNUCC)
EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
ARGS -dumpversion
OUTPUT_VARIABLE COMPILER_VERSION
)
SET(BUILDNAME "${BUILDNAME}-gcc${COMPILER_VERSION}")
ENDIF(CMAKE_COMPILER_IS_GNUCC)
#
# We will support more compilers eventually.
#
# Timeout for running all this: 4 hours: 4 x 3600 seconds
SET(
DART_TESTING_TIMEOUT 14400
CACHE STRING "Maximum time allowed (4 hours) before CTest will kill the test."
)
SET(
CMAKE_VERBOSE_MAKEFILE TRUE
)
# Update section
#-----------------------------------------------------------------------------
set (UPDATE_TYPE svn)
# Build section
#---------------------------------------------------------------------------------
# Compile the libs
add_custom_target (Turbo_Libs-src-$ENV{WM_PROJECT_VERSION} ALL
./Allwmake
WORKING_DIRECTORY ${TURBOMACHINERY_OSIG_ROOT}/src
)
set_property(
TARGET Turbo_Libs-src-$ENV{WM_PROJECT_VERSION}
PROPERTY LABELS Turbo_Libs-src-$ENV{WM_PROJECT_VERSION}
)
# rotorStatorInterfaces is not compiled by default
# MB 22/06/2010
add_custom_target (Turbo_Libs-rotorStatorInterfaces-$ENV{WM_PROJECT_VERSION}
wmake libso
WORKING_DIRECTORY ${TURBOMACHINERY_OSIG_ROOT}/rotorStatorInterfaces
)
set_property(
TARGET Turbo_Libs-rotorStatorInterfaces-$ENV{WM_PROJECT_VERSION}
PROPERTY LABELS Turbo_Libs-rotorStatorInterfaces-$ENV{WM_PROJECT_VERSION}
)
# We need the Breeder's simpleFunctionObjects library
add_custom_target (Breeder_Libs-simpleFunctionObjects-$ENV{WM_PROJECT_VERSION} ALL
wmake libso
WORKING_DIRECTORY $ENV{BREEDER_15_DIR}/libraries/simpleFunctionObjects
)
set_property(
TARGET Breeder_Libs-simpleFunctionObjects-$ENV{WM_PROJECT_VERSION}
PROPERTY LABELS Breeder_Libs-simpleFunctionObjects-$ENV{WM_PROJECT_VERSION}
)
# Compile the apps
add_custom_target (Turbo_Apps-Utilities-$ENV{WM_PROJECT_VERSION} ALL
wmake all
WORKING_DIRECTORY ${TURBOMACHINERY_OSIG_ROOT}/applications/utilities
)
set_property(
TARGET Turbo_Apps-Utilities-$ENV{WM_PROJECT_VERSION}
PROPERTY LABELS Turbo_Apps-Utilities-$ENV{WM_PROJECT_VERSION}
)
add_custom_target (Turbo_Apps-Solvers-$ENV{WM_PROJECT_VERSION} ALL
wmake all
WORKING_DIRECTORY ${TURBOMACHINERY_OSIG_ROOT}/applications/solvers
)
set_property(
TARGET Turbo_Apps-Solvers-$ENV{WM_PROJECT_VERSION}
PROPERTY LABELS Turbo_Apps-Solvers-$ENV{WM_PROJECT_VERSION}
)
add_custom_target (Turbo_Apps-SingleChannelPump-initalizeRotation-$ENV{WM_PROJECT_VERSION} ALL
wmake
WORKING_DIRECTORY ${TURBOMACHINERY_OSIG_ROOT}/singleChannelPump/initializeRotation
)
set_property(
TARGET Turbo_Apps-SingleChannelPump-initalizeRotation-$ENV{WM_PROJECT_VERSION}
PROPERTY LABELS Turbo_Apps-SingleChannelPump-initalizeRotation-$ENV{WM_PROJECT_VERSION}
)
# Adding target-level dependencies so the building is made in proper order
add_dependencies(
Turbo_Apps-Utilities-$ENV{WM_PROJECT_VERSION} Turbo_Libs-src-$ENV{WM_PROJECT_VERSION}
)
# Test section
#-----------------------------------------------------------------------------
#Enable testing and dashboard
ENABLE_TESTING()
INCLUDE(CTest)
SET (CTEST_UPDATE_COMMAND "svn")
SET(
CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 1000
CACHE INTERNAL "Max number of errors"
)
SET(
CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 1000
CACHE INTERNAL "Max number of warnings"
)
IF(BUILD_TESTING)
# Modify this variable if you want the full length test case simulations
# Beware, this might take a long time to execute.
# Otherwise, the default behaviour is to run each test case for 1 "timestep"
#SET(RUN_FROM_ONE_TIMESTEP 0)
SET(RUN_FROM_ONE_TIMESTEP 1)
IF(RUN_FROM_ONE_TIMESTEP)
SET(testIdSuffix "_oneTimeStep")
ENDIF(RUN_FROM_ONE_TIMESTEP)
# Definition of the test suite:
# Run the suite of Turbomachinery test cases
#
INCLUDE($ENV{FOAM_TEST_HARNESS_DIR}/CMakeFiles/TurbomachineryTestsuites_ercoftacConicalDiffuser.cmake)
INCLUDE($ENV{FOAM_TEST_HARNESS_DIR}/CMakeFiles/TurbomachineryTestsuites_ercoftacCentrifugalPump.cmake)
INCLUDE($ENV{FOAM_TEST_HARNESS_DIR}/CMakeFiles/TurbomachineryTestsuites_singleChannelPump.cmake)
INCLUDE($ENV{FOAM_TEST_HARNESS_DIR}/CMakeFiles/TurbomachineryTestsuites_tutorials.cmake)
# Add a dummy test (/bin/true, just for debugging)
ADD_TEST(
Turbo_Dummy_Test-$ENV{WM_PROJECT_VERSION} true
)
IF(RUN_FROM_ONE_TIMESTEP)
# Modify the cases controlDict file in order to run for only one time step
MESSAGE("${testRunTimeDirectory}: Modifying the controlDict files for running only one time step in directory: TurbomachineryTestSuites${testIdSuffix}")
EXECUTE_PROCESS(
COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForOneTimeStep.sh TurbomachineryTestSuites${testIdSuffix}
WORKING_DIRECTORY .
)
ENDIF(RUN_FROM_ONE_TIMESTEP)
ENDIF(BUILD_TESTING)
# That's it.
#

View file

@ -0,0 +1,13 @@
## This file should be placed in the root directory of your project.
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
## # The following are required to uses Dart and the Cdash dashboard
## ENABLE_TESTING()
## INCLUDE(CTest)
set(CTEST_PROJECT_NAME "Turbomachinery-1.5-dev")
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "openfoam-extend.sourceforge.net")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=Turbomachinery-1.5-dev")
set(CTEST_DROP_SITE_CDASH TRUE)

View file

@ -0,0 +1,101 @@
# /*---------------------------------------------------------------------------*\
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
# -------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Description
# CMake/CTest script for running the Turbomachinery OSIG testsuites
# for the ERCOFTAC Centrifugal Pump
#
# Author
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
#
# \*---------------------------------------------------------------------------*/
# Take care of tests specific variables
IF(NOT DEFINED testIdSuffix)
SET(testIdSuffix "_full")
ENDIF(NOT DEFINED testIdSuffix)
SET(testRunTimeDirectory "TurbomachineryTestSuites${testIdSuffix}/ercoftacCentrifugalPump")
# Use the current directory for running the test cases
SET (TEST_CASE_DIR $ENV{PWD}/${testRunTimeDirectory}
CACHE INTERNAL "ECP test case directory."
)
# Create the runTime test cases
MESSAGE("Removing the old test directory: ${TEST_CASE_DIR}")
file(REMOVE_RECURSE ${TEST_CASE_DIR})
MESSAGE("Creation of the new test directory: ${TEST_CASE_DIR}")
file(COPY ${TURBOMACHINERY_OSIG_ROOT}/ercoftacCentrifugalPump DESTINATION ${TEST_CASE_DIR}/..)
# Iterate over each case:
# We are looking for a tutorial with an Allrun case.
# If this file is present, we add this case to the list of cases to run.
#
# Subdirectory for the test cases
SET(TESTCASES_SUBDIR "cases")
# First, add a global cleanup of the cases
SET(testId "ECP_Allclean_cases${testIdSuffix}")
ADD_TEST(${testId} bash -c "cd ${TEST_CASE_DIR}/${TESTCASES_SUBDIR}; ./Allclean")
# Next, recurse through the case root directory,
# find all the Allrun files, and execute them
FILE(GLOB_RECURSE listofCasesWithAllrun ${TEST_CASE_DIR}/Allrun)
LIST(SORT listofCasesWithAllrun)
FOREACH(caseWithAllrun ${listofCasesWithAllrun})
#Grab the name of the directory containing the file Allrun
get_filename_component(thisCasePath ${caseWithAllrun} PATH)
# We need to skip the global Allrun file
IF(NOT ${thisCasePath} STREQUAL ${TEST_CASE_DIR}/${TESTCASES_SUBDIR})
MESSAGE("Found Allrun file in directory: ${thisCasePath}")
# Grab the parent name of the case directory
string(REPLACE ${TEST_CASE_DIR}/ "" caseParentPath ${caseWithAllrun})
# Construct the testId
string(REPLACE "/" "_" testId ${caseParentPath})
SET(testId ECP_${testId}${testIdSuffix})
# Add the test to the test harness
MESSAGE("Adding test: ${testId}")
ADD_TEST(${testId} bash -c "cd ${thisCasePath}; ./Allrun")
# Use this entry instead for testing
#ADD_TEST(${testId} bash -c "cd ${thisCasePath}; true")
ENDIF(NOT ${thisCasePath} STREQUAL ${TEST_CASE_DIR}/${TESTCASES_SUBDIR})
ENDFOREACH(caseWithAllrun)
# Modify the cases Allrun file for additional shell functions
MESSAGE("${testRunTimeDirectory}: Modifying the Allrun files for additional shell functions in directory: ${TEST_CASE_DIR}/${TESTCASES_SUBDIR}")
EXECUTE_PROCESS(
COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForTestHarness.sh ${TEST_CASE_DIR}/${TESTCASES_SUBDIR} $ENV{FOAM_TEST_HARNESS_DIR}/scripts/AdditionalRunFunctions
WORKING_DIRECTORY .
)
# That's it.
#

View file

@ -0,0 +1,103 @@
# /*---------------------------------------------------------------------------*\
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
# -------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Description
# CMake/CTest script for running the Turbomachinery OSIG testsuites
# for the ERCOFTAC Conical Diffuser
#
# Author
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
#
# \*---------------------------------------------------------------------------*/
# Take care of tests specific variables
IF(NOT DEFINED testIdSuffix)
SET(testIdSuffix "_full")
ENDIF(NOT DEFINED testIdSuffix)
IF(NOT DEFINED testRunTimeDirectory)
SET(testRunTimeDirectory "TurbomachineryTestSuites${testIdSuffix}/ercoftacConicalDiffuser")
ENDIF(NOT DEFINED testRunTimeDirectory)
# Use the current directory for running the test cases
SET (TEST_CASE_DIR $ENV{PWD}/${testRunTimeDirectory}
CACHE INTERNAL "ECD test case directory."
)
# Create the runTime test cases
MESSAGE("Removing the old test directory: ${TEST_CASE_DIR}")
file(REMOVE_RECURSE ${TEST_CASE_DIR})
MESSAGE("Creation of the new test directory: ${TEST_CASE_DIR}")
file(COPY ${TURBOMACHINERY_OSIG_ROOT}/ercoftacConicalDiffuser DESTINATION ${TEST_CASE_DIR}/..)
# Iterate over each case:
# We are looking for a tutorial with an Allrun case.
# If this file is present, we add this case to the list of cases to run.
#
# Subdirectory for the test cases
SET(TESTCASES_SUBDIR "cases")
# First, add a global cleanup of the cases
SET(testId "ECD_Allclean_cases${testIdSuffix}")
ADD_TEST(${testId} bash -c "cd ${TEST_CASE_DIR}/${TESTCASES_SUBDIR}; ./Allclean")
# Next, recurse through the case root directory,
# find all the Allrun files, and execute them
FILE(GLOB_RECURSE listofCasesWithAllrun ${TEST_CASE_DIR}/Allrun)
LIST(SORT listofCasesWithAllrun)
FOREACH(caseWithAllrun ${listofCasesWithAllrun})
#Grab the name of the directory containing the file Allrun
get_filename_component(thisCasePath ${caseWithAllrun} PATH)
# We need to skip the global Allrun file
IF(NOT ${thisCasePath} STREQUAL ${TEST_CASE_DIR}/${TESTCASES_SUBDIR})
MESSAGE("Found Allrun file in directory: ${thisCasePath}")
# Grab the parent name of the case directory
string(REPLACE ${TEST_CASE_DIR}/ "" caseParentPath ${caseWithAllrun})
# Construct the testId
string(REPLACE "/" "_" testId ${caseParentPath})
SET(testId ECD_${testId}${testIdSuffix})
# Add the test to the test harness
MESSAGE("Adding test: ${testId}")
ADD_TEST(${testId} bash -c "cd ${thisCasePath}; ./Allrun")
# Use this entry instead for testing
#ADD_TEST(${testId} bash -c "cd ${thisCasePath}; true")
ENDIF(NOT ${thisCasePath} STREQUAL ${TEST_CASE_DIR}/${TESTCASES_SUBDIR})
ENDFOREACH(caseWithAllrun)
# Modify the cases Allrun file for additional shell functions
MESSAGE("${testRunTimeDirectory}: Modifying the Allrun files for additional shell functions in directory: ${TEST_CASE_DIR}/${TESTCASES_SUBDIR}")
EXECUTE_PROCESS(
COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForTestHarness.sh ${TEST_CASE_DIR}/${TESTCASES_SUBDIR} $ENV{FOAM_TEST_HARNESS_DIR}/scripts/AdditionalRunFunctions
WORKING_DIRECTORY .
)
# That's it.
#

View file

@ -0,0 +1,103 @@
# /*---------------------------------------------------------------------------*\
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
# -------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Description
# CMake/CTest script for running the Turbomachinery OSIG testsuites
# for the Single Channel Pump
#
# Author
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
#
# \*---------------------------------------------------------------------------*/
# Take care of tests specific variables
IF(NOT DEFINED testIdSuffix)
SET(testIdSuffix "_full")
ENDIF(NOT DEFINED testIdSuffix)
SET(testRunTimeDirectory "TurbomachineryTestSuites${testIdSuffix}/singleChannelPump")
# Use the current directory for running the test cases
SET (TEST_CASE_DIR $ENV{PWD}/${testRunTimeDirectory}
CACHE INTERNAL "Single Channel Pump test case directory."
)
# Create the runTime test cases
MESSAGE("Removing the old test directory: ${TEST_CASE_DIR}")
file(REMOVE_RECURSE ${TEST_CASE_DIR})
MESSAGE("Creation of the new test directory: ${TEST_CASE_DIR}")
file(COPY ${TURBOMACHINERY_OSIG_ROOT}/singleChannelPump DESTINATION ${TEST_CASE_DIR}/..)
# Iterate over each case:
# We are looking for a tutorial with an Allrun case.
# If this file is present, we add this case to the list of cases to run.
#
# Subdirectory for the test cases
SET(TESTCASES_SUBDIR "Pump")
# No need for a global Allclean script, we will invoke the Allclean command before each
# Allrun.* file
#SET(testId "SCP_Allclean_cases${testIdSuffix}")
#ADD_TEST(${testId} bash -c "cd ${TEST_CASE_DIR}/${TESTCASES_SUBDIR}; ./Allclean")
# Next, recurse through the case root directory,
# find all the Allrun files, and execute them
FILE(GLOB_RECURSE listofCasesWithAllrun ${TEST_CASE_DIR}/${TESTCASES_SUBDIR}/Allrun.*)
LIST(SORT listofCasesWithAllrun)
FOREACH(caseWithAllrun ${listofCasesWithAllrun})
#Grab the name of the directory containing the file Allrun
get_filename_component(thisCasePath ${caseWithAllrun} PATH)
get_filename_component(thisCaseAllrunName ${caseWithAllrun} NAME)
# We need to skip the global Allrun file
IF(NOT ${thisCasePath} MATCHES ${TEST_CASE_DIR}/${TESTCASES_SUBDIR}/.svn*)
MESSAGE("Found Allrun file in directory: ${thisCasePath}")
# Grab the parent name of the case directory
string(REPLACE ${TEST_CASE_DIR}/ "" caseParentPath ${caseWithAllrun})
# Construct the testId
string(REPLACE "/" "_" testId ${caseParentPath})
SET(testId SCP_${testId}${testIdSuffix})
# Add the test to the test harness
MESSAGE("Adding test: ${testId}")
ADD_TEST(${testId} bash -c "cd ${thisCasePath}; ./Allclean; ./${thisCaseAllrunName}")
# Use this entry instead for testing
#ADD_TEST(${testId} bash -c "cd ${thisCasePath}; true")
ENDIF(NOT ${thisCasePath} MATCHES ${TEST_CASE_DIR}/${TESTCASES_SUBDIR}/.svn*)
ENDFOREACH(caseWithAllrun)
# Modify the cases Allrun file for additional shell functions
MESSAGE("${testRunTimeDirectory}: Modifying the Allrun files for additional shell functions in directory: ${TEST_CASE_DIR}/${TESTCASES_SUBDIR}")
EXECUTE_PROCESS(
COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForTestHarness.sh ${TEST_CASE_DIR}/${TESTCASES_SUBDIR} $ENV{FOAM_TEST_HARNESS_DIR}/scripts/AdditionalRunFunctions
WORKING_DIRECTORY .
)
# That's it.
#

View file

@ -0,0 +1,103 @@
# /*---------------------------------------------------------------------------*\
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
# -------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Description
# CMake/CTest script for running the Turbomachinery OSIG testsuites
# for the tutorials directory
#
# Author
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
#
# \*---------------------------------------------------------------------------*/
# Take care of tests specific variables
IF(NOT DEFINED testIdSuffix)
SET(testIdSuffix "_full")
ENDIF(NOT DEFINED testIdSuffix)
SET(testRunTimeDirectory "TurbomachineryTestSuites${testIdSuffix}/tutorials")
# Use the current directory for running the test cases
SET (TEST_CASE_DIR $ENV{PWD}/${testRunTimeDirectory}
CACHE INTERNAL "Turbo OSIG tutorials directory."
)
# Create the runTime test cases
MESSAGE("Removing the old test directory: ${TEST_CASE_DIR}")
file(REMOVE_RECURSE ${TEST_CASE_DIR})
MESSAGE("Creation of the new test directory: ${TEST_CASE_DIR}")
file(COPY ${TURBOMACHINERY_OSIG_ROOT}/tutorials DESTINATION ${TEST_CASE_DIR}/..)
# Iterate over each case:
# We are looking for a tutorial with an Allrun case.
# If this file is present, we add this case to the list of cases to run.
#
# Subdirectory for the test cases
SET(TESTCASES_SUBDIR ".")
# No need for a global Allclean script, we will invoke the Allclean command before each
# Allrun.* file
#SET(testId "TUT_Allclean_cases${testIdSuffix}")
#ADD_TEST(${testId} bash -c "cd ${TEST_CASE_DIR}/${TESTCASES_SUBDIR}; ./Allclean")
# Next, recurse through the case root directory,
# find all the Allrun files, and execute them
FILE(GLOB_RECURSE listofCasesWithAllrun ${TEST_CASE_DIR}/${TESTCASES_SUBDIR}/Allrun*)
LIST(SORT listofCasesWithAllrun)
FOREACH(caseWithAllrun ${listofCasesWithAllrun})
#Grab the name of the directory containing the file Allrun
get_filename_component(thisCasePath ${caseWithAllrun} PATH)
get_filename_component(thisCaseAllrunName ${caseWithAllrun} NAME)
# We need to skip the .svn files
IF(NOT ${thisCasePath} MATCHES .svn)
MESSAGE("Found Allrun file in directory: ${thisCasePath}")
# Grab the parent name of the case directory
string(REPLACE ${TEST_CASE_DIR}/ "" caseParentPath ${caseWithAllrun})
# Construct the testId
string(REPLACE "/" "_" testId ${caseParentPath})
SET(testId TUT_${testId}${testIdSuffix})
# Add the test to the test harness
MESSAGE("Adding test: ${testId}")
ADD_TEST(${testId} bash -c "cd ${thisCasePath}; ./Allclean; ./${thisCaseAllrunName}")
# Use this entry instead for testing
#ADD_TEST(${testId} bash -c "cd ${thisCasePath}; true")
ENDIF(NOT ${thisCasePath} MATCHES .svn)
ENDFOREACH(caseWithAllrun)
# Modify the cases Allrun file for additional shell functions
MESSAGE("${testRunTimeDirectory}: Modifying the Allrun files for additional shell functions in directory: ${TEST_CASE_DIR}/${TESTCASES_SUBDIR}")
EXECUTE_PROCESS(
COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForTestHarness.sh ${TEST_CASE_DIR}/${TESTCASES_SUBDIR} $ENV{FOAM_TEST_HARNESS_DIR}/scripts/AdditionalRunFunctions
WORKING_DIRECTORY .
)
# That's it.
#

View file

@ -0,0 +1,87 @@
# /*---------------------------------------------------------------------------*\
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
# -------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Description:
# README file for the CMake/CTest/CDash test harness for
# the TurboMachinery OSIG
#
# Author:
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved.
# \*---------------------------------------------------------------------------*/
Warning #1: Make sure your OpenFOAM environment is properly initialized before
running the test harness.
Warning #2: Make sure to create an environment variable called $BREEDER_15_DIR
This environment variable must point to the Breeder_1.5 directory
of your local working copy of the openfoam-extend Subversion repository
Something like: export BREEDER_15_DIR=/someAbsolutePath/Breeder_1.5
Warning #3: It is recommended to use cmake version 2.8.0 or newer for
running the test harness.
1: Instructions for starting a local test harness on your machine:
------------------------------------------------------------------
a) You can set your local system identifier using the environment variable
$CDASH_SUBMIT_LOCAL_HOST_ID. Please try using a unique identifier like
your machine's hostname. Otherwise, the fully qualified name of your system
will be used.
b) Install the CMakeLists.txt and CTestConfig.cmake files by executing the following commands:
cp ./CMakeFiles/CMakeLists.txt $BREEDER_15_DIR/OSIG/TurboMachinery/CMakeLists.txt
cp ./CMakeFiles/CTestConfig.cmake.openfoam-extend $BREEDER_15_DIR/OSIG/TurboMachinery/CTestConfig.cmake
c) Run the test harness and push your results on the CDash server on openfoam-extend
cd ./runDir; ./Allrun_Experimental
or
cd ./runDir; ./Allrun_Nightly
2: Instructions for restarting your setup from scratch:
-------------------------------------------------------
cd ./runDir; ./Allclean
3: About submitting your results
--------------------------------
Both Allrun_Experimental and Allrun_Nightly scripts will submit their results
to the CDash server of your choice, as specified by the file
$BREEDER_15_DIR/OSIG/TurboMachinery/CTestConfig.cmake
To submit your results to the CDash server on openfoam-extend, just use
the file CTestConfig.cmake.openfoam-extend.
If submitted to the CDash server on openfoam-extend, your results will be displayed here:
http://openfoam-extend.sourceforge.net/CDash/index.php?project=Turbomachinery-1.5-dev

View file

@ -0,0 +1,37 @@
#!/bin/bash
# /*---------------------------------------------------------------------------*\
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
# -------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Description
# Remove everything except the various Allrun and Allclean files
#
# Author
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
#
# SourceFiles
#
# \*---------------------------------------------------------------------------*/
#set -x
ls -d * | grep -v Allrun | grep -v Allclean | xargs rm -rf

View file

@ -0,0 +1,111 @@
#!/bin/bash
# /*---------------------------------------------------------------------------*\
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
# -------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Description
# Allrun file for running the OpenFOAM Turbomachinery OSIG test harness
# This script will only initialize the test harness using CMake
#
# Author
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
#
# \*---------------------------------------------------------------------------*/
#set -x
# Environment variable : BREEDER_15_DIR:
#
# This environment variable must point to the location of the Breeder_1.5 section
# of your local working copy of the openfoam-extend Subversion repository
#
# Something like this:
#
# export BREEDER_15_DIR=/someAbsolutePath/Breeder_1.5
export BREEDER_OSIG_TURBOMACHINERY_DIR=${BREEDER_15_DIR}/OSIG/TurboMachinery
# This environment variable must point to the location of the test harness main directory
export FOAM_TEST_HARNESS_DIR=$(dirname $PWD)
# First, some sanity checks
#
# We need $BREEDER_15_DIR
if [ ! -n "${BREEDER_15_DIR}" ]
then
echo "Warning:"
echo " Missing environment variable \$BREEDER_15_DIR. Stopping."
echo " Please make sure to initialize this environment variable to "
echo " the directory where you have installed the Breeder_1.5 section "
echo " of the openfoam-extend Subversion repository"
exit -1
fi
# We need $WM_PROJECT_DIR
if [ -z "$WM_PROJECT_DIR" ]
then
echo "Warning:"
echo " Missing environment variable \$WM_PROJECT_DIR. Stopping."
echo " Please make sure your OpenFOAM environment is properly set up."
exit -1
fi
# We need $
if [ ! -e $BREEDER_OSIG_TURBOMACHINERY_DIR/CMakeLists.txt ]
then
echo "Warning:"
echo " Missing file: CMakeLists.txt under \$BREEDER_15_DIR/OSIG/TurboMachinery. Stopping."
echo " A copy of CMakeLists.txt is available under $FOAM_TEST_HARNESS_DIR/CMakeFiles."
echo " Please make a copy of this file under the directory \$BREEDER_15_DIR/OSIG/TurboMachinery."
exit -1
fi
# We also need $BREEDER_OSIG_TURBOMACHINERY_DIR/CTestConfig.cmake
if [ ! -e $BREEDER_OSIG_TURBOMACHINERY_DIR/CTestConfig.cmake ]
then
echo "Warning:"
echo " Missing file: CTestConfig.cmake under \$BREEDER_OSIG_TURBOMACHINERY_DIR. Stopping."
echo " A copy of CTestConfig.cmake for openfoam-extend is available under $FOAM_TEST_HARNESS_DIR/CMakeFiles."
echo " For a copy of CTestConfig.cmake for your local CDash server, contact your local CDash admin."
echo " Please make a copy of this file under \$BREEDER_OSIG_TURBOMACHINERY_DIR/CTestConfig.cmake."
exit -1
fi
# Make sure the CMake and tutorials runtime files are updated
# We need cmake version 2.8.0 at least
cmake $BREEDER_OSIG_TURBOMACHINERY_DIR
# All set. Now we can run the available test harness
#
# Invoke make help for the complete list of available commands.
#
# User-demand testing.
# Will do: ExperimentalConfigure + ExperimentalBuild + ExperimentalTest + ExperimentalSubmit
# make Experimental
# Nightly testing
# Will do: NightlyUpdate + NightylConfigure + NightlyBuild + NightlyTest + NightlySubmit
# make Nightly
# That's it

View file

@ -0,0 +1,110 @@
#!/bin/bash
# /*---------------------------------------------------------------------------*\
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
# -------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Description
# Allrun file for running the OpenFOAM Turbomachinery OSIG test harness
#
# Author
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
#
# \*---------------------------------------------------------------------------*/
#set -x
# Environment variable : BREEDER_15_DIR:
#
# This environment variable must point to the location of the Breeder_1.5 section
# of your local working copy of the openfoam-extend Subversion repository
#
# Something like this:
#
# export BREEDER_15_DIR=/someAbsolutePath/Breeder_1.5
export BREEDER_OSIG_TURBOMACHINERY_DIR=${BREEDER_15_DIR}/OSIG/TurboMachinery
# This environment variable must point to the location of the test harness main directory
export FOAM_TEST_HARNESS_DIR=$(dirname $PWD)
# First, some sanity checks
#
# We need $BREEDER_15_DIR
if [ ! -n "${BREEDER_15_DIR}" ]
then
echo "Warning:"
echo " Missing environment variable \$BREEDER_15_DIR. Stopping."
echo " Please make sure to initialize this environment variable to "
echo " the directory where you have installed the Breeder_1.5 section "
echo " of the openfoam-extend Subversion repository"
exit -1
fi
# We need $WM_PROJECT_DIR
if [ -z "$WM_PROJECT_DIR" ]
then
echo "Warning:"
echo " Missing environment variable \$WM_PROJECT_DIR. Stopping."
echo " Please make sure your OpenFOAM environment is properly set up."
exit -1
fi
# We need $
if [ ! -e $BREEDER_OSIG_TURBOMACHINERY_DIR/CMakeLists.txt ]
then
echo "Warning:"
echo " Missing file: CMakeLists.txt under \$BREEDER_15_DIR/OSIG/TurboMachinery. Stopping."
echo " A copy of CMakeLists.txt is available under $FOAM_TEST_HARNESS_DIR/CMakeFiles."
echo " Please make a copy of this file under the directory \$BREEDER_15_DIR/OSIG/TurboMachinery."
exit -1
fi
# We also need $BREEDER_OSIG_TURBOMACHINERY_DIR/CTestConfig.cmake
if [ ! -e $BREEDER_OSIG_TURBOMACHINERY_DIR/CTestConfig.cmake ]
then
echo "Warning:"
echo " Missing file: CTestConfig.cmake under \$BREEDER_OSIG_TURBOMACHINERY_DIR. Stopping."
echo " A copy of CTestConfig.cmake for openfoam-extend is available under $FOAM_TEST_HARNESS_DIR/CMakeFiles."
echo " For a copy of CTestConfig.cmake for your local CDash server, contact your local CDash admin."
echo " Please make a copy of this file under \$BREEDER_OSIG_TURBOMACHINERY_DIR/CTestConfig.cmake."
exit -1
fi
# Make sure the CMake and tutorials runtime files are updated
# We need cmake version 2.8.0 at least
cmake $BREEDER_OSIG_TURBOMACHINERY_DIR
# All set. Now we can run the available test harness
#
# Invoke make help for the complete list of available commands.
#
# User-demand testing.
# Will do: ExperimentalConfigure + ExperimentalBuild + ExperimentalTest + ExperimentalSubmit
make Experimental
# Nightly testing
# Will do: NightlyUpdate + NightylConfigure + NightlyBuild + NightlyTest + NightlySubmit
# make Nightly
# That's it

View file

@ -0,0 +1,110 @@
#!/bin/bash
# /*---------------------------------------------------------------------------*\
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
# -------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Description
# Allrun file for running the OpenFOAM Turbomachinery OSIG test harness
#
# Author
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
#
# \*---------------------------------------------------------------------------*/
#set -x
# Environment variable : BREEDER_15_DIR:
#
# This environment variable must point to the location of the Breeder_1.5 section
# of your local working copy of the openfoam-extend Subversion repository
#
# Something like this:
#
# export BREEDER_15_DIR=/someAbsolutePath/Breeder_1.5
export BREEDER_OSIG_TURBOMACHINERY_DIR=${BREEDER_15_DIR}/OSIG/TurboMachinery
# This environment variable must point to the location of the test harness main directory
export FOAM_TEST_HARNESS_DIR=$(dirname $PWD)
# First, some sanity checks
#
# We need $BREEDER_15_DIR
if [ ! -n "${BREEDER_15_DIR}" ]
then
echo "Warning:"
echo " Missing environment variable \$BREEDER_15_DIR. Stopping."
echo " Please make sure to initialize this environment variable to "
echo " the directory where you have installed the Breeder_1.5 section "
echo " of the openfoam-extend Subversion repository"
exit -1
fi
# We need $WM_PROJECT_DIR
if [ -z "$WM_PROJECT_DIR" ]
then
echo "Warning:"
echo " Missing environment variable \$WM_PROJECT_DIR. Stopping."
echo " Please make sure your OpenFOAM environment is properly set up."
exit -1
fi
# We need $
if [ ! -e $BREEDER_OSIG_TURBOMACHINERY_DIR/CMakeLists.txt ]
then
echo "Warning:"
echo " Missing file: CMakeLists.txt under \$BREEDER_15_DIR/OSIG/TurboMachinery. Stopping."
echo " A copy of CMakeLists.txt is available under $FOAM_TEST_HARNESS_DIR/CMakeFiles."
echo " Please make a copy of this file under the directory \$BREEDER_15_DIR/OSIG/TurboMachinery."
exit -1
fi
# We also need $BREEDER_OSIG_TURBOMACHINERY_DIR/CTestConfig.cmake
if [ ! -e $BREEDER_OSIG_TURBOMACHINERY_DIR/CTestConfig.cmake ]
then
echo "Warning:"
echo " Missing file: CTestConfig.cmake under \$BREEDER_OSIG_TURBOMACHINERY_DIR. Stopping."
echo " A copy of CTestConfig.cmake for openfoam-extend is available under $FOAM_TEST_HARNESS_DIR/CMakeFiles."
echo " For a copy of CTestConfig.cmake for your local CDash server, contact your local CDash admin."
echo " Please make a copy of this file under \$BREEDER_OSIG_TURBOMACHINERY_DIR/CTestConfig.cmake."
exit -1
fi
# Make sure the CMake and tutorials runtime files are updated
# We need cmake version 2.8.0 at least
cmake $BREEDER_OSIG_TURBOMACHINERY_DIR
# All set. Now we can run the available test harness
#
# Invoke make help for the complete list of available commands.
#
# User-demand testing.
# Will do: ExperimentalConfigure + ExperimentalBuild + ExperimentalTest + ExperimentalSubmit
# make Experimental
# Nightly testing
# Will do: NightlyUpdate + NightylConfigure + NightlyBuild + NightlyTest + NightlySubmit
make Nightly
# That's it

View file

@ -0,0 +1,71 @@
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Description
# Additionnal run functions, based on the original RunFunctions file
#
# Author:
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
#
#------------------------------------------------------------------------------
# Exception handler: dump the tail of the log file on error
verbose_report_on_runApplication_error()
{
ecode=$?
if [ "$reportOnErrorOnlyOnce" ] ; then
echo " "
echo " => Error running $APP_RUN..."
echo " => Here are the last 50 lines of the log file log.$APP_RUN..."
echo " "
if [ -f log.$APP_RUN ] ; then
tail -50 log.$APP_RUN
exit $ecode;
fi
fi
# Do not report again when exiting
unset reportOnErrorOnlyOnce
}
# Variation of runApplication with exception handling
runApplicationAndReportOnError ()
{
trap 'verbose_report_on_runApplication_error' ERR
APP_RUN=$1; shift
reportOnErrorOnlyOnce=1
if [ -f log.$APP_RUN ] ; then
echo "$APP_RUN already run on $PWD: remove log file to run"
exit 1;
else
echo "Running $APP_RUN on $PWD"
$APP_RUN $* > log.$APP_RUN 2>&1
fi
}
# We force the display of a stack trace if we encounter problems
export FOAM_ABORT=1

View file

@ -0,0 +1,56 @@
#!/bin/bash
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# prepareCasesForOneTimeStep.sh
#
# Description
# Prepare a working copy of the test cases for running only one
# timeStep
#
# Modifications made by:
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
#
#------------------------------------------------------------------------------
# Location of a working copy of the test cases
TEST_RUN_DIR=$1
# Modify the controlDict files
pushd ${TEST_RUN_DIR} >& /dev/null
for CD in `find . -name "controlDict*"`
do
mv ${CD} ${CD}.org
sed \
-e s/"\(startFrom[ \d9]*\)\([a-zA-Z]*\);"/"\1 latestTime;"/g \
-e s/"\(stopAt[ \d9]*\)\([a-zA-Z]*\);"/"\1 nextWrite;"/g \
-e s/"\(writeControl[ \d9]*\)\([a-zA-Z]*\);"/"\1 timeStep;"/g \
-e s/"\(writeInterval[ \d9]*\)\([0-9a-zA-Z.-]*\);"/"\1 1;"/g \
${CD}.org > ${CD}
done
popd >& /dev/null
echo "Done."

View file

@ -0,0 +1,59 @@
#!/bin/bash
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# prepareCasesForTestHarness.sh
#
# Description
# Prepare a working copy of the test cases for a test harness.
#
# Author:
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
#
#------------------------------------------------------------------------------
#set -x
# Location of a working copy of the test cases
TEST_RUN_DIR=$1
#Additional shell functions
ADDITIONAL_SHELL_FUNCTIONS=$2
for AR in `find ${TEST_RUN_DIR} -name Allrun\*`
do
# Replace the macro runApplication with runApplicationAndReportOnError
mv ${AR} ${AR}.org
sed \
-e s/"runApplication "/"runApplicationAndReportOnError "/g \
-e /RunFunctions/r${ADDITIONAL_SHELL_FUNCTIONS} \
${AR}.org > ${AR}
# Make sure the Allrun file is executable
chmod +x ${AR}
done
echo "Done."

View file

@ -0,0 +1,191 @@
# /*---------------------------------------------------------------------------*\
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
# -------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Description
# CMakeLists.txt file for implementing a test harness for the compilation
# and test of OpenFOAM-1.5-dev using Kitware CTest./CMake/CDash
#
# The results will be submitted to the CDash server identified by the file
# CTestConfig.cmake
#
# Author
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
#
#
# \*---------------------------------------------------------------------------*/
cmake_minimum_required (VERSION 2.8)
PROJECT(OpenFOAM_1.5-dev)
#-----------------------------------------------------------------------------
# Initialization of CTest specific variables
# Initialize the site name
IF (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "")
# We can override the site name with the environment variable
# $CDASH_SUBMIT_LOCAL_HOST_ID
SET(
SITENAME $ENV{CDASH_SUBMIT_LOCAL_HOST_ID}
CACHE STRING "Name of the local site"
)
ELSE (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "")
# Grab the hostname FQN; will be used for the sitename
execute_process(
COMMAND hostname -f
OUTPUT_VARIABLE SITENAME
)
ENDIF (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "")
MESSAGE("Initializing the name of this local site to: ${SITENAME}")
SET(
SITE ${SITENAME}
CACHE STRING "Name of the local site"
)
#Grab the OpenFOAM installation directory.
SET(
OF_ROOT $ENV{WM_PROJECT_DIR}
CACHE INTERNAL "OpenFOAM root directory."
)
# Construct the build name.
# No need to add $WM_PROJECT_VERSION to the name of the build,
# the test harness name should have taken care of that.
SET(
BUILDNAME $ENV{WM_OPTIONS}
CACHE STRING "Build ID"
)
# Find out the version of the compiler being used.
# Add this information to the buildname
# This is for gcc
IF(CMAKE_COMPILER_IS_GNUCC)
EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
ARGS -dumpversion
OUTPUT_VARIABLE COMPILER_VERSION
)
SET(BUILDNAME "${BUILDNAME}-gcc${COMPILER_VERSION}")
ENDIF(CMAKE_COMPILER_IS_GNUCC)
#
# We will support more compilers eventually.
#
# Timeout for running all this: 4 hours: 4 x 3600 seconds
#SET(
# DART_TESTING_TIMEOUT 14400
# CACHE STRING "Maximum time allowed (4 hours) before CTest will kill the test."
#)
# Timeout for running all this: 10 minutes : 600 secondes
SET(
DART_TESTING_TIMEOUT 600
CACHE STRING "Maximum time allowed (10 minutes) before CTest will kill the test."
)
SET(
CMAKE_VERBOSE_MAKEFILE TRUE
)
# Update section
#-----------------------------------------------------------------------------
set (UPDATE_TYPE svn)
# Build section
#-----------------------------------------------------------------------------
# Compile OpenFOAM, libs and apps
add_custom_target (OpenFOAM-$ENV{WM_PROJECT_VERSION} ALL
${OF_ROOT}/Allwmake
)
set_property(
TARGET OpenFOAM-$ENV{WM_PROJECT_VERSION}
PROPERTY LABELS OpenFOAM-$ENV{WM_PROJECT_VERSION}
)
# Compile the OpenFOAM unit tests located under applications/test
# This part will not be compiled and run by default.
# This would be a good candidate for a sub-project
add_custom_target (OpenFOAM-$ENV{WM_PROJECT_VERSION}_unitTests
wmake all ${OF_ROOT}/applications/test
)
# Test section
#-----------------------------------------------------------------------------
#Enable testing and dashboard
ENABLE_TESTING()
INCLUDE(CTest)
SET (CTEST_UPDATE_COMMAND "svn")
SET(
CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 1000
CACHE INTERNAL "Max number of errors"
)
SET(
CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 1000
CACHE INTERNAL "Max number of warnings"
)
IF(BUILD_TESTING)
# Modify this variable if you want the full length test case simulations
# Beware, this might take a long time to execute.
# Otherwise, the default behaviour is to run each tutorial for 1 "timestep"
#SET(RUN_FROM_ONE_TIMESTEP 0)
SET(RUN_FROM_ONE_TIMESTEP 1)
IF(RUN_FROM_ONE_TIMESTEP)
SET(testIdSuffix "_oneTimeStep")
ENDIF(RUN_FROM_ONE_TIMESTEP)
# OpenFOAM will run against this test suite:
# Add the suite of OpenFOAM tutorials
#
INCLUDE($ENV{FOAM_TEST_HARNESS_DIR}/CMakeFiles/OpenFOAM_Tutorials.cmake)
# Add a dummy test (/bin/true, just for debugging)
ADD_TEST(
OpenFOAM-$ENV{WM_PROJECT_VERSION}_Dummy_Test true
)
IF(RUN_FROM_ONE_TIMESTEP)
# Modify the cases controlDict file in order to run for only one time step
MESSAGE("${testRunTimeDirectory}: Modifying the controlDict files for running only one time step in directory: ${TEST_CASE_DIR}")
EXECUTE_PROCESS(
COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForOneTimeStep.sh ${TEST_CASE_DIR}
WORKING_DIRECTORY .
)
ENDIF(RUN_FROM_ONE_TIMESTEP)
ENDIF(BUILD_TESTING)
# That's it.
#

View file

@ -0,0 +1,13 @@
## This file should be placed in the root directory of your project.
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
## # The following are required to uses Dart and the Cdash dashboard
## ENABLE_TESTING()
## INCLUDE(CTest)
set(CTEST_PROJECT_NAME "OpenFOAM-1.5-dev")
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "openfoam-extend.sourceforge.net")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=OpenFOAM-1.5-dev")
set(CTEST_DROP_SITE_CDASH TRUE)

View file

@ -0,0 +1,13 @@
## This file should be placed in the root directory of your project.
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
## # The following are required to uses Dart and the Cdash dashboard
## ENABLE_TESTING()
## INCLUDE(CTest)
set(CTEST_PROJECT_NAME "OpenFOAM-1.6-ext_testing")
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "openfoam-extend.sourceforge.net")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=OpenFOAM-1.6-ext_testing")
set(CTEST_DROP_SITE_CDASH TRUE)

View file

@ -0,0 +1,107 @@
# /*---------------------------------------------------------------------------*\
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
# -------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Description
# CMake/CTest script for running the OpenFOAM tutorials
#
# Author
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
#
# \*---------------------------------------------------------------------------*/
# Take care of tests specific variables
IF(NOT DEFINED testIdSuffix)
SET(testIdSuffix "_full")
ENDIF(NOT DEFINED testIdSuffix)
IF(NOT DEFINED testRunTimeDirectory)
SET(testRunTimeDirectory "tutorialsTestSuites${testIdSuffix}")
ENDIF(NOT DEFINED testRunTimeDirectory)
# Use the current directory for running the test cases
SET (TEST_CASE_DIR $ENV{PWD}/${testRunTimeDirectory}
CACHE INTERNAL "OpenFOAM test case directory."
)
# Create the runTime directory for the test cases
MESSAGE("Removing the old test directory: ${TEST_CASE_DIR}")
file(REMOVE_RECURSE ${TEST_CASE_DIR})
MESSAGE("Creation of the new test directory: ${TEST_CASE_DIR}")
file(COPY $ENV{FOAM_TUTORIALS}/ DESTINATION ${TEST_CASE_DIR})
# Add a default Allrun file for the cases that don't have one.
# The test harness relies on the presence of an Allrun file for
# running the case
MESSAGE("${testRunTimeDirectory}: Checking for missing Allrun file in tutorials")
EXECUTE_PROCESS(
COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/addMissingAllrunFileToTutorial.sh ${TEST_CASE_DIR} $ENV{FOAM_TEST_HARNESS_DIR}/scripts/Allrun.default
WORKING_DIRECTORY .
)
# Iterate over each tutorial case:
# We are looking for tutorial cases with an Allrun file.
# If this file is present, (and it should), we add this case to the list of cases to run.
#
#First, add a global cleanup of the cases
SET(testId "Allclean_cases${testIdSuffix}")
ADD_TEST(${testId} bash -c "cd ${TEST_CASE_DIR}; ./Allclean")
# Next, recurse through the test cases root directory,
# find all the Allrun files, and add them as a new CTest test case
FILE(GLOB_RECURSE listofCasesWithAllrun ${TEST_CASE_DIR}/Allrun)
LIST(SORT listofCasesWithAllrun)
FOREACH(caseWithAllrun ${listofCasesWithAllrun})
#Grab the name of the directory containing the file Allrun
get_filename_component(thisCasePath ${caseWithAllrun} PATH)
# We need to skip the global Allrun file
IF(NOT ${thisCasePath} STREQUAL ${TEST_CASE_DIR})
MESSAGE("Found Allrun file in directory: ${thisCasePath}")
# Grab the parent name of the case directory
string(REPLACE ${TEST_CASE_DIR}/ "" caseParentPath ${caseWithAllrun})
# Construct the testId
string(REPLACE "/" "_" testId ${caseParentPath})
SET(testId ${testId}${testIdSuffix})
# Add the test to the test harness
MESSAGE("Adding test: ${testId}")
ADD_TEST(${testId} bash -c "cd ${thisCasePath}; ./Allrun")
# Use this following entry instead for testing purpose
#ADD_TEST(${testId} bash -c "cd ${thisCasePath}; true")
ENDIF(NOT ${thisCasePath} STREQUAL ${TEST_CASE_DIR})
ENDFOREACH(caseWithAllrun)
# Modify the cases Allrun files to incorporate additional shell functions
MESSAGE("${testRunTimeDirectory}: Modifying the Allrun files for additional shell functions in directory: ${TEST_CASE_DIR}")
EXECUTE_PROCESS(
COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForTestHarness.sh ${TEST_CASE_DIR} $ENV{FOAM_TEST_HARNESS_DIR}/scripts/AdditionalRunFunctions
WORKING_DIRECTORY .
)
# That's it.

View file

@ -0,0 +1,13 @@
## This file should be placed in the root directory of your project.
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
## # The following are required to uses Dart and the Cdash dashboard
## ENABLE_TESTING()
## INCLUDE(CTest)
set(CTEST_PROJECT_NAME "OpenFOAM-1.6-ext")
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "localhost")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=OpenFOAM-1.6-ext")
set(CTEST_DROP_SITE_CDASH TRUE)

View file

@ -0,0 +1,78 @@
# /*---------------------------------------------------------------------------*\
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
# -------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Description:
# README file for the CMake/CTest/CDash test harness for OpenFOAM.
#
# Author:
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved.
# \*---------------------------------------------------------------------------*/
Warning #1: Make sure your OpenFOAM environment is properly initialized before
running the test harness.
Warning #2: It is recommended to use cmake version 2.8.0 or newer for
running the test harness.
1: Instructions for starting a local test harness on your machine:
------------------------------------------------------------------
a) You can set your local system identifier using the environment variable
$CDASH_SUBMIT_LOCAL_HOST_ID. Please try using a unique identifier like
your machine's hostname. Otherwise, the fully qualified name of your system
will be used.
b) Install the CMakeLists.txt and CTestConfig.cmake files by executing the following commands:
cp ./CMakeFiles/CMakeLists.txt $WM_PROJECT_DIR
cp ./CMakeFiles/CTestConfig.cmake.openfoam-extend $WM_PROJECT_DIR/CTestConfig.cmake
c) Run the test harness and push your results on the CDash server on openfoam-extend
cd ./runDir; ./Allrun_Experimental
or
cd ./runDir; ./Allrun_Nightly
2: Instructions for restarting your setup from scratch:
-------------------------------------------------------
cd ./runDir; ./Allclean
3: About submitting your results
--------------------------------
Both Allrun_Experimental and Allrun_Nightly scripts will submit their results
to the CDash server of your choice, as specified by the file
$WM_PROJECT_DIR/CTestConfig.cmake.
To submit your results to the CDash server on openfoam-extend, just use
the file CTestConfig.cmake.openfoam-extend.
If submitted to the CDash server on openfoam-extend, your results will be displayed here:
http://openfoam-extend.sourceforge.net/CDash/index.php?project=OpenFOAM-1.5-dev

View file

@ -0,0 +1,37 @@
#!/bin/bash
# /*---------------------------------------------------------------------------*\
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
# -------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Description
# Remove everything except the various Allrun and Allclean files
#
# Author
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
#
# SourceFiles
#
# \*---------------------------------------------------------------------------*/
#set -x
ls -d * | grep -v Allrun | grep -v Allclean | xargs rm -rf

View file

@ -0,0 +1,90 @@
#!/bin/bash
# /*---------------------------------------------------------------------------*\
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
# -------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Description
# Allrun file for running the OpenFOAM test harness
# This script will only initialize the test harness using CMake
#
# Author
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
#
#
# \*---------------------------------------------------------------------------*/
#set -x
# This environment variable must point to the location of the test harness main directory
export FOAM_TEST_HARNESS_DIR=$(dirname $PWD)
# First, some sanity checks
#
# We need $WM_PROJECT_DIR
if [ -z "$WM_PROJECT_DIR" ]
then
echo "Warning:"
echo " Missing environment variable \$WM_PROJECT_DIR. Stopping."
echo " Please make sure your OpenFOAM environment is properly set up."
exit -1
fi
# We need $WM_PROJECT_DIR/CMakeLists.txt
if [ ! -e $WM_PROJECT_DIR/CMakeLists.txt ]
then
echo "Warning:"
echo " Missing file: CMakeLists.txt under \$WM_PROJECT_DIR. Stopping."
echo " A copy of CMakeLists.txt is available under $FOAM_TEST_HARNESS_DIR/CMakeFiles."
echo " Please make a copy of this file under your OpenFOAM installation directory \$WM_PROJECT_DIR."
exit -1
fi
# We also need $WM_PROJECT_DIR/CTestConfig.cmake
if [ ! -e $WM_PROJECT_DIR/CTestConfig.cmake ]
then
echo "Warning:"
echo " Missing file: CTestConfig.cmake under \$WM_PROJECT_DIR. Stopping."
echo " A copy of CTestConfig.cmake for openfoam-extend is available under $FOAM_TEST_HARNESS_DIR/CMakeFiles."
echo " For a copy of CTestConfig.cmake for your local CDash server, contact your local CDash admin."
echo " Please make a copy of this file under \$WM_PROJECT_DIR/CTestConfig.cmake."
exit -1
fi
# Make sure the CMake and tutorials runtime files are updated
# We need cmake version 2.8.0 at least
cmake $WM_PROJECT_DIR
# All set. Now we can run the available test harness
#
# Invoke make help for the complete list of available commands.
#
# User-demand testing.
# Will do: ExperimentalConfigure + ExperimentalBuild + ExperimentalTest + ExperimentalSubmit
#make Experimental
# Nightly testing
# Will do: NightlyUpdate + NightylConfigure + NightlyBuild + NightlyTest + NightlySubmit
# make Nightly
# That's it

View file

@ -0,0 +1,89 @@
#!/bin/bash
# /*---------------------------------------------------------------------------*\
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
# -------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Description
# Allrun file for running the OpenFOAM test harness
#
# Author
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
#
#
# \*---------------------------------------------------------------------------*/
#set -x
# This environment variable must point to the location of the test harness main directory
export FOAM_TEST_HARNESS_DIR=$(dirname $PWD)
# First, some sanity checks
#
# We need $WM_PROJECT_DIR
if [ -z "$WM_PROJECT_DIR" ]
then
echo "Warning:"
echo " Missing environment variable \$WM_PROJECT_DIR. Stopping."
echo " Please make sure your OpenFOAM environment is properly set up."
exit -1
fi
# We need $WM_PROJECT_DIR/CMakeLists.txt
if [ ! -e $WM_PROJECT_DIR/CMakeLists.txt ]
then
echo "Warning:"
echo " Missing file: CMakeLists.txt under \$WM_PROJECT_DIR. Stopping."
echo " A copy of CMakeLists.txt is available under $FOAM_TEST_HARNESS_DIR/CMakeFiles."
echo " Please make a copy of this file under your OpenFOAM installation directory \$WM_PROJECT_DIR."
exit -1
fi
# We also need $WM_PROJECT_DIR/CTestConfig.cmake
if [ ! -e $WM_PROJECT_DIR/CTestConfig.cmake ]
then
echo "Warning:"
echo " Missing file: CTestConfig.cmake under \$WM_PROJECT_DIR. Stopping."
echo " A copy of CTestConfig.cmake for openfoam-extend is available under $FOAM_TEST_HARNESS_DIR/CMakeFiles."
echo " For a copy of CTestConfig.cmake for your local CDash server, contact your local CDash admin."
echo " Please make a copy of this file under \$WM_PROJECT_DIR/CTestConfig.cmake."
exit -1
fi
# Make sure the CMake and tutorials runtime files are updated
# We need cmake version 2.8.0 at least
cmake $WM_PROJECT_DIR
# All set. Now we can run the available test harness
#
# Invoke make help for the complete list of available commands.
#
# User-demand testing.
# Will do: ExperimentalConfigure + ExperimentalBuild + ExperimentalTest + ExperimentalSubmit
make Experimental
# Nightly testing
# Will do: NightlyUpdate + NightylConfigure + NightlyBuild + NightlyTest + NightlySubmit
# make Nightly
# That's it

View file

@ -0,0 +1,89 @@
#!/bin/bash
# /*---------------------------------------------------------------------------*\
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
# -------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Description
# Allrun file for running the OpenFOAM test harness
#
# Author
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
#
#
# \*---------------------------------------------------------------------------*/
#set -x
# This environment variable must point to the location of the test harness main directory
export FOAM_TEST_HARNESS_DIR=$(dirname $PWD)
# First, some sanity checks
#
# We need $WM_PROJECT_DIR
if [ -z "$WM_PROJECT_DIR" ]
then
echo "Warning:"
echo " Missing environment variable \$WM_PROJECT_DIR. Stopping."
echo " Please make sure your OpenFOAM environment is properly set up."
exit -1
fi
# We need $WM_PROJECT_DIR/CMakeLists.txt
if [ ! -e $WM_PROJECT_DIR/CMakeLists.txt ]
then
echo "Warning:"
echo " Missing file: CMakeLists.txt under \$WM_PROJECT_DIR. Stopping."
echo " A copy of CMakeLists.txt is available under $FOAM_TEST_HARNESS_DIR/CMakeFiles."
echo " Please make a copy of this file under your OpenFOAM installation directory \$WM_PROJECT_DIR."
exit -1
fi
# We also need $WM_PROJECT_DIR/CTestConfig.cmake
if [ ! -e $WM_PROJECT_DIR/CTestConfig.cmake ]
then
echo "Warning:"
echo " Missing file: CTestConfig.cmake under \$WM_PROJECT_DIR. Stopping."
echo " A copy of CTestConfig.cmake for openfoam-extend is available under $FOAM_TEST_HARNESS_DIR/CMakeFiles."
echo " For a copy of CTestConfig.cmake for your local CDash server, contact your local CDash admin."
echo " Please make a copy of this file under \$WM_PROJECT_DIR/CTestConfig.cmake."
exit -1
fi
# Make sure the CMake and tutorials runtime files are updated
# We need cmake version 2.8.0 at least
cmake $WM_PROJECT_DIR
# All set. Now we can run the available test harness
#
# Invoke make help for the complete list of available commands.
#
# User-demand testing.
# Will do: ExperimentalConfigure + ExperimentalBuild + ExperimentalTest + ExperimentalSubmit
# make Experimental
# Nightly testing
# Will do: NightlyUpdate + NightylConfigure + NightlyBuild + NightlyTest + NightlySubmit
make Nightly
# That's it

View file

@ -0,0 +1,71 @@
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Description
# Additionnal run functions, based on the original RunFunctions file
#
# Author:
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
#
#------------------------------------------------------------------------------
# Exception handler: dump the tail of the log file on error
verbose_report_on_runApplication_error()
{
ecode=$?
if [ "$reportOnErrorOnlyOnce" ] ; then
echo " "
echo " => Error running $APP_RUN..."
echo " => Here are the last 50 lines of the log file log.$APP_RUN..."
echo " "
if [ -f log.$APP_RUN ] ; then
tail -50 log.$APP_RUN
exit $ecode;
fi
fi
# Do not report again when exiting
unset reportOnErrorOnlyOnce
}
# Variation of runApplication with exception handling
runApplicationAndReportOnError ()
{
trap 'verbose_report_on_runApplication_error' ERR
APP_RUN=$1; shift
reportOnErrorOnlyOnce=1
if [ -f log.$APP_RUN ] ; then
echo "$APP_RUN already run on $PWD: remove log file to run"
exit 1;
else
echo "Running $APP_RUN on $PWD"
$APP_RUN $* > log.$APP_RUN 2>&1
fi
}
# We force the display of a stack trace if we encounter problems
export FOAM_ABORT=1

View file

@ -0,0 +1,10 @@
#!/bin/bash
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application directory
parentDir=`dirname $PWD`
application=`basename $parentDir`
runApplication blockMesh
runApplication $application

View file

@ -0,0 +1,68 @@
#!/bin/bash
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# addMissingAllrunFileToTutorial.sh
#
# Description
# Add a default Allrun file to the tutorials that do not have one.
# The test harness only run tutorials with an existing Allrun file
#
# Author:
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
#
#------------------------------------------------------------------------------
#set -x
# Location of a working copy of the test cases
TEST_RUN_DIR=$1
DEFAULT_ALLRUN_FILE=$2
# Find all the test cases
for SF in `find ${TEST_RUN_DIR} -name system`
do
caseDir=`dirname $SF`
tutDir=`dirname $caseDir`
# First, some sanity check:
if [ $tutDir == $TEST_RUN_DIR ]; then
echo "--> WARNING: Badly placed tutorial: $caseDir"
fi
# Check if an Allrun file is present
if [ ! -e $caseDir/Allrun ]; then
# Sometimes, a global Allrun file is located at the tutorial level
if [ ! -e $tutDir/Allrun ]; then
# No Allrun file for this case. Let's add one.
echo "Adding a default Allrun file for tutorial : $caseDir"
cp $DEFAULT_ALLRUN_FILE $caseDir/Allrun
fi
fi
done
echo "Done."

View file

@ -0,0 +1,56 @@
#!/bin/bash
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# prepareCasesForOneTimeStep.sh
#
# Description
# Prepare a working copy of the tutorial test cases for running only one
# timeStep
#
# Modifications made by:
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
#
#------------------------------------------------------------------------------
# Location of a working copy of the test cases
TEST_RUN_DIR=$1
# Modify the controlDict files
pushd ${TEST_RUN_DIR} >& /dev/null
for CD in `find . -name "controlDict*"`
do
mv ${CD} ${CD}.org
sed \
-e s/"\(startFrom[ \d9]*\)\([a-zA-Z]*\);"/"\1 latestTime;"/g \
-e s/"\(stopAt[ \d9]*\)\([a-zA-Z]*\);"/"\1 nextWrite;"/g \
-e s/"\(writeControl[ \d9]*\)\([a-zA-Z]*\);"/"\1 timeStep;"/g \
-e s/"\(writeInterval[ \d9]*\)\([0-9a-zA-Z.-]*\);"/"\1 1;"/g \
${CD}.org > ${CD}
done
popd >& /dev/null
echo "Done."

View file

@ -0,0 +1,58 @@
#!/bin/bash
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# prepareCasesForTestHarness.sh
#
# Description
# Prepare a working copy of the test cases for a test harness.
#
# Author:
# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved
#
#------------------------------------------------------------------------------
#set -x
# Location of a working copy of the test cases
TEST_RUN_DIR=$1
#Additional shell functions
ADDITIONAL_SHELL_FUNCTIONS=$2
for AR in `find ${TEST_RUN_DIR} -name Allrun`
do
# Replace the macro runApplication with runApplicationAndReportOnError
mv ${AR} ${AR}.org
sed \
-e s/"runApplication "/"runApplicationAndReportOnError "/g \
-e /RunFunctions/r${ADDITIONAL_SHELL_FUNCTIONS} \
${AR}.org > ${AR}
# Make sure the Allrun file is executable
chmod +x ${AR}
done
echo "Done."

16
testHarness/README.txt Normal file
View file

@ -0,0 +1,16 @@
Description
===========
This part of the repository is for OpenFOAM test harnesses.
Directory Structure
===================
OpenFOAM : CMake/CTest scripts for compilation and execution test harness for OpenFOAM.
OpenFOAM/1.5-dev : Test harness for OpenFOAM version 1.5-dev. See the file OpenFOAM/1.5-dev/README.txt for more information
OSIG : CMake/CTest scripts for OpenFOAM Special Interest Group (OSIG) test harness
OSIG/TurboMachinery : Test harness for the TurboMachinery OSIG. See the file OSIG/Turbomachinery/README.txt for more information.
Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved.