Commit 84413db5a33625cd99b8938b9d9f62b949ca1733

Authored by Jürgen Knödlseder
1 parent 4737fbdd

Add testconf.sh.in script.

The testconf.sh.in script may be used to test the GammaLib configuration script following installation. This script should be used by the continous integration system to guarantee the coherence of the installation script at any time.
.gitignore
... ... @@ -70,6 +70,7 @@ test-driver
70 70 src/gammalib-setup
71 71 src/template/test_GClass
72 72 doc/Doxyfile.bak
  73 +testconf.sh
73 74  
74 75 test/test_url.dat
75 76 test/*.xml
... ...
configure.ac
... ... @@ -1277,7 +1277,10 @@ AC_CONFIG_FILES([Makefile
1277 1277 test/Makefile
1278 1278 pyext/Makefile
1279 1279 pyext/setup.py
1280   - gammalib.pc])
  1280 + gammalib.pc
  1281 + testconf.sh],
  1282 + [if test -f testconf.sh; then chmod +x testconf.sh; fi])
  1283 +
1281 1284 if test "x$with_inst" = "xyes"; then
1282 1285 AC_CONFIG_FILES([inst/Makefile])
1283 1286 fi
... ...
src/gammalib-setup.in
... ... @@ -171,7 +171,8 @@ fi
171 171 # Set MANPATH
172 172 # ===========
173 173 if [ "x$MANPATH" = x ]; then
174   - MANPATH="$man_dir:$(manpath)"
  174 + manpath=${manpath:-}
  175 + MANPATH="$man_dir:${manpath}"
175 176 else
176 177 MANPATH=`echo ":$MANPATH:" | \
177 178 sed "s%:$man_dir:%:%g" | sed "s%::*$%%"`
... ...
testconf.sh.in 0 → 100755
  1 +#!/bin/sh
  2 +# =====================================================================
  3 +# Test GammaLib configuration script (used for continuous integration;
  4 +# assumes that GammaLib has been installed)
  5 +#
  6 +# Copyright (C) 2014 Juergen Knoedlseder
  7 +#
  8 +# This program is free software: you can redistribute it and/or modify
  9 +# it under the terms of the GNU General Public License as published by
  10 +# the Free Software Foundation, either version 3 of the License, or
  11 +# (at your option) any later version.
  12 +#
  13 +# This program is distributed in the hope that it will be useful,
  14 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  15 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16 +# GNU General Public License for more details.
  17 +#
  18 +# You should have received a copy of the GNU General Public License
  19 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
  20 +# =====================================================================
  21 +#
  22 +# Exit on any error
  23 +# =================
  24 +set -e
  25 +
  26 +#
  27 +# Set fixed parameters
  28 +# ====================
  29 +test_dir="home"
  30 +
  31 +#
  32 +# Set parameters
  33 +# ==============
  34 +prefix="@prefix@"
  35 +
  36 +#
  37 +# Save current working directory
  38 +# ==============================
  39 +base=$PWD
  40 +
  41 +#
  42 +# Create test directory
  43 +# =====================
  44 +@MKDIR_P@ "$test_dir"
  45 +cd "$test_dir"
  46 +
  47 +#
  48 +# Configure GammaLib
  49 +# ==================
  50 +export GAMMALIB="$prefix"
  51 +. $GAMMALIB/bin/gammalib-init.sh > config.log 2>&1
  52 +output=`cat config.log`
  53 +if [ "x$output" != x ]; then
  54 + echo "*** Configuration script was not silent ***"
  55 + echo "$output"
  56 + exit 1
  57 +fi
  58 +
  59 +#
  60 +# Signal completion
  61 +# =================
  62 +echo "Configuration test successful."
... ...