Skip to content

Commit

Permalink
Merge pull request ESMCI#1357 from NCAR/ejh_fix_codacy_3
Browse files Browse the repository at this point in the history
trying cmake build in travis
  • Loading branch information
edhartnett authored Mar 19, 2019
2 parents fdd9b6e + ef653a6 commit 544f6c7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
23 changes: 21 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ language: c
dist: trusty
sudo: false

branches:
only:
- master

addons:
apt:
sources:
Expand All @@ -17,11 +21,20 @@ before_install:

before_script:
- export CC=mpicc
- export FC=mpif90
- export CPPFLAGS='-I/usr/include'

- wget https://parallel-netcdf.github.io/Release/pnetcdf-1.11.0.tar.gz
- tar -xzvf pnetcdf-1.11.0.tar.gz
- ls -l
- pushd pnetcdf-1.11.0
- ./configure --prefix=/usr --enable-shared
- make
- sudo make install
- popd
env:
global:
- CC=mpicc
- FC=mpif90
- CPPFLAGS='-I/usr/include'
- CFLAGS='-std=c99'
- LDFLAGS='-L/usr/lib'
Expand All @@ -30,4 +43,10 @@ script:
- autoreconf -i
- ./configure
- make -j distcheck

- rm -rf build
- mkdir build
- cd build
- cmake -DPIO_HDF5_LOGGING=On -DPIO_USE_MALLOC=On -DPIO_ENABLE_LOGGING=On -DPIO_ENABLE_TIMING=Off ..
- make VERBOSE=1
- make tests VERBOSE=1
- make test VERBOSE=1
14 changes: 6 additions & 8 deletions tests/cunit/test_pioc.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,11 +539,10 @@ int test_iotypes(int my_rank)
*/
int check_strerror_netcdf(int my_rank)
{
#define NUM_NETCDF_TRIES 4
int errcode[NUM_NETCDF_TRIES] = {PIO_EBADID, NC4_LAST_ERROR - 1, 0, 1};
#define NUM_NETCDF_TRIES 3
int errcode[NUM_NETCDF_TRIES] = {PIO_EBADID, 0, 1};
const char *expected[NUM_NETCDF_TRIES] = {"NetCDF: Not a valid ID",
"Unknown Error: Unrecognized error code", "No error",
nc_strerror(1)};
"No error", nc_strerror(1)};
int ret;

if ((ret = check_error_strings(my_rank, NUM_NETCDF_TRIES, errcode, expected)))
Expand Down Expand Up @@ -627,14 +626,13 @@ int check_strerror_pnetcdf(int my_rank)
*/
int check_strerror_pio(int my_rank)
{
#define NUM_PIO_TRIES 6
#define NUM_PIO_TRIES 5
int errcode[NUM_PIO_TRIES] = {PIO_EBADID,
NC_ENOTNC3, NC4_LAST_ERROR - 1, 0, 1,
NC_ENOTNC3, 0, 1,
PIO_EBADIOTYPE};
const char *expected[NUM_PIO_TRIES] = {"NetCDF: Not a valid ID",
"NetCDF: Attempting netcdf-3 operation on netcdf-4 file",
"Unknown Error: Unrecognized error code", "No error",
nc_strerror(1), "Bad IO type"};
"No error", nc_strerror(1), "Bad IO type"};
int ret;

if ((ret = check_error_strings(my_rank, NUM_PIO_TRIES, errcode, expected)))
Expand Down

0 comments on commit 544f6c7

Please sign in to comment.