From e448ff266ddc1fd68113b82940b51b92326d051d Mon Sep 17 00:00:00 2001 From: "Glenn K. Lockwood" Date: Fri, 21 Sep 2018 18:35:48 -0400 Subject: [PATCH] fix various issues related to release packages - travis now tests the packaged source to detect missing source/headers - basic tests are less sensitive to the directory from where they are run - fixed some missing files from the `make dist` manifest - updated the format of NEWS to work with `make dist` --- .gitignore | 1 + .travis.yml | 9 +------- Makefile.am | 10 ++++++++- NEWS | 7 +----- src/Makefile.am | 2 +- testing/basic-tests.sh | 2 +- testing/test-lib.sh | 21 ++++++++++-------- travis-build.sh | 26 +++++++++++++++++++++++ travis-test.sh | 48 ++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 100 insertions(+), 26 deletions(-) create mode 100755 travis-build.sh create mode 100755 travis-test.sh diff --git a/.gitignore b/.gitignore index 73dd929..d065f5b 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ config/config.sub config/depcomp config/install-sh config/missing +config/test-driver configure contrib/.deps/ contrib/Makefile diff --git a/.travis.yml b/.travis.yml index 49ae8f7..29e091c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,11 +28,4 @@ install: # aiori-S3.c to achive this. # GPFS # NOTE: Think GPFS need a license and is therefore not testable with travis. -before_script: ./bootstrap -script: mkdir build && cd build && ../configure --with-hdf5 && make && cd .. && ./testing/basic-tests.sh - - -# notifications: -# email: -# on_success: change # default: change -# on_failure: always # default: always +script: ./travis-build.sh && CONFIGURE_OPTS="--with-hdf5" ./travis-test.sh diff --git a/Makefile.am b/Makefile.am index f01f362..d874a90 100755 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,13 @@ MAKEFLAGS = --no-print-directory SUBDIRS = src doc contrib -EXTRA_DIST = META COPYRIGHT README.md ChangeLog +EXTRA_DIST = META COPYRIGHT README.md NEWS testing + # ACLOCAL_AMFLAGS needed for autoconf < 2.69 ACLOCAL_AMFLAGS = -I config + +# The basic-tests.sh scripts run MPI versions of IOR/mdtest and are therefore +# too complicated to run in the context of distclean. As such we reserve +# `make dist` and `make test` for simple test binaries that do not require any +# special environment. +#TESTS = testing/basic-tests.sh +#DISTCLEANFILES = -r test test_out diff --git a/NEWS b/NEWS index dedb82a..4ff935d 100644 --- a/NEWS +++ b/NEWS @@ -1,9 +1,4 @@ -IOR NEWS -================================================================================ - -Last updated 2018-08 - -Version 3.2 +Version 3.2.0 -------------------------------------------------------------------------------- New major features: diff --git a/src/Makefile.am b/src/Makefile.am index 0e0b916..51fb873 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ if USE_CAPS bin_PROGRAMS += IOR MDTEST endif -noinst_HEADERS = ior.h utilities.h parse_options.h aiori.h iordef.h ior-internal.h option.h +noinst_HEADERS = ior.h utilities.h parse_options.h aiori.h iordef.h ior-internal.h option.h mdtest.h lib_LIBRARIES = libaiori.a libaiori_a_SOURCES = ior.c mdtest.c utilities.c parse_options.c ior-output.c option.c diff --git a/testing/basic-tests.sh b/testing/basic-tests.sh index c81b129..8dd3bef 100755 --- a/testing/basic-tests.sh +++ b/testing/basic-tests.sh @@ -6,7 +6,7 @@ # You can override the defaults by setting the variables before invoking the script, or simply set them here... # Example: export IOR_EXTRA="-v -v -v" -ROOT=${0%/*} +ROOT="$(dirname ${BASH_SOURCE[0]})" source $ROOT/test-lib.sh diff --git a/testing/test-lib.sh b/testing/test-lib.sh index 54ab0b2..965c92a 100644 --- a/testing/test-lib.sh +++ b/testing/test-lib.sh @@ -1,18 +1,21 @@ # Test script for basic IOR functionality testing various patterns -# It is kept as simple as possible and outputs the parameters used such that any test can be rerun easily. +# It is kept as simple as possible and outputs the parameters used such that any +# test can be rerun easily. -# You can override the defaults by setting the variables before invoking the script, or simply set them here... +# You can override the defaults by setting the variables before invoking the +# script, or simply set them here... # Example: export IOR_EXTRA="-v -v -v" IOR_MPIRUN=${IOR_MPIRUN:-mpiexec -np} -IOR_BIN_DIR=${IOR_BIN_DIR:-./build/src} -IOR_OUT=${IOR_OUT:-./build/test} +IOR_BIN_DIR=${IOR_BIN_DIR:-./src} +IOR_OUT=${IOR_OUT:-./test_logs} +IOR_TMP=${IOR_TMP:-/dev/shm} IOR_EXTRA=${IOR_EXTRA:-} # Add global options like verbosity MDTEST_EXTRA=${MDTEST_EXTRA:-} ################################################################################ mkdir -p ${IOR_OUT} -mkdir -p /dev/shm/mdest +mkdir -p ${IOR_TMP}/mdest ## Sanity check @@ -36,8 +39,8 @@ I=0 function IOR(){ RANKS=$1 shift - WHAT="${IOR_MPIRUN} $RANKS ${IOR_BIN_DIR}/ior ${@} ${IOR_EXTRA} -o /dev/shm/ior" - $WHAT 1>${IOR_OUT}/$I 2>&1 + WHAT="${IOR_MPIRUN} $RANKS ${IOR_BIN_DIR}/ior ${@} ${IOR_EXTRA} -o ${IOR_TMP}/ior" + $WHAT 1>"${IOR_OUT}/test_out.$I" 2>&1 if [[ $? != 0 ]]; then echo -n "ERR" ERRORS=$(($ERRORS + 1)) @@ -51,8 +54,8 @@ function IOR(){ function MDTEST(){ RANKS=$1 shift - WHAT="${IOR_MPIRUN} $RANKS ${IOR_BIN_DIR}/mdtest ${@} ${MDTEST_EXTRA} -d /dev/shm/mdest" - $WHAT 1>${IOR_OUT}/$I 2>&1 + WHAT="${IOR_MPIRUN} $RANKS ${IOR_BIN_DIR}/mdtest ${@} ${MDTEST_EXTRA} -d ${IOR_TMP}/mdest" + $WHAT 1>"${IOR_OUT}/test_out.$I" 2>&1 if [[ $? != 0 ]]; then echo -n "ERR" ERRORS=$(($ERRORS + 1)) diff --git a/travis-build.sh b/travis-build.sh new file mode 100755 index 0000000..6538d4f --- /dev/null +++ b/travis-build.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# +# Build the IOR source package. Returns the path to the built artifact. +# + +BASE_DIR="$(cd "${0%/*}" && pwd)" +if [ -z "$BASE_DIR" -o ! -d "$BASE_DIR" ]; then + echo "Cannot determine BASE_DIR (${BASE_DIR})" >&2 + exit 2 +fi +BUILD_DIR="${BASE_DIR}/build" + +PACKAGE="$(awk '/^Package/ {print $2}' $BASE_DIR/META)" +VERSION="$(awk '/^Version/ {print $2}' $BASE_DIR/META)" +DIST_TGZ="${PACKAGE}-${VERSION}.tar.gz" + +# Build the distribution +set -e +./bootstrap +test -d "$BUILD_DIR" && rm -rf "$BUILD_DIR" +mkdir -p "$BUILD_DIR" +cd "$BUILD_DIR" +$BASE_DIR/configure +set +e + +make dist && mv -v "${BUILD_DIR}/${DIST_TGZ}" "${BASE_DIR}/${DIST_TGZ}" diff --git a/travis-test.sh b/travis-test.sh new file mode 100755 index 0000000..dfc1235 --- /dev/null +++ b/travis-test.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +# +# Test the IOR source package. This is a complicated alternative to +# the `make distcheck` option. +# + +# These options will be passed directly to the autoconf configure script +CONFIGURE_OPTS="${CONFIGURE_OPTS:-""}" + +BASE_DIR="$(cd "${0%/*}" && pwd)" +if [ -z "$BASE_DIR" -o ! -d "$BASE_DIR" ]; then + echo "Cannot determine BASE_DIR (${BASE_DIR})" >&2 + exit 2 +fi +PACKAGE="$(awk '/^Package/ {print $2}' $BASE_DIR/META)" +VERSION="$(awk '/^Version/ {print $2}' $BASE_DIR/META)" +DIST_TGZ="${BASE_DIR}/${PACKAGE}-${VERSION}.tar.gz" + +TEST_DIR="${BASE_DIR}/test" +INSTALL_DIR="${TEST_DIR}/_inst" + +if [ -z "$DIST_TGZ" -o ! -f "$DIST_TGZ" ]; then + echo "Cannot find DIST_TGZ ($DIST_TGZ)" >&2 + exit 1 +fi + +test -d "$TEST_DIR" && rm -rf "$TEST_DIR" +mkdir -p "$TEST_DIR" + +tar -C "$TEST_DIR" -zxf "${DIST_TGZ}" + +# Configure, make, and install from the source distribution +set -e +cd "$TEST_DIR/${PACKAGE}-${VERSION}" +./configure $CONFIGURE_OPTS "--prefix=$INSTALL_DIR" +make install +set +e + +# Run the MPI tests +export IOR_BIN_DIR="${INSTALL_DIR}/bin" +export IOR_OUT="${TEST_DIR}/test_logs" +export IOR_TMP="$(mktemp -d)" +source "${TEST_DIR}/${PACKAGE}-${VERSION}/testing/basic-tests.sh" + +# Clean up residual temporary directories (if this isn't running as root) +if [ -d "$IOR_TMP" -a "$(id -u)" -ne 0 -a ! -z "$IOR_TMP" ]; then + rm -rvf "$IOR_TMP" +fi