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 # "ctest -S" script configured to drive the Experimental, Nightly and
26 # Continuous dashboards for the FOAM tutorials
29 # Martin Beaudoin, Hydro-Quebec, 2015. All rights reserved
31 # \*-------------------------------------------------------------------------*/
33 set(THIS_SUBPROJECT "Tutorials")
34 set(CTEST_SOURCE_DIRECTORY $ENV{WM_PROJECT_DIR})
35 set(CTEST_BINARY_DIRECTORY "@binary_dir@")
36 set(CTEST_BUILD_NAME "@BUILDNAME@")
37 set(CTEST_SITE "@SITE@")
38 set(PROCESSOR_COUNT $ENV{WM_NCOMPPROCS})
39 set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
41 # We add the current script as a Build note.
42 set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
46 set(CTEST_BUILD_FLAGS "-j${PROCESSOR_COUNT}")
50 # We will be using a CDash subproject if the required subproject is defined
51 # on the remote CDash server.
52 # Otherwise, the results will still get submitted, but under the global
53 # "Project" Dashboard, not under the "SubProjects" section.
54 # This way, we keep on supporting CDash sites where subprojects are
57 # Get the CTEST_PROJECT_SUBPROJECTS definition:
58 include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake)
60 list(FIND CTEST_PROJECT_SUBPROJECTS ${THIS_SUBPROJECT} subProjectIsSupported)
62 if (NOT subProjectIsSupported EQUAL -1)
63 message("Dashboard: Using SubProject: ${THIS_SUBPROJECT}")
64 set_property(GLOBAL PROPERTY SubProject ${THIS_SUBPROJECT})
65 set_property(GLOBAL PROPERTY Label ${THIS_SUBPROJECT})
68 # Select the required model : Experimental, Nightly, Continuous
69 # Default model: Experimental
70 set(DASHBOARD_MODEL Experimental)
71 if(${CTEST_SCRIPT_ARG} MATCHES Nightly)
72 set(DASHBOARD_MODEL Nightly)
73 elseif(${CTEST_SCRIPT_ARG} MATCHES Continuous)
74 set(DASHBOARD_MODEL Continuous)
77 # Starting the various tests for the specified dashboard model
78 ctest_start(${DASHBOARD_MODEL})
80 # No need to configure, cmake took care of it already
84 # Intentionally no ctest_update() step in this script when running the
85 # Experimental dashboard.
86 # We do not want the source code to get updated since we actually want to test
87 # the current instance of this source code. So we can test without having to
88 # commit the source code
90 if(${DASHBOARD_MODEL} MATCHES Experimental)
91 message("Experimental dashboard: We skip the repository update.")
93 # Updating the repository for the Nightly and Continuous dashboards
97 # We compile the source code
103 # We submit the results to the CDash service