diff --git a/cmake/ctest/drivers/rocketman/CMakeLists.txt b/cmake/ctest/drivers/rocketman/CMakeLists.txt new file mode 100644 index 000000000000..62bcf6da7c70 --- /dev/null +++ b/cmake/ctest/drivers/rocketman/CMakeLists.txt @@ -0,0 +1,11 @@ +TRILINOS_DRIVER_SETUP() + +TRILINOS_DRIVER_ADD_DASHBOARD( + SERIAL_RELEASE_DEFAULT + ctest_linux_nightly_mpi_release_muelu_rocketman.cmake + CTEST_INSTALLER_TYPE release + RUN_SERIAL + TIMEOUT_MINUTES 330 + ) + +TRILINOS_ADD_REQUIRED_CMAKE_INSTALLS() diff --git a/cmake/ctest/drivers/rocketman/TrilinosCTestDriverCore.rocketman.gcc.cmake b/cmake/ctest/drivers/rocketman/TrilinosCTestDriverCore.rocketman.gcc.cmake new file mode 100644 index 000000000000..416fe7883774 --- /dev/null +++ b/cmake/ctest/drivers/rocketman/TrilinosCTestDriverCore.rocketman.gcc.cmake @@ -0,0 +1,129 @@ +# @HEADER +# ************************************************************************ +# +# Trilinos: An Object-Oriented Solver Framework +# Copyright (2001) Sandia Corporation +# +# +# Copyright (2001) Sandia Corporation. Under the terms of Contract +# DE-AC04-94AL85000, there is a non-exclusive license for use of this +# work by or on behalf of the U.S. Government. Export of this program +# may require a license from the United States Government. +# +# 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. +# +# NOTICE: The United States Government is granted for itself and others +# acting on its behalf a paid-up, nonexclusive, irrevocable worldwide +# license in this data to reproduce, prepare derivative works, and +# perform publicly and display publicly. Beginning five (5) years from +# July 25, 2001, the United States Government is granted for itself and +# others acting on its behalf a paid-up, nonexclusive, irrevocable +# worldwide license in this data to reproduce, prepare derivative works, +# distribute copies to the public, perform publicly and display +# publicly, and to permit others to do so. +# +# NEITHER THE UNITED STATES GOVERNMENT, NOR THE UNITED STATES DEPARTMENT +# OF ENERGY, NOR SANDIA CORPORATION, NOR ANY OF THEIR EMPLOYEES, MAKES +# ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL LIABILITY OR +# RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF ANY +# INFORMATION, APPARATUS, PRODUCT, OR PROCESS DISCLOSED, OR REPRESENTS +# THAT ITS USE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS. +# +# ************************************************************************ +# @HEADER + + +INCLUDE("${CTEST_SCRIPT_DIRECTORY}/../../TrilinosCTestDriverCore.cmake") + +# +# Platform/compiler specific options for rocketman using gcc +# + +MACRO(TRILINOS_SYSTEM_SPECIFIC_CTEST_DRIVER) + + # Base of Trilinos/cmake/ctest then BUILD_DIR_NAME + + IF(COMM_TYPE STREQUAL MPI) + string(TOUPPER $ENV{SEMS_MPI_NAME} UC_MPI_NAME) + SET(BUILD_DIR_NAME ${UC_MPI_NAME}-$ENV{SEMS_MPI_VERSION}_${BUILD_TYPE}_${BUILD_NAME_DETAILS}) + ELSE() + SET(BUILD_DIR_NAME ${COMM_TYPE}-${BUILD_TYPE}_${BUILD_NAME_DETAILS}) + ENDIF() + + + SET(CTEST_DASHBOARD_ROOT "${TRILINOS_CMAKE_DIR}/../../${BUILD_DIR_NAME}" ) + SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" ) + SET(CTEST_BUILD_FLAGS "-j35 -i" ) + + SET_DEFAULT(CTEST_PARALLEL_LEVEL "35" ) + SET_DEFAULT(Trilinos_ENABLE_SECONDARY_TESTED_CODE ON) + SET_DEFAULT(Trilinos_EXCLUDE_PACKAGES ${EXTRA_EXCLUDE_PACKAGES} TriKota Optika) + + SET(EXTRA_SYSTEM_CONFIGURE_OPTIONS + "-DBUILD_SHARED_LIBS=ON" + "-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" + "-DCMAKE_VERBOSE_MAKEFILE=ON" + + "-DTrilinos_ENABLE_COMPLEX:BOOL=OFF" + + "-DTrilinos_ENABLE_Fortran=OFF" + + "-DSuperLU_INCLUDE_DIRS=$ENV{SEMS_SUPERLU_INCLUDE_PATH}" + "-DSuperLU_LIBRARY_DIRS=$ENV{SEMS_SUPERLU_LIBRARY_PATH}" + "-DSuperLU_LIBRARY_NAMES=superlu" + + ### PACKAGE CONFIGURATION ### + + ### MISC ### + "-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON" + ) + + SET_DEFAULT(COMPILER_VERSION "$ENV{SEMS_COMPILER_NAME}-$ENV{SEMS_COMPILER_VERSION}") + + # Ensure that MPI is on for all parallel builds that might be run. + IF(COMM_TYPE STREQUAL MPI) + + SET(EXTRA_SYSTEM_CONFIGURE_OPTIONS + ${EXTRA_SYSTEM_CONFIGURE_OPTIONS} + "-DTPL_ENABLE_MPI=ON" + "-DMPI_BASE_DIR:PATH=$ENV{SEMS_OPENMPI_ROOT}" + "-DMPI_EXEC_POST_NUMPROCS_FLAGS:STRING=--bind-to\\\;socket\\\;--map-by\\\;socket" + ) + + SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS + "--gen-suppressions=all --error-limit=no --log-file=nightly_suppressions.txt" ${CTEST_MEMORYCHECK_COMMAND_OPTIONS} ) + + ELSE() + + SET( EXTRA_SYSTEM_CONFIGURE_OPTIONS + ${EXTRA_SYSTEM_CONFIGURE_OPTIONS} + "-DCMAKE_CXX_COMPILER=$ENV{SEMS_COMPILER_ROOT}/bin/g++" + "-DCMAKE_C_COMPILER=$ENV{SEMS_COMPILER_ROOT}/bin/gcc" + ) + + ENDIF() + + TRILINOS_CTEST_DRIVER() + +ENDMACRO() diff --git a/cmake/ctest/drivers/rocketman/cron_driver.sh b/cmake/ctest/drivers/rocketman/cron_driver.sh new file mode 100755 index 000000000000..ae8665abc2d7 --- /dev/null +++ b/cmake/ctest/drivers/rocketman/cron_driver.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +echo +echo "Starting nightly Trilinos development testing on rocketman: `date`" +echo + +# +# TrilinosDriver settings: +# + +export TDD_PARALLEL_LEVEL=2 + +# Trilinos settings: +# + +# Submission mode for the *TrilinosDriver* dashboard +export TDD_CTEST_TEST_TYPE=Nightly + +# enable this to avoid clobbering any local changes you're making +#export TDD_IN_TESTING_MODE=ON + +export TDD_DEBUG_VERBOSE=1 +export TDD_FORCE_CMAKE_INSTALL=0 +export TRIBITS_TDD_USE_SYSTEM_CTEST=1 + +#export CTEST_DO_SUBMIT=FALSE +#export CTEST_START_WITH_EMPTY_BINARY_DIRECTORY=FALSE + +# Machine specific environment +# +export TDD_HTTP_PROXY="http://sonproxy.sandia.gov:80" +export TDD_HTTPS_PROXY="https://sonproxy.sandia.gov:80" +export http_proxy="http://sonproxy.sandia.gov:80" +export https_proxy="https://sonproxy.sandia.gov:80" + +. ~/.bashrc + +# If you update the list of modules, go to ~/code/trilinos-test/trilinos/ and +# do "git pull". Otherwise, the tests could fail on the first night, as we +# would first run old cron_driver.sh and only then pull + +# =========================================================================== +export CTEST_CONFIGURATION="default" +module load sems-cmake/3.5.2 +module load sems-gcc/5.3.0 +module load sems-openmpi/1.10.1 +module load sems-superlu/4.3/base + +# Remove colors (-fdiagnostics-color) from OMPI flags +# It may result in non-XML characters on the Dashboard +export OMPI_CFLAGS=`echo $OMPI_CFLAGS | sed 's/-fdiagnostics-color//'` +export OMPI_CXXFLAGS=`echo $OMPI_CXXFLAGS | sed 's/-fdiagnostics-color//'` + +echo "Configuration = $CTEST_CONFIGURATION" +env + +export OMP_NUM_THREADS=2 + +# Machine independent cron_driver: +SCRIPT_DIR=`cd "\`dirname \"$0\"\`";pwd` +$SCRIPT_DIR/../cron_driver.py + +module unload sems-superlu/4.3/base +module unload sems-openmpi/1.10.1 +module unload sems-gcc/5.3.0 +module unload sems-cmake/3.5.2 +# =========================================================================== + +echo +echo "Ending nightly Trilinos development testing on rocketman: `date`" +echo diff --git a/cmake/ctest/drivers/rocketman/crontab b/cmake/ctest/drivers/rocketman/crontab new file mode 100644 index 000000000000..803626cd7f33 --- /dev/null +++ b/cmake/ctest/drivers/rocketman/crontab @@ -0,0 +1,32 @@ +SHELL=/bin/bash +# * * * * * command to execute +# │ │ │ │ │ +# │ │ │ │ │ +# │ │ │ │ └───── day of week (0 - 6) (0 to 6 are Sunday to Saturday, or use names; 7 is Sunday, the same as 0) +# │ │ │ └────────── month (1 - 12) +# │ │ └─────────────── day of month (1 - 31) +# │ └──────────────────── hour (0 - 23) +# └───────────────────────── min (0 - 59) + +# MIN HOUR DAY MONTH + +# nightly tests + +00 22 * * * cd /home/nightlyTesting/Trilinos/cmake/ctest/drivers/rocketman; eval `python ./setSshEnv.python`; cd /home/nightlyTesting/Trilinos; git pull > /dev/null 2>&1; cd /home/nightlyTesting/Trilinos/cmake/ctest/drivers/rocketman && ./cron_driver.sh &> /space/nightlyTesting/cron_driver.log; cd /space/nightlyTesting; /space/nightlyTesting/Trilinos/cmake/ctest/drivers/rocketman/sendTestSummary.sh cron_driver.log + + +# +@reboot /home/jhu/bin/send-reboot-email.sh + + +#description of fields +#minute This controls what minute of the hour the command will run on, +# and is between '0' and '59' +#hour This controls what hour the command will run on, and is specified in +# the 24 hour clock, values must be between 0 and 23 (0 is midnight) +#dom This is the Day of Month, that you want the command run on, e.g. to +# run a command on the 19th of each month, the dom would be 19. +#month This is the month a specified command will run on, it may be specified +# numerically (0-12), or as the name of the month (e.g. May) +#dow This is the Day of Week that you want a command to be run on, it can +# also be numeric (0-7) or as the name of the day (e.g. sun). diff --git a/cmake/ctest/drivers/rocketman/ctest_linux_nightly_mpi_release_muelu_rocketman.cmake b/cmake/ctest/drivers/rocketman/ctest_linux_nightly_mpi_release_muelu_rocketman.cmake new file mode 100644 index 000000000000..bc2dc216b960 --- /dev/null +++ b/cmake/ctest/drivers/rocketman/ctest_linux_nightly_mpi_release_muelu_rocketman.cmake @@ -0,0 +1,87 @@ +# @HEADER +# ************************************************************************ +# +# Trilinos: An Object-Oriented Solver Framework +# Copyright (2001) Sandia Corporation +# +# +# Copyright (2001) Sandia Corporation. Under the terms of Contract +# DE-AC04-94AL85000, there is a non-exclusive license for use of this +# work by or on behalf of the U.S. Government. Export of this program +# may require a license from the United States Government. +# +# 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. +# +# NOTICE: The United States Government is granted for itself and others +# acting on its behalf a paid-up, nonexclusive, irrevocable worldwide +# license in this data to reproduce, prepare derivative works, and +# perform publicly and display publicly. Beginning five (5) years from +# July 25, 2001, the United States Government is granted for itself and +# others acting on its behalf a paid-up, nonexclusive, irrevocable +# worldwide license in this data to reproduce, prepare derivative works, +# distribute copies to the public, perform publicly and display +# publicly, and to permit others to do so. +# +# NEITHER THE UNITED STATES GOVERNMENT, NOR THE UNITED STATES DEPARTMENT +# OF ENERGY, NOR SANDIA CORPORATION, NOR ANY OF THEIR EMPLOYEES, MAKES +# ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL LIABILITY OR +# RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF ANY +# INFORMATION, APPARATUS, PRODUCT, OR PROCESS DISCLOSED, OR REPRESENTS +# THAT ITS USE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS. +# +# ************************************************************************ +# @HEADER + + +INCLUDE("${CTEST_SCRIPT_DIRECTORY}/TrilinosCTestDriverCore.rocketman.gcc.cmake") + +# +# Set the options specific to this build case +# + +# The variable BUILD_DIR_NAME is based COMM_TYPE, BUILD_TYPE, and BUILD_NAME_DETAILS. +# Tribits creates the variable listed under "Build Name" by prepending the OS type and compiler +# details to BUILD_DIR_NAME. +SET(COMM_TYPE MPI) +SET(BUILD_TYPE RELEASE) +SET(BUILD_NAME_DETAILS DEFAULT) + +SET(CTEST_PARALLEL_LEVEL 8) +SET(CTEST_TEST_TYPE Nightly) +SET(CTEST_TEST_TIMEOUT 14400) # twice the default value, for valgrind +SET(CTEST_DO_MEMORY_TESTING FALSE) + +SET(Trilinos_PACKAGES MueLu Xpetra Amesos2) + +SET(EXTRA_CONFIGURE_OPTIONS + "-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION=ON" + "-DTrilinos_ENABLE_DEPENDENCY_UNIT_TESTS=OFF" + "-DTPL_ENABLE_SuperLU=ON" +) + +# +# Set the rest of the system-specific options and run the dashboard build/test +# + +TRILINOS_SYSTEM_SPECIFIC_CTEST_DRIVER() diff --git a/cmake/ctest/drivers/rocketman/sendTestSummary.sh b/cmake/ctest/drivers/rocketman/sendTestSummary.sh new file mode 100755 index 000000000000..fafdd6839492 --- /dev/null +++ b/cmake/ctest/drivers/rocketman/sendTestSummary.sh @@ -0,0 +1,326 @@ +#!/bin/sh + +# Parse command line options. +DEBUGMODE=0 +USAGE="sendTestSummary.sh [-d] " +while getopts d OPT; do + case "$OPT" in + d) + # debug mode, send email summary to me only + DEBUGMODE=1 + ;; + \?) + # getopts issues an error message + echo ${USAGE} + echo + exit 1 + ;; + esac +done + +# Remove the options we parsed above. +shift `expr $OPTIND - 1` +# The logfile is required. Error out if it's not provided. +if [ $# -eq 0 ]; then + echo $USAGE >&2 + exit 1 +fi +### end parsing ### + +######################################################################### +# Variables you might want to modify. +######################################################################### + +#Perl script to produce prettified HTML +HTMLPERLSCRIPT="/space/nightlyTesting/Trilinos/packages/muelu/utils/misc/drakify-email.pl" +#root of cdash testing directory +TESTLOCATION="/home/nightlyTesting" +LOGBACKUPDIRECTORY="/home/nightlyTesting/logs" + +#packages to be summarized +PATTERN="(Xpetra|MueLu)" + +#variables to be passed to the perl script +MACHINENAME=`hostname -s` +USER=`whoami` + +#who gets the email summary +if [[ $DEBUGMODE == 1 ]]; then + RECIPIENTS=( + "${USER}@sandia.gov" + ) +else + RECIPIENTS=( + "muelu-regression@software.sandia.gov" + ) +fi +#suffix for all the log files +timeStamp="$(date +%F_%R)" + +#cron driver log file +INFILE=$1 +#root of file to be emailed. The correct suffix must be appended whenever you use this. +OUTFILE="test-summary-${timeStamp}" +MAILCOMMAND="/usr/sbin/sendmail" +######################################################################### + +cd ${TESTLOCATION} + +backupFile="cron_driver.log.$timeStamp" +cp cron_driver.log $backupFile + +testStartString=`egrep "Starting nightly Trilinos development" cron_driver.log` +testStartDate=`echo $testStartString | sed "s/:/#/" | cut -f 2 -d#` +ttt=`echo $testStartString | cut -f 1 -d:` +testMachine=${ttt##* } +testEndString=`egrep "Ending nightly Trilinos development" cron_driver.log` +testEndDate=`echo $testEndString | sed "s/:/#/" | cut -f 2 -d#` + +awk -v packagesToMatch="$PATTERN" -v summaryFile="${OUTFILE}.txt" -v machine="$testMachine" -v startTime="$testStartDate" -v endTime="$testEndDate" ' + +################################################### +# Commands to run before the file is processed +################################################### +BEGIN { + print "Machine : " machine > summaryFile + print "Start time : " startTime > summaryFile + print "End time : " endTime > summaryFile + testctr=0 + gitUpdateFailed=0 + dashboardErrors=0 +} + +################################################### +# Commands to run while processing the file +################################################### +{ + + if ($0 ~ "Update command failed") + { + gitUpdateFailed=1 + } + + if ($0 ~ "^test [0-9]*$") + { + #start of test found, e.g., test 4 + FOUND=2 + testNum=$0 + sub(/test /,"",testNum) + testNum=testNum":" + #\x27 is hex code for single quote + packageLibBuild=testNum" Building target: \x27" packagesToMatch "_libs" + packageTestBuild=testNum" Build ALL target for \x27" packagesToMatch "\x27" + runTestPattern=testNum" Running test for package \x27" packagesToMatch "\x27" + next #skip any more processing, go on to next line + } + + if (FOUND==2) + { + FOUND-- + dashboardName=$0 + sub(/Start [ ]*[0-9]*: /,"",dashboardName) + dashboardName=RemoveWhiteSpace(dashboardName) + listOfDashboardNames[testctr] = dashboardName + testctr++ + dashBoardPattern="Test [ ]*#[0-9]*: " dashboardName + } + +# Record the "track" for this dashboard, which could be "Nightly", "Experimental", or "Specialized" + if (FOUND && $0 ~ "-- Trilinos_TRACK=") + { + thisLine=$0 + sub(/^[0-9]*: -- Trilinos_TRACK=\x27/,"",thisLine) + sub(/\x27/,"",thisLine) + if (length(thisLine) > 0) { + dashboardTrack[dashboardName] = thisLine + trackTypes[thisLine]++ + } + } + + if (FOUND && $0 ~ dashBoardPattern) + { + thisLine=$0 + thisLine=RemoveWhiteSpace(thisLine) + if (dashboardErrors == 0) + dashBoardSummary[dashboardName] = "passed" + else + dashBoardSummary[dashboardName] = "FAILED" + match(thisLine,"[0-9]*\\.[0-9]* sec$") + timeSummary[dashboardName] = substr(thisLine,RSTART,RLENGTH) + #done with this dashboard, reset error flag + dashboardErrors=0 + } + + # library build + if (FOUND && $0 ~ packageLibBuild) + { + getCompilerSummary=2 + thisLine = $0 + pat = "\x27" packagesToMatch "_libs\x27" + match(thisLine,pat) + currentPackage = substr(thisLine,RSTART+1,RLENGTH-2) + listOfPackages[currentPackage] = currentPackage + } + + # tests build + if (FOUND && $0 ~ packageTestBuild) + { + getCompilerSummary=2 + thisLine = $0 + pat = "\x27" packagesToMatch "\x27" + match(thisLine,pat) + currentPackage = substr(thisLine,RSTART+1,RLENGTH-2) + listOfPackages[currentPackage] = currentPackage + } + + if (getCompilerSummary>0 && $0 ~ " Compiler errors") + { + thisLine=$0 + sub(testNum,"",thisLine) + pat="[0-9]*" + thisLine=RemoveWhiteSpace(thisLine) + + match(thisLine,pat) + numErrors = substr(thisLine,RSTART,RLENGTH) + errorSummary[dashboardName,currentPackage] = numErrors + + getCompilerSummary-- + } + + if (getCompilerSummary>0 && $0 ~ " Compiler warnings") + { + thisLine=$0 + sub(testNum,"",thisLine) + thisLine=RemoveWhiteSpace(thisLine) + pat="[0-9]*" + match(thisLine,pat) + numWarnings = substr(thisLine,RSTART,RLENGTH); + warningSummary[dashboardName,currentPackage] = numWarnings + getCompilerSummary-- + } + + #Look for pattern indicating that the tests of interest have in fact run. + if (FOUND && match($0,runTestPattern)) + { + packageTested = substr($0,RSTART,RLENGTH); + sub(testNum,"",packageTested) + packageTested=RemoveWhiteSpace(packageTested) + getTestSummary=1 + } + + if (getTestSummary && $0 ~ "No tests were found!!!") + { + getTestSummary=0 + } + + #Calculate the number of failing, passing, and total tests. + if (getTestSummary && $0 ~ "tests failed out of") + { + thisLine=$0 + sub(testNum,"",thisLine) + thisLine=RemoveWhiteSpace(thisLine) + getTestSummary=0 + pat = "[0-9]* tests failed out of [0-9]*" + match(thisLine,pat) + ttt = substr(thisLine,RSTART,RLENGTH); + pat = "^[0-9]*" + match(ttt,pat) + numFailed = substr(ttt,RSTART,RLENGTH); + pat = "[0-9]*$" + match(ttt,pat) + numTotal = substr(ttt,RSTART,RLENGTH); + failSummary[dashboardName,currentPackage] = numFailed + passSummary[dashboardName,currentPackage] = numTotal+0-numFailed + totalSummary[dashboardName,currentPackage] = numTotal + if (numFailed != 0) + dashboardErrors=1 + } +} + +################################################### +# helper functions +################################################### +function RemoveWhiteSpace(theString) +{ + sub(/^[ ]*/,"",theString); sub(/[ ]*$/,"",theString); + return (theString) +} + +################################################### +# Commands to run after the file is processed +################################################### +END { + + if (gitUpdateFailed == 1) { + print "\n *** git update FAILED ***\n" > summaryFile + } + + # do some nice formatting + numPlusses=73 + thePluses=" " + while (jj++ summaryFile + for (track in trackTypes) { + printf("%s\n",thePluses) > summaryFile + trackNameLength = length(track) + numPlussesToTheRight = numPlusses - trackNameLength - 4 + plussesToTheRight="" + kk = 0 + while (kk++ summaryFile + printf("%s\n",thePluses) > summaryFile + for (i in listOfDashboardNames) { + db=listOfDashboardNames[i] + if (dashboardTrack[db] == track) + printf(" %61-s ... %s\n",db,dashBoardSummary[db]) > summaryFile; + } + } + printf("-----------------------------------------------------------------------------\n\n") > summaryFile + + for (i in listOfDashboardNames) { + db=listOfDashboardNames[i] + spaces=" " + printf("%55-s\n%s%8-s, %5.1f seconds\n",db, spaces, dashBoardSummary[db], timeSummary[db]) > summaryFile; + for (k in listOfPackages) { + pat = "_lib" + if (match(k,pat)) isLib = 1; + else isLib = 0; + if ((db,k) in warningSummary) nwarn = warningSummary[db,k] + else nwarn = "-"; + if ((db,k) in errorSummary) nerr = errorSummary[db,k] + else nerr = "-"; + if ((db,k) in failSummary) nfail = failSummary[db,k] + else nfail = "-"; + if ((db,k) in passSummary) npass = passSummary[db,k] + else npass = "-"; + if ((db,k) in totalSummary) ntotal = totalSummary[db,k] + else ntotal = "-"; + if (isLib) { + summaryString = sprintf("%15s | %3d warnings | %3d errors",k,nwarn,nerr); + } + else { + summaryString = sprintf("%15s | %3d warnings | %3d errors | %d/%d passed",k,nwarn,nerr,npass,ntotal); + } + print spaces summaryString > summaryFile + } + } + +} +' $INFILE + +date2=`echo $(date) | sed "s/ /_/g"` +cdashDate="$(date +%F)" +cat ${OUTFILE}.txt | perl ${HTMLPERLSCRIPT} ${date2} ${cdashDate} ${MACHINENAME} ${USER} > ${OUTFILE}.html + +${MAILCOMMAND} -it <