2010-10-07 03:00:07 +00:00
|
|
|
#!/bin/bash
|
2010-11-24 22:59:17 +00:00
|
|
|
# /*-------------------------------------------------------------------------*\
|
2010-10-07 03:00:07 +00:00
|
|
|
# ========= |
|
|
|
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
|
|
# \\ / O peration |
|
|
|
|
# \\ / A nd | Copyright held by original author
|
|
|
|
# \\/ M anipulation |
|
2010-11-24 22:59:17 +00:00
|
|
|
# -----------------------------------------------------------------------------
|
2010-10-07 03:00:07 +00:00
|
|
|
# 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
|
|
|
|
#
|
|
|
|
#
|
2010-11-24 22:59:17 +00:00
|
|
|
# \*-------------------------------------------------------------------------*/
|
2010-10-07 03:00:07 +00:00
|
|
|
|
|
|
|
#set -x
|
|
|
|
|
2010-11-24 22:59:17 +00:00
|
|
|
# This environment variable must point to the location of the test harness
|
|
|
|
# main directory
|
2010-10-07 03:00:07 +00:00
|
|
|
export FOAM_TEST_HARNESS_DIR=$(dirname $PWD)
|
|
|
|
|
|
|
|
# First, some sanity checks
|
|
|
|
#
|
|
|
|
|
|
|
|
# We need $WM_PROJECT_DIR
|
|
|
|
if [ -z "$WM_PROJECT_DIR" ]
|
|
|
|
then
|
|
|
|
echo "Warning:"
|
2013-07-18 01:02:34 +00:00
|
|
|
echo " Missing environment variable \$WM_PROJECT_DIR. Stopping."
|
2010-10-07 03:00:07 +00:00
|
|
|
echo " Please make sure your OpenFOAM environment is properly set up."
|
|
|
|
exit -1
|
|
|
|
fi
|
|
|
|
|
2013-07-18 01:02:34 +00:00
|
|
|
# We need $WM_PROJECT_DIR/CMakeLists.txt
|
2010-10-07 03:00:07 +00:00
|
|
|
if [ ! -e $WM_PROJECT_DIR/CMakeLists.txt ]
|
|
|
|
then
|
|
|
|
echo "Warning:"
|
2013-07-18 01:02:34 +00:00
|
|
|
echo " Missing file: CMakeLists.txt under \$WM_PROJECT_DIR. Stopping."
|
|
|
|
echo " A copy of CMakeLists.txt is available under $FOAM_TEST_HARNESS_DIR/CMakeFiles."
|
2010-10-07 03:00:07 +00:00
|
|
|
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:"
|
2013-07-18 01:02:34 +00:00
|
|
|
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."
|
2010-10-07 03:00:07 +00:00
|
|
|
echo " Please make a copy of this file under \$WM_PROJECT_DIR/CTestConfig.cmake."
|
|
|
|
exit -1
|
|
|
|
fi
|
|
|
|
|
2013-11-29 16:19:01 +00:00
|
|
|
# Install Hydro-Quebec Tools if necessary
|
|
|
|
command -v pyFoamChangeMixingPlaneBoundary.py >/dev/null
|
|
|
|
if [ $? -ne 0 ];
|
|
|
|
then
|
|
|
|
${WM_THIRD_PARTY_DIR}/AllMake.stage6
|
|
|
|
fi
|
|
|
|
|
2010-10-07 03:00:07 +00:00
|
|
|
# Make sure the CMake and tutorials runtime files are updated
|
|
|
|
# We need cmake version 2.8.0 at least
|
2013-07-18 01:02:34 +00:00
|
|
|
cmake $WM_PROJECT_DIR
|
2010-10-07 03:00:07 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2013-07-18 01:02:34 +00:00
|
|
|
# Nightly testing
|
2010-10-07 03:00:07 +00:00
|
|
|
# Will do: NightlyUpdate + NightylConfigure + NightlyBuild + NightlyTest + NightlySubmit
|
|
|
|
# make Nightly
|
|
|
|
|
|
|
|
# That's it
|