Commit 4d1ec4ee6e58edd3d788962096bc89f5ebfaeaa5

Authored by Jürgen Knödlseder
1 parent e26b995e

Add configuration test script (#1091).

A configuration test script has been added that allows testing of the configuration after an install. This configuration test script can be used by a continous integration system to check the validity of the configuration script.
Showing 2 changed files with 66 additions and 2 deletions
configure.ac
... ... @@ -891,8 +891,10 @@ AC_CONFIG_FILES([Makefile
891 891 models/Makefile
892 892 examples/Makefile
893 893 scripts/Makefile
894   - ctools.pc],
895   - [if test -f test/test_cscripts.sh; then chmod +x test/test_cscripts.sh; fi])
  894 + ctools.pc
  895 + testconf.sh],
  896 + [if test -f test/test_cscripts.sh; then chmod +x test/test_cscripts.sh; fi;
  897 + if test -f testconf.sh; then chmod +x testconf.sh; fi])
896 898 AC_OUTPUT
897 899  
898 900  
... ...
testconf.sh.in 0 → 100755
  1 +#!/bin/sh
  2 +# =====================================================================
  3 +# Test ctools configuration script (used for continuous integration;
  4 +# assumes that ctools have 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 ctools
  49 +# ================
  50 +export CTOOLS="$prefix"
  51 +. $CTOOLS/bin/ctools-init.sh >& config.log
  52 +output=`cat config.log`
  53 +if [ "x$output" != x ]; then
  54 + echo "*** Configuration script was not silent ***"
  55 + echo "$output"
  56 + exit
  57 +fi
  58 +
  59 +#
  60 +# Signal completion
  61 +# =================
  62 +echo "Configuration test successful."
... ...