Skip to content

Commit

Permalink
Automatic snapshot commit from tribits at 17dc675
Browse files Browse the repository at this point in the history
Origin repo remote tracking branch: 'github/master'
Origin repo remote repo URL: 'github = [email protected]:TriBITSPub/TriBITS.git'

At commit:

commit 17dc675cd4cec292ced5f2c86e09a4eadf621f64
Author:  Roscoe A. Bartlett <[email protected]>
Date:    Mon Jul 10 20:28:48 2017 -0600
Summary: Don't add tests when tests not enabled (#204)
  • Loading branch information
bartlettroscoe committed Jul 11, 2017
1 parent 55074a3 commit da73b0c
Show file tree
Hide file tree
Showing 31 changed files with 281 additions and 196 deletions.
6 changes: 3 additions & 3 deletions cmake/tribits/README.DIRECTORY_CONTENTS.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
TriBITS/tribits/ Directory Contents
+++++++++++++++++++++++++++++++++++

This directory contains the implementation for the varous parts of TriBITS
This directory contains the implementation for the various parts of TriBITS
that are used by TriBITS projects to implement TriBITS functionality. It also
contains basic documentation in the subdirectory doc/ that is very close to
the TriBITS implementation. Files and directories from here are what get
installed on the system or will be snapshotted into
``<projectDir>/cmake/tribits/``. Each TriBITS Project decides what parts of
TriBITS it wants to install or shapshot using the script
TriBITS it wants to install or snapshot using the script
``tribits/snapshot_tribits.py`` (which takes arguments for what dirs to
snapshot). This directory contains no tests at all. All of the tests for
TriBITS are in the ``test/`` directory in the parent TriBITS repository.
Expand Down Expand Up @@ -46,7 +46,7 @@ If you have a better way to manage multiple builds (e.g. Jenkins) then use
that instead.

**common_tpls/**: TPLs that are very common and are used by several different
TriBITS projects but are not built into the TriBITS system itslef. Having some
TriBITS projects but are not built into the TriBITS system itself. Having some
of these common TPLs in a central location enhances uniformity, reuse, and
makes it easier to pull TriBITS packages out of a repo and build them
independently.
Expand Down
19 changes: 18 additions & 1 deletion cmake/tribits/ci_support/TribitsDependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ class TribitsDependencies:

def __init__(self):
self.__projectName = None
self.__projectBaseDirName = None
self.__packagesList = []
self.__packagesNameToID = {}
self.__packagesDirToID = {}
Expand All @@ -220,6 +221,14 @@ def getProjectName(self):
return self.__projectName


def setProjectBaseDirName(self, projectBaseDirName):
self.__projectBaseDirName = projectBaseDirName


def getProjectBaseDirName(self):
return self.__projectBaseDirName


def addPackageDependencies(self, packageDeps):
packageName = packageDeps.packageName
packageDir = packageDeps.packageDir
Expand Down Expand Up @@ -558,17 +567,22 @@ def createCDashXML(self):

xmlText += "<Project name=\""+self.getProjectName()+"\">\n"

projectBaseDirName = self.getProjectBaseDirName()

numPackages = self.numPackages()

for package_i in range(numPackages):

packageDeps = self.__packagesList[package_i]

packageName = packageDeps.packageName
packagePath = packageDeps.packageDir

if packageDeps.parentPackage == "":

xmlText += (" <SubProject name=\""+packageName+"\">\n")

xmlText += (" <Path>"+packagePath+"</Path>\n")

xmlText += \
" <EmailAddresses>\n"+\
Expand Down Expand Up @@ -634,7 +648,10 @@ def getProjectDependenciesFromXmlFile(xmlFile):
#print("\npackageDepXmlDom =", dir(packageDepXmlDom))
#print("\npackageDepXmlDom.documentElement =", dir(packageDepXmlDom.documentElement))
projectDependencies = TribitsDependencies()
projectDependencies.setProjectName(packageDepXmlDom.documentElement.getAttribute('project'))
projectDependencies.setProjectName(
packageDepXmlDom.documentElement.getAttribute('project'))
projectDependencies.setProjectBaseDirName(
packageDepXmlDom.documentElement.getAttribute('baseDirName'))
for ele in packageDepXmlDom.childNodes[0].childNodes:
if ele.nodeType == ele.ELEMENT_NODE:
packageName = ele.getAttribute('name')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ FUNCTION(TRIBITS_DUMP_DEPS_XML_FILE)

SET(DEPS_XM)

GET_FILENAME_COMPONENT(PROJECT_BASE_DIR_NAME "${${PROJECT_NAME}_SOURCE_DIR}" NAME)

LIST(APPEND DEPS_XML
"<PackageDependencies project=\"${PROJECT_NAME}\">\n")
"<PackageDependencies project=\"${PROJECT_NAME}\" baseDirName=\"${PROJECT_BASE_DIR_NAME}\">\n"
)

SET(PACKAGE_IDX 0)
FOREACH(TRIBITS_PACKAGE ${${PROJECT_NAME}_SE_PACKAGES})
Expand Down
8 changes: 4 additions & 4 deletions cmake/tribits/ci_support/clone_extra_repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<projectDir>/"""+g_extraRerposFileDefault+r"""
(other repo types can be selected usng --extra-repos-type).
(other repo types can be selected using --extra-repos-type).
The list of which repos to clone can be "white-list" selected with the option
--extra-repos (see options below for details). Extra repos can in addition be
Expand All @@ -94,7 +94,7 @@
If the git repo server is using gitolite, one can set
--gitolite-root=<gitolite-root> and that will result in git repos being
selected only if the selcted repos are listed in 'ssh <gitolite-root> info'.
selected only if the selected repos are listed in 'ssh <gitolite-root> info'.
This allows one to automatically exclude repos from being cloned that the user
has no permissions to clone. NOTE: See warning about the --gitolite-root option below!
Expand Down Expand Up @@ -154,7 +154,7 @@ def injectCmndLineOptionsInParser(clp, gitoliteRootDefault=""):
"--extra-repos-type", "extraReposType",
g_extraReposTypes , g_extraReposTypesDefaulIdx,
"Type of extra repositories <extra-repos-type> to select from " \
"<extra-repos-file>. When --extra-repos is set, then this arugment" \
"<extra-repos-file>. When --extra-repos is set, then this argument" \
" is ignored.",
clp )

Expand All @@ -164,7 +164,7 @@ def injectCmndLineOptionsInParser(clp, gitoliteRootDefault=""):
" If specified, then any git repos with the <gitolite-root> listed as their" \
" root will only be selected if they are listed with 'R' permissions returned" \
" from 'ssh <gitolite-root> info'. WARNING: Make sure that you have your" \
" gitoliote SSH registred correctly before using this option by typing" \
" gitoliote SSH registered correctly before using this option by typing" \
" the command 'ssh <gitlite-root> info' and make sure that it does *not*"
" ask for a password! (Default = '"+gitoliteRootDefault+"')" )

Expand Down
16 changes: 14 additions & 2 deletions cmake/tribits/core/package_arch/TribitsAddAdvancedTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ INCLUDE(PrintVar)
# than just grepping STDOUT (e.g. by running separate post-processing programs
# to examine output files).
#
# The test is only added if tests are enabled for the SE package
# (i.e. `${PACKAGE_NAME}_ENABLE_TESTS`_) or the parent package (if this is a
# subpackage) (i.e. ``${PARENT_PACKAGE_NAME}_ENABLE_TESTS``). (NOTE: A more
# efficient way to optionally enable tests is to put them in a ``test/``
# subdir and then include that subdir with `TRIBITS_ADD_TEST_DIRECTORIES()`_.)
#
# Each atomic test case is either a package-built executable or just a basic
# command. An atomic test command block ``TEST_<idx>`` (i.e. ``TEST_0``,
# ``TEST_1``, ..., up to ``TEST_19``) takes the form::
Expand Down Expand Up @@ -404,7 +410,7 @@ INCLUDE(PrintVar)
#
# If specified, the test command will be assumed to pass if it matches the
# given regular expression. Otherwise, it is assumed to fail. TIPS:
# Replace ';' with '[;]' or CMake will interpretet this as a array eleemnt
# Replace ';' with '[;]' or CMake will interpret this as an array elemnt
# boundary. To match '.', use '[.]'.
#
# ``PASS_REGULAR_EXPRESSION_ALL "<regex1>" "<regex2>" ... "<regexn>"``
Expand All @@ -413,7 +419,7 @@ INCLUDE(PrintVar)
# matches all of the provided regular expressions. Note that this is not
# a capability of raw ctest and represents an extension provided by
# TriBITS. NOTE: It is critical that you replace ';' with '[;]' or CMake
# will interpretet this as a array eleemnt boundary.
# will interpret this as an array elemnt boundary.
#
# ``STANDARD_PASS_OUTPUT``
#
Expand Down Expand Up @@ -740,6 +746,12 @@ FUNCTION(TRIBITS_ADD_ADVANCED_TEST TEST_NAME_IN)
# B) Add or don't add tests based on a number of criteria
#

SET(ADD_THE_TEST FALSE)
TRIBITS_ADD_TEST_PROCESS_ENABLE_TESTS(ADD_THE_TEST)
IF (NOT ADD_THE_TEST)
RETURN()
ENDIF()

SET(ADD_THE_TEST FALSE)
TRIBITS_ADD_TEST_PROCESS_CATEGORIES(ADD_THE_TEST)
IF (NOT ADD_THE_TEST)
Expand Down
10 changes: 5 additions & 5 deletions cmake/tribits/core/package_arch/TribitsAddExecutable.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ INCLUDE(CMakeParseArguments)
#
# ``<exeRootName>``
#
# The root name of the exectuable (and CMake target) (see `Executable and
# The root name of the executable (and CMake target) (see `Executable and
# Target Name (TRIBITS_ADD_EXECUTABLE())`_). This must be the first
# argument.
#
Expand All @@ -114,7 +114,7 @@ INCLUDE(CMakeParseArguments)
# If passed in, the directory path relative to the package's base
# directory (with "/" replaced by "_") is added to the executable name
# (see `Executable and Target Name (TRIBITS_ADD_EXECUTABLE())`_). This
# provides a simple way to create unique test exectuable names inside of a
# provides a simple way to create unique test executable names inside of a
# given TriBITS package. Only test executables in the same directory
# would need to have unique ``<execRootName>`` passed in.
#
Expand Down Expand Up @@ -253,7 +253,7 @@ INCLUDE(CMakeParseArguments)
# set with the name of the executable target passed to
# ``ADD_EXECUTABLE(<exeTargetName> ... )``. Having this name allows the
# calling ``CMakeLists.txt`` file access and set additional target
# propeties (see `Additional Executable and Source File Properties
# properties (see `Additional Executable and Source File Properties
# (TRIBITS_ADD_EXECUTABLE())`_).
#
# .. _Executable and Target Name (TRIBITS_ADD_EXECUTABLE()):
Expand All @@ -278,7 +278,7 @@ INCLUDE(CMakeParseArguments)
# added to the actual executable file name if the option ``NOEXESUFFIX`` is
# *not* passed in but this suffix is never added to the target name.
# (However, note that on Windows platforms, the default ``*.exe`` extension is
# always added because windows will not run an exectuable in many contexts
# always added because windows will not run an executable in many contexts
# unless it has the ``*.exe`` extension.)
#
# The reason that a default prefix is prepended to the executable and target
Expand Down Expand Up @@ -355,7 +355,7 @@ FUNCTION(TRIBITS_ADD_EXECUTABLE EXE_NAME)
SET(${PARSE_ADDED_EXE_TARGET_NAME_OUT} PARENT_SCOPE)
ENDIF()
#
# B) Exclude building the test executable based on some several criteria
# B) Exclude building the test executable based on some criteria
#

SET(ADD_THE_TEST FALSE)
Expand Down
26 changes: 19 additions & 7 deletions cmake/tribits/core/package_arch/TribitsAddTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ INCLUDE(TribitsAddTestHelpers)
# [ADDED_TESTS_NAMES_OUT <testsNames>]
# )
#
# The tests are only added if tests are enabled for the SE package
# (i.e. `${PACKAGE_NAME}_ENABLE_TESTS`_) or the parent package (if this is a
# subpackage) (i.e. ``${PARENT_PACKAGE_NAME}_ENABLE_TESTS``). (NOTE: A more
# efficient way to optionally enable tests is to put them in a ``test/``
# subdir and then include that subdir with `TRIBITS_ADD_TEST_DIRECTORIES()`_.)
#
# *Sections:*
#
# * `Formal Arguments (TRIBITS_ADD_TEST())`_
Expand Down Expand Up @@ -167,7 +173,7 @@ INCLUDE(TribitsAddTestHelpers)
# ``POSTFIX_AND_ARGS_<IDX>`` form instead. **WARNING:** Multiple
# arguments passed to a single test invocation must be quoted or multiple
# tests taking single arguments will be created instead! See `Adding
# Multiple Tests (TRIBITS_ADD_TEST())`_ for more details and exmaples.
# Multiple Tests (TRIBITS_ADD_TEST())`_ for more details and examples.
#
# ``POSTFIX_AND_ARGS_<IDX> <postfix> <arg0> <arg1> ...``
#
Expand All @@ -187,7 +193,7 @@ INCLUDE(TribitsAddTestHelpers)
# that one can give a meaningful name to each test case and one can
# specify multiple arguments without having to quote them and one can
# allow long argument lists to span multiple lines. See `Adding Multiple
# Tests (TRIBITS_ADD_TEST())`_ for more details and exmaples.
# Tests (TRIBITS_ADD_TEST())`_ for more details and examples.
#
# ``COMM [serial] [mpi]``
#
Expand Down Expand Up @@ -272,7 +278,7 @@ INCLUDE(TribitsAddTestHelpers)
# the environment``) for which the test is allowed to be added. If
# ``HOSTTYPE`` is specified and ``CMAKE_HOST_SYSTEM_NAME`` is not equal to
# one of the values of ``<hosttypei>``, then the test will **not** be
# added. Typical host system type names include ``Linux``, ``Darwain``,
# added. Typical host system type names include ``Linux``, ``Darwin``,
# ``Windows``, etc.
#
# ``XHOSTTYPE <hosttype0> <hosttype1> ...``
Expand Down Expand Up @@ -347,7 +353,7 @@ INCLUDE(TribitsAddTestHelpers)
# with the name(S) of the tests passed to ``ADD_TEST()``. If more than
# one test is added, then this will be a list of test names. Having this
# name allows the calling ``CMakeLists.txt`` file access and set
# additional test propeties (see `Setting additional test properties
# additional test properties (see `Setting additional test properties
# (TRIBITS_ADD_TEST())`_).
#
# In the end, this function just calls the built-in CMake commands
Expand Down Expand Up @@ -399,7 +405,7 @@ INCLUDE(TribitsAddTestHelpers)
# run in this case.
#
# NOTE: On native Windows platforms, the ``NOEXESUFFIX`` will still allow
# CTest to run exectuables that have the ``*.exe`` suffix.
# CTest to run executables that have the ``*.exe`` suffix.
#
# Whatever executable path is specified using this logic, if the executable is
# not found, then when ``ctest`` goes to run the test, it will mark it as
Expand Down Expand Up @@ -459,7 +465,7 @@ INCLUDE(TribitsAddTestHelpers)
#
# may be preferable since it will not add any postfix name to the test. To
# add more than one test case using ``ARGS``, one will use more than one
# quoted set of arugments such as with::
# quoted set of arguments such as with::
#
# ARGS "<arg0> <arg1>" "<arg2> <arg2>"
#
Expand All @@ -477,7 +483,7 @@ INCLUDE(TribitsAddTestHelpers)
# the individual tests can be given more understandable names.
#
# The other advantage of the ``POSTFIX_AND_ARGS_<IDX>`` form is that the
# arugments ``<arg0>``, ``<arg1>``, ... do not need to be quoted and can
# arguments ``<arg0>``, ``<arg1>``, ... do not need to be quoted and can
# therefore be extended over multiple lines like::
#
# POSTFIX_AND_ARGS_0 long_args --this-is-the-first-long-arg=very
Expand Down Expand Up @@ -804,6 +810,12 @@ FUNCTION(TRIBITS_ADD_TEST EXE_NAME)
# B) Add or don't add tests based on a number of criteria
#

SET(ADD_THE_TEST FALSE)
TRIBITS_ADD_TEST_PROCESS_ENABLE_TESTS(ADD_THE_TEST)
IF (NOT ADD_THE_TEST)
RETURN()
ENDIF()

SET(ADD_THE_TEST FALSE)
TRIBITS_ADD_TEST_PROCESS_CATEGORIES(ADD_THE_TEST)
IF (NOT ADD_THE_TEST)
Expand Down
25 changes: 25 additions & 0 deletions cmake/tribits/core/package_arch/TribitsAddTestHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,31 @@ FUNCTION(TRIBITS_CONVERT_CMND_ARG_STRING_TO_ADD_TEST_ARG_ARRAY CMND_ARG_STRING A
ENDFUNCTION()


#
# Determine if to add the test based on if testing is enabled for the current
# package or subpackage.
#

FUNCTION(TRIBITS_ADD_TEST_PROCESS_ENABLE_TESTS ADD_THE_TEST_OUT)
IF(${PACKAGE_NAME}_ENABLE_TESTS OR ${PARENT_PACKAGE_NAME}_ENABLE_TESTS)
SET(ADD_THE_TEST TRUE)
ELSE()
IF (PARENT_PACKAGE_NAME STREQUAL PACKAGE_NAME)
SET(PARENT_EANBLE_TESTS_DISABLE_MSG)
ELSE()
SET(PARENT_EANBLE_TESTS_DISABLE_MSG
", ${PARENT_PACKAGE_NAME}_ENABLE_TESTS='${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}'"
)
ENDIF()
MESSAGE_WRAPPER(
"-- ${TEST_NAME}: NOT added test because ${PACKAGE_NAME}_ENABLE_TESTS='${${PACKAGE_NAME}_ENABLE_TESTS}${PARENT_EANBLE_TESTS_DISABLE_MSG}'."
)
SET(ADD_THE_TEST FALSE)
ENDIF()
SET(${ADD_THE_TEST_OUT} ${ADD_THE_TEST} PARENT_SCOPE)
ENDFUNCTION()


#
# Determine if to add the test or not based on [X]HOST and [X]HOSTTYPE arguments
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ FUNCTION(TRIBITS_ABORT_ON_MISSING_PACKAGE DEP_PKG PACKAGE_NAME DEP_PKG_LIST_
"Error, the package '${DEP_PKG}' is listed as a dependency of the package"
" '${PACKAGE_NAME}' is in the list '${DEP_PKG_LIST_NAME}' but the package"
" '${DEP_PKG}' is either not defined or is listed later in the package order."
" This may also be an attempt to create a cicular dependency between"
" the packages '${DEP_PKG}' and '${PACKAGE_NAME}' (which is not allowed)."
" Check the spelling of '${DEP_PKG}' or see how it is listed in"
" ${PROJECT_NAME}_PACKAGES_AND_DIRS_AND_CLASSIFICATIONS in relationship to"
" '${PACKAGE_NAME}'.")
Expand Down Expand Up @@ -460,7 +462,7 @@ ENDMACRO()
# directly setting the variables is that an SE package only needs to list
# dependencies that exist. Otherwise, the ``Dependencies.cmake`` file will
# need to set all of the above local variables, even those that are empty.
# This is a error checking property of the TriBITS system to avoid misspelling
# This is an error checking property of the TriBITS system to avoid misspelling
# the names of these variables.
#
MACRO(TRIBITS_PACKAGE_DEFINE_DEPENDENCIES)
Expand Down
Loading

0 comments on commit da73b0c

Please sign in to comment.