Skip to content

Commit

Permalink
Merge branch '278-improve-ctest-s-git-commands' (#278, TRIL-260)
Browse files Browse the repository at this point in the history
Build/Test Cases Summary
Enabled Packages:
Enabled all Packages
0) MPI_DEBUG => passed: passed=341,notpassed=0 (0.87 min)
1) SERIAL_RELEASE => passed: passed=341,notpassed=0 (0.93 min)
Other local commits for this build/test group: 76e958d, 3507ab4, 49d9c81, 2541677, 5e1677e
  • Loading branch information
bartlettroscoe committed Feb 20, 2019
2 parents 4e8cf7d + 76e958d commit 004d9b3
Show file tree
Hide file tree
Showing 27 changed files with 1,504 additions and 358 deletions.
25 changes: 25 additions & 0 deletions cmake/ctest/TribitsProjCTestDriver.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

# Set the locations of things for this project
#

SET(TRIBITS_PROJECT_ROOT "${CMAKE_CURRENT_LIST_DIR}/../..")
SET(TriBITS_TRIBITS_DIR "${CMAKE_CURRENT_LIST_DIR}/../../tribits")

#
# Include the TriBITS file to get other modules included
#

INCLUDE("${CMAKE_CURRENT_LIST_DIR}/../../tribits/ctest_driver/TribitsCTestDriverCore.cmake")

#
# Define a caller for the TriBITS Project
#

MACRO(TRIBITS_PROJ_CTEST_DRIVER)
SET_DEFAULT(TriBITS_REPOSITORY_LOCATION_DEFAULT
"https://github.com/TriBITSPub/TriBITS.git")
SET_DEFAULT(TriBITS_REPOSITORY_LOCATION_NIGHTLY_DEFAULT
"${TriBITS_REPOSITORY_LOCATION_DEFAULT}")
PRINT_VAR(TriBITS_REPOSITORY_LOCATION_DEFAULT)
TRIBITS_CTEST_DRIVER()
ENDMACRO()
31 changes: 31 additions & 0 deletions cmake/ctest/generic_gcc/ctest_genertic_gcc_serial_debug.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/../TribitsProjCTestDriver.cmake")

#
# Set the options specific to this build case
#

SET(COMM_TYPE SERIAL)
SET(BUILD_TYPE DEBUG)
SET(BUILD_DIR_NAME GCC_${COMM_TYPE}_${BUILD_TYPE})
SET(CTEST_TEST_TIMEOUT 60)

SET_DEFAULT_AND_FROM_ENV( CTEST_BUILD_FLAGS "-j8 -k" )

SET_DEFAULT_AND_FROM_ENV( CTEST_PARALLEL_LEVEL "8" )

SET( EXTRA_CONFIGURE_OPTIONS
"-DBUILD_SHARED_LIBS:BOOL=ON"
"-DCMAKE_BUILD_TYPE=DEBUG"
"-DCMAKE_C_COMPILER=gcc"
"-DCMAKE_CXX_COMPILER=g++"
"-DCMAKE_Fortran_COMPILER=gfortran"
"-DTriBITS_TRACE_ADD_TEST=ON"
)

SET(CTEST_TEST_TYPE Nightly)

#
# Run the CTest driver and submit to CDash
#

TRIBITS_PROJ_CTEST_DRIVER()
17 changes: 4 additions & 13 deletions cmake/ctest/travisci/ctest_trusty_serial_debug.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
#
# Set the locations of things for this project
#

SET(TRIBITS_PROJECT_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../..")
SET(TriBITS_TRIBITS_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../tribits")

#
# Include the TriBITS file to get other modules included
#

INCLUDE("${CMAKE_CURRENT_LIST_DIR}/../../../tribits/ctest_driver/TribitsCTestDriverCore.cmake")
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/../TribitsProjCTestDriver.cmake")

#
# Set the options specific to this build case
Expand All @@ -35,7 +24,9 @@ SET( EXTRA_CONFIGURE_OPTIONS
"-DTriBITS_ENABLE_Fortran=ON"
"-DTriBITS_CTEST_DRIVER_COVERAGE_TESTS=TRUE"
"-DTriBITS_CTEST_DRIVER_MEMORY_TESTS=TRUE"
"-DTriBITS_ENABLE_REAL_GIT_CLONE_TESTS=TRUE"
"-DTriBITS_TRACE_ADD_TEST=ON"
"-DTriBITS_SHOW_TEST_START_END_DATE_TIME=ON"
"-DTriBITS_HOSTNAME=${CTEST_SITE}"
)

Expand All @@ -45,4 +36,4 @@ SET(CTEST_TEST_TYPE Continuous)
# Run the CTest driver and submit to CDash
#

TRIBITS_CTEST_DRIVER()
TRIBITS_PROJ_CTEST_DRIVER()
2 changes: 1 addition & 1 deletion test/core/ExamplesUnitTests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3158,7 +3158,7 @@ TRIBITS_ADD_ADVANCED_TEST( TribitsExampleMetaProject
-DTribitsExMetaProj_ENABLE_TESTS=ON
TribitsExampleMetaProject
PASS_REGULAR_EXPRESSION_ALL
"Reading the list of extra repositories from cmake/ExtraRepositoriesList.cmake"
"Reading the list of extra repositories from .*cmake/ExtraRepositoriesList.cmake"
"-- Adding POST extra Continuous repository TribitsExampleProject "
"-- Adding POST extra Continuous repository TribitsExampleProject "
"Reading list of native packages from .*/TribitsExampleMetaProject/PackagesList.cmake"
Expand Down
37 changes: 37 additions & 0 deletions test/ctest_driver/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
TRIBITS_ADD_ADVANCED_TEST( CTestDriverUnitTests
OVERALL_WORKING_DIRECTORY TEST_NAME
TEST_0 CMND ${CMAKE_COMMAND}
ARGS
-DPROJECT_NAME=${PROJECT_NAME}
-D${PROJECT_NAME}_TRIBITS_DIR=${${PROJECT_NAME}_TRIBITS_DIR}
-P "${CMAKE_CURRENT_SOURCE_DIR}/CTestDriverUnitTests.cmake"
PASS_REGULAR_EXPRESSION_ALL
"Final UnitTests Result: num_run = 2"
"Final UnitTests Result: PASSED"
)


TRIBITS_ADD_ADVANCED_TEST( TribitsGetCTestTestXmlDir
OVERALL_WORKING_DIRECTORY TEST_NAME

TEST_0 CMND ${CMAKE_COMMAND}
ARGS
-DPROJECT_NAME=${PROJECT_NAME}
-D${PROJECT_NAME}_TRIBITS_DIR=${${PROJECT_NAME}_TRIBITS_DIR}
-DCTEST_BUILD_DIR="${CMAKE_CURRENT_LIST_DIR}/data/dummy_build_dir"
-P "${${PROJECT_NAME}_TRIBITS_DIR}/ctest_driver/TribitsGetCTestTestXmlDir.cmake"
PASS_REGULAR_EXPRESSION_ALL
"${CMAKE_CURRENT_LIST_DIR}/data/dummy_build_dir/Testing/20101015-1112"
)


ADD_SUBDIRECTORY(MockCTestDriver)


IF (CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
ADD_SUBDIRECTORY(TribitsExampleProject)
ENDIF()

SET(${PROJECT_NAME}_ENABLE_REAL_GIT_CLONE_TESTS OFF CACHE BOOL
"If TRUE, then perform tests that do real clones of repos from GitHub.")

IF (CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" AND
${PROJECT_NAME}_ENABLE_REAL_GIT_CLONE_TESTS
)
ADD_SUBDIRECTORY(TribitsExampleMetaProject)
ENDIF()
89 changes: 89 additions & 0 deletions test/ctest_driver/CTestDriverUnitTests.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# @HEADER
# ************************************************************************
#
# TriBITS: Tribal Build, Integrate, and Test System
# Copyright 2013 Sandia Corporation
#
# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
# the U.S. Government retains certain rights in this software.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the Corporation nor the names of the
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# ************************************************************************
# @HEADER

MESSAGE("PROJECT_NAME = ${PROJECT_NAME}")
MESSAGE("${PROJECT_NAME}_TRIBITS_DIR = ${${PROJECT_NAME}_TRIBITS_DIR}")

SET( CMAKE_MODULE_PATH
"${${PROJECT_NAME}_TRIBITS_DIR}/core/utils"
"${${PROJECT_NAME}_TRIBITS_DIR}/core/package_arch"
"${${PROJECT_NAME}_TRIBITS_DIR}/ctest_driver"
)

INCLUDE(GlobalSet)
INCLUDE(TribitsReadTagFile)
INCLUDE(UnitTestHelpers)


FUNCTION(UNITTEST_READ_CTEST_TAG_FILE)

MESSAGE("\n***")
MESSAGE("*** Testing tribits_read_ctest_tag_file()")
MESSAGE("***\n")

SET(TAG_FILE_IN "${CMAKE_CURRENT_LIST_DIR}/data/dummy_build_dir/Testing/TAG")

TRIBITS_READ_CTEST_TAG_FILE(${TAG_FILE_IN} BUILD_START_TIME_OUT CDASH_TRACK_OUT)

UNITTEST_COMPARE_CONST(BUILD_START_TIME_OUT
"20101015-1112")

UNITTEST_COMPARE_CONST(CDASH_TRACK_OUT
"My CDash Track") # NOTE: Spaces are important to test here!

ENDFUNCTION()

#
# Execute the unit tests
#

# Assume that all unit tests will pass by default
GLOBAL_SET(UNITTEST_OVERALL_PASS TRUE)
GLOBAL_SET(UNITTEST_OVERALL_NUMPASSED 0)
GLOBAL_SET(UNITTEST_OVERALL_NUMRUN 0)

# Run the unit test functions
UNITTEST_READ_CTEST_TAG_FILE()

MESSAGE("\n***")
MESSAGE("*** Determine final result of all unit tests")
MESSAGE("***\n")

# Pass in the number of expected tests that must pass!
UNITTEST_FINAL_RESULT(2)
Loading

0 comments on commit 004d9b3

Please sign in to comment.