From e8e143761d1c793afed58e2327e8996d8d78d161 Mon Sep 17 00:00:00 2001 From: Timothy Brown Date: Fri, 9 Jun 2017 08:43:39 -0600 Subject: [PATCH 1/8] Updating the README.md Updating the README.md to point to the public Travis CI site. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1f702a1e..c1935d69 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [GMTB](http://www.dtcenter.org/GMTB/html/) Common Community Physics Package (CCPP), including the Interoperable Physics Driver (IPD). -[![Build Status](https://travis-ci.com/NCAR/gmtb-ccpp.svg?branch=master)](https://travis-ci.com/NCAR/gmtb-ccpp) +[![Build Status](https://travis-ci.org/NCAR/gmtb-ccpp.svg?branch=master)](https://travis-ci.org/NCAR/gmtb-ccpp) ## Notes to Users This repository contains the Common Community Physics Packages (CCPP) and the driver @@ -36,9 +36,9 @@ provided once examples of fully functioning schemes are part of the CCPP. * Fortran: must be 2008 compliant. There are a number of Fortran 2003 pieces, and a single convenience right now with Fortran 2008. 2. Intel 16.0.2 and beyond work OK - 3. PGI compilers do not easily support C functions calling Fortran routines. + 3. PGI compilers do **not** easily support C functions calling Fortran routines. The PGI compilers attach the Fortran module name as a prefix to the Fortran - symbol. This breaks the method that the CCPP uses to identify which schemes + symbol. This **breaks** the method that the CCPP uses to identify which schemes to call. 2. [Cmake](https://cmake.org) From 37ae37504b31e6ee9fe47008a613191a5582e448 Mon Sep 17 00:00:00 2001 From: Timothy Brown Date: Fri, 9 Jun 2017 09:42:43 -0600 Subject: [PATCH 2/8] Updating the Travis YAML file. Homebrew now has GCC version 7, however version 6 is still good enough for CCPP. Adding the ability to specify and use version numbers. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index e67bc413..3b7c0f10 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,6 +46,7 @@ before_install: - | if [[ "$TRAVIS_OS_NAME" == "osx" ]] ; then brew update + brew tap homebrew/versions brew install gcc6 fi - | From e1e427b9cbddf43d1e8797423ceaa17714b860df Mon Sep 17 00:00:00 2001 From: Timothy Brown Date: Fri, 9 Jun 2017 10:26:59 -0600 Subject: [PATCH 3/8] OS X CI still failing. Adding some debug statements to the OS X Travis YAML. --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3b7c0f10..a37cecbe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,8 +46,10 @@ before_install: - | if [[ "$TRAVIS_OS_NAME" == "osx" ]] ; then brew update - brew tap homebrew/versions - brew install gcc6 + brew search gcc + brew install gcc@6 + brew search gcc + which gcc-6 fi - | if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then From 63889496ddad81b63d062ba8f24c6262ae82177e Mon Sep 17 00:00:00 2001 From: Timothy Brown Date: Fri, 9 Jun 2017 11:18:05 -0600 Subject: [PATCH 4/8] Changing OS X testing. OS X has new silly security settings. It seems DYLD_* env vars do not make it through `make test` to `ctest`. https://forums.developer.apple.com/thread/9233 --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index a37cecbe..df21728d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,10 +46,7 @@ before_install: - | if [[ "$TRAVIS_OS_NAME" == "osx" ]] ; then brew update - brew search gcc brew install gcc@6 - brew search gcc - which gcc-6 fi - | if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then @@ -64,10 +61,13 @@ script: - | if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then export LD_LIBRARY_PATH=${PWD}/schemes/check/src/check-build - elif [[ "$TRAVIS_OS_NAME" == "osx" ]] ; then + make test + fi + - | + if [[ "$TRAVIS_OS_NAME" == "osx" ]] ; then export DYLD_LIBRARY_PATH=${PWD}/schemes/check/src/check-build + ctest fi - make test # - | # if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then # make clean From b8abbbf63d9bd3649c8b4fdd1560fce916e7e55e Mon Sep 17 00:00:00 2001 From: Timothy Brown Date: Fri, 9 Jun 2017 13:23:35 -0600 Subject: [PATCH 5/8] Updating the README.md Added a bit more information to the README.md and reformatted the requirements section. --- README.md | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index c1935d69..9fb22d8a 100644 --- a/README.md +++ b/README.md @@ -30,17 +30,26 @@ provided once examples of fully functioning schemes are part of the CCPP. ## Requirements -1. Compilers - 1. [GNU Compiler Collection](https://gcc.gnu.org/) - * C - * Fortran: must be 2008 compliant. There are a number of Fortran - 2003 pieces, and a single convenience right now with Fortran 2008. - 2. Intel 16.0.2 and beyond work OK - 3. PGI compilers do **not** easily support C functions calling Fortran routines. - The PGI compilers attach the Fortran module name as a prefix to the Fortran - symbol. This **breaks** the method that the CCPP uses to identify which schemes - to call. -2. [Cmake](https://cmake.org) +### Compilers +The CCPP uses both the C and Fortran compilers. Note, the +Fortran compiler must be 2008 compliant. There are a number of Fortran +2003 pieces, and a single convenience right now with Fortran 2008. + +1. [GNU Compiler Collection](https://gcc.gnu.org/) +2. [Intel 16.0.2](https://software.intel.com/en-us/intel-compilers) and beyond work. +3. [PGI](http://www.pgroup.com/) compilers do **not** easily support C functions + calling Fortran routines. The PGI compilers attach the Fortran module name as a + prefix to the Fortran symbol. This **breaks** the method that the CCPP uses to + identify which schemes to call. + +### [Cmake](https://cmake.org) + +The CCPP build system uses cmake. + +### [LibXML2](http://xmlsoft.org/) + +The suite definition is currently written in XML, LibXML2 is currently used to +parse these files. ## Building It is recommend to do an out of source build. This is "cmake" terminology From ee44e17a026952e9619b07f001f0e89cf3a489e3 Mon Sep 17 00:00:00 2001 From: Timothy Brown Date: Thu, 22 Jun 2017 12:13:51 -0600 Subject: [PATCH 6/8] Adding coverage information/badges. Testing out codecov.io. --- .codecov.yml | 6 ++++++ .travis.yml | 23 ++++++++++++++--------- CMakeLists.txt | 3 --- README.md | 5 ++++- src/tests/CMakeLists.txt | 7 +++++++ 5 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000..06b23ffa --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,6 @@ +#====================================================================== +# +coverage: + range: 60...90 + round: down + precision: 2 diff --git a/.travis.yml b/.travis.yml index df21728d..d27c4aed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -68,15 +68,20 @@ script: export DYLD_LIBRARY_PATH=${PWD}/schemes/check/src/check-build ctest fi -# - | -# if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then -# make clean -# cmake -DCMAKE_BUILD_TYPE=Coverage .. && make coverage -# bash <(curl -s https://codecov.io/bash) -# fi -# -#after_success: -# - coveralls --exclude lib --exclude tests --gcov-options '\-lp' + - | + if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then + make clean + cmake -DCMAKE_BUILD_TYPE=Coverage .. && make coverage + fi + +after_success: + - | + if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then + lcov --directory . --capture --rc lcov_branch_coverage=1 \ + --output-file coverage.info + lcov --rc lcov_branch_coverage=1 --list coverage.info + bash <(curl -s https://codecov.io/bash) + fi #====================================================================== # Notifications diff --git a/CMakeLists.txt b/CMakeLists.txt index ba07c53f..6b9d2026 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,9 +60,6 @@ option(BUILD_SHARED_LIBS "Build a shared library" ON) # Enable code coverage if(CMAKE_COMPILER_IS_GNUCC AND (CMAKE_BUILD_TYPE STREQUAL "Coverage")) include(code_coverage) - setup_target_for_coverage(coverage - "src/atm_drv ${CMAKE_SOURCE_DIR}/tests/suite_DUMMY.xml" - coverage) list(APPEND LIBS "gcov") endif() diff --git a/README.md b/README.md index 9fb22d8a..381e68eb 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,10 @@ [GMTB](http://www.dtcenter.org/GMTB/html/) Common Community Physics Package (CCPP), including the Interoperable Physics Driver (IPD). -[![Build Status](https://travis-ci.org/NCAR/gmtb-ccpp.svg?branch=master)](https://travis-ci.org/NCAR/gmtb-ccpp) +| Branch | Linux/MacOS Build | Coverage | +| Master | [![Build Status](https://travis-ci.org/NCAR/gmtb-ccpp.svg?branch=master)](https://travis-ci.org/NCAR/gmtb-ccpp) | (https://codecov.io/github/NCAR/gmtb-ccpp/coverage.svg?branch=master)](https://codecov.io/github/NCAR/gmtb-ccpp?branch=master) +| Develop | [![Build Status](https://travis-ci.org/NCAR/gmtb-ccpp.svg?branch=develop)](https://travis-ci.org/NCAR/gmtb-ccpp) | (https://codecov.io/github/NCAR/gmtb-ccpp/coverage.svg?branch=develop)](https://codecov.io/github/NCAR/gmtb-ccpp?branch=develop) + ## Notes to Users This repository contains the Common Community Physics Packages (CCPP) and the driver diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 41c938d4..77c09e4f 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -28,3 +28,10 @@ add_test(FIELDS test_fields) # Make sure we can do the cap call add_test(CHECK test_check ${CMAKE_CURRENT_SOURCE_DIR}/suite_check.xml) +#------------------------------------------------------------------------------ +# Coverage tests +if(CMAKE_COMPILER_IS_GNUCC AND (CMAKE_BUILD_TYPE STREQUAL "Coverage")) + setup_target_for_coverage(coverage + "test_check ${CMAKE_CURRENT_SOURCE_DIR}/suite_check.xml" + coverage) +endif() From f7dd0adf6b5dc85be55a65baa0c58a758a4382d2 Mon Sep 17 00:00:00 2001 From: Timothy Brown Date: Thu, 22 Jun 2017 12:31:28 -0600 Subject: [PATCH 7/8] Coverage fixes. Fixing the build and coverage table in the README. Fixing the variable for Fortran coverage flags. --- .travis.yml | 4 +--- README.md | 5 +++-- cmake/code_coverage.cmake | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index d27c4aed..6b4e7415 100644 --- a/.travis.yml +++ b/.travis.yml @@ -71,15 +71,13 @@ script: - | if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then make clean + alias gcov="/usr/bin/gcov-6" cmake -DCMAKE_BUILD_TYPE=Coverage .. && make coverage fi after_success: - | if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then - lcov --directory . --capture --rc lcov_branch_coverage=1 \ - --output-file coverage.info - lcov --rc lcov_branch_coverage=1 --list coverage.info bash <(curl -s https://codecov.io/bash) fi diff --git a/README.md b/README.md index 381e68eb..486750b9 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,9 @@ (CCPP), including the Interoperable Physics Driver (IPD). | Branch | Linux/MacOS Build | Coverage | -| Master | [![Build Status](https://travis-ci.org/NCAR/gmtb-ccpp.svg?branch=master)](https://travis-ci.org/NCAR/gmtb-ccpp) | (https://codecov.io/github/NCAR/gmtb-ccpp/coverage.svg?branch=master)](https://codecov.io/github/NCAR/gmtb-ccpp?branch=master) -| Develop | [![Build Status](https://travis-ci.org/NCAR/gmtb-ccpp.svg?branch=develop)](https://travis-ci.org/NCAR/gmtb-ccpp) | (https://codecov.io/github/NCAR/gmtb-ccpp/coverage.svg?branch=develop)](https://codecov.io/github/NCAR/gmtb-ccpp?branch=develop) +|--- |--- |--- | +| Master | [![Build Status](https://travis-ci.org/NCAR/gmtb-ccpp.svg?branch=master)](https://travis-ci.org/NCAR/gmtb-ccpp) | (https://codecov.io/github/NCAR/gmtb-ccpp/coverage.svg?branch=master)](https://codecov.io/github/NCAR/gmtb-ccpp?branch=master) | +| Develop | [![Build Status](https://travis-ci.org/NCAR/gmtb-ccpp.svg?branch=develop)](https://travis-ci.org/NCAR/gmtb-ccpp) | (https://codecov.io/github/NCAR/gmtb-ccpp/coverage.svg?branch=develop)](https://codecov.io/github/NCAR/gmtb-ccpp?branch=develop) | ## Notes to Users diff --git a/cmake/code_coverage.cmake b/cmake/code_coverage.cmake index 89553f03..7bb7dfbe 100644 --- a/cmake/code_coverage.cmake +++ b/cmake/code_coverage.cmake @@ -104,7 +104,7 @@ SET(CMAKE_CXX_FLAGS_COVERAGE "-g -O0 --coverage -fprofile-arcs -ftest-coverage" CACHE STRING "Flags used by the C++ compiler during coverage builds." FORCE ) -SET(CMAKE_FC_FLAGS_COVERAGE +SET(CMAKE_Fortran_FLAGS_COVERAGE "-g -O0 --coverage -fprofile-arcs -ftest-coverage" CACHE STRING "Flags used by the Fortran compiler during coverage builds." FORCE ) From aa70cb0691a6419b6584a5b2224dedbf09e011d5 Mon Sep 17 00:00:00 2001 From: Timothy Brown Date: Thu, 22 Jun 2017 12:56:40 -0600 Subject: [PATCH 8/8] Fixing README. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 486750b9..3e4f610d 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ | Branch | Linux/MacOS Build | Coverage | |--- |--- |--- | -| Master | [![Build Status](https://travis-ci.org/NCAR/gmtb-ccpp.svg?branch=master)](https://travis-ci.org/NCAR/gmtb-ccpp) | (https://codecov.io/github/NCAR/gmtb-ccpp/coverage.svg?branch=master)](https://codecov.io/github/NCAR/gmtb-ccpp?branch=master) | -| Develop | [![Build Status](https://travis-ci.org/NCAR/gmtb-ccpp.svg?branch=develop)](https://travis-ci.org/NCAR/gmtb-ccpp) | (https://codecov.io/github/NCAR/gmtb-ccpp/coverage.svg?branch=develop)](https://codecov.io/github/NCAR/gmtb-ccpp?branch=develop) | +| Master | [![Build Status](https://travis-ci.org/NCAR/gmtb-ccpp.svg?branch=master)](https://travis-ci.org/NCAR/gmtb-ccpp) | [![Coverage Status](https://codecov.io/github/NCAR/gmtb-ccpp/coverage.svg?branch=master)](https://codecov.io/github/NCAR/gmtb-ccpp) | +| Develop | [![Build Status](https://travis-ci.org/NCAR/gmtb-ccpp.svg?branch=develop)](https://travis-ci.org/NCAR/gmtb-ccpp) | [![Coverage Status](https://codecov.io/github/NCAR/gmtb-ccpp/coverage.svg?branch=develop)](https://codecov.io/github/NCAR/gmtb-ccpp?branch=develop) | ## Notes to Users