#!/bin/sh

# Simple regression tests.  Run through various combinations of the
# configure flags, create a lot file, then grep for "warning" or
# "error" through that log file when done.  This is intended to be
# run as a normal user on a system that has all of the optional
# libraries installed and usable.
#
# Copyright (C) 2000-2019 The Xastir Group.
#
# Licensed under the GPL license.  See the file "COPYING" for more
# information.


# NOTE:  It might be wise to move, rename, or change permissions on
# select header and/or library files when doing these tests, in
# order to verify that the code does the right thing when these
# libraries or headers are unavailable.  Perhaps add a series of
# tests just before the very last current test which do this.  This
# series of tests would probably by necessity be Linux-specific, and
# perhaps even distribution-specific, so perhaps we should have a
# command-line flag to enable those tests too.
#
# One test that definitely needs to be done (as root or sudo) is:
#
#   chmod 000 /usr/include/magick
#   ./configure
#   make
#   chmod 755 /usr/include/magick
#
# The above will test the XPM code in map_geo.c to test whether we
# can compile with XPM but without ImageMagick support.


# Use this command to tail the status file through multiple
# compiles:
#
#  tail -F --max-unchanged-stats=1 -s 0.05 regression.log
#



date

# Start an Xterm to show the regression log as the script runs:
xterm -geometry 91x67-0+65 -e tail -F --max-unchanged-stats=1 -s 0.05 regression.log &

nice ./bootstrap.sh



# Test with ZERO options enabled
#echo
echo -n "  55 TEST: NONE:                          "
rm -rf autom4te.cache
(rm regression.log 2>&1) >/dev/null
(nice ./configure \
    --without-ax25 \
    --without-festival \
    --without-gpsman \
    --without-imagemagick \
    --without-libproj \
    --without-geotiff \
    --without-shapelib \
    --without-pcre \
    --without-dbfawk \
    --without-map-cache 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test sparse + ax25
#echo
echo -n "  54 TEST: Sparse + ax25:                 "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --without-festival \
    --without-gpsman \
    --without-imagemagick \
    --without-libproj \
    --without-geotiff \
    --without-shapelib \
    --without-pcre \
    --without-dbfawk \
    --without-map-cache 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test sparse + festival
#echo
echo -n "  53 TEST: Sparse + festival:             "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --without-ax25 \
    --without-gpsman \
    --without-imagemagick \
    --without-libproj \
    --without-geotiff \
    --without-shapelib \
    --without-pcre \
    --without-dbfawk \
    --without-map-cache 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test sparse + gpsman
#echo
echo -n "  52 TEST: Sparse + gpsman:               "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --without-ax25 \
    --without-festival \
    --without-imagemagick \
    --without-libproj \
    --without-geotiff \
    --without-shapelib \
    --without-pcre \
    --without-dbfawk \
    --without-map-cache 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test sparse + imagemagick
#echo
echo -n "  51 TEST: Sparse + imagemagick:          "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --without-ax25 \
    --without-festival \
    --without-gpsman \
    --without-libproj \
    --without-geotiff \
    --without-shapelib \
    --without-pcre \
    --without-dbfawk \
    --without-map-cache 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test sparse + libproj
#echo
echo -n "  50 TEST: Sparse + libproj:              "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --without-ax25 \
    --without-festival \
    --without-gpsman \
    --without-imagemagick \
    --without-geotiff \
    --without-shapelib \
    --without-pcre \
    --without-dbfawk \
    --without-map-cache 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test sparse + geotiff
#echo
echo -n "  49 TEST: Sparse + geotiff:              "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --without-ax25 \
    --without-festival \
    --without-gpsman \
    --without-imagemagick \
    --without-libproj \
    --without-shapelib \
    --without-pcre \
    --without-dbfawk \
    --without-map-cache 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test sparse + libproj + geotiff
#echo
echo -n "  48 TEST: Sparse + libproj/geotiff:      "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --without-ax25 \
    --without-festival \
    --without-gpsman \
    --without-imagemagick \
    --without-shapelib \
    --without-pcre \
    --without-dbfawk \
    --without-map-cache 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"

# Test sparse + shapelib
#echo
echo -n "  46 TEST: Sparse + shapelib:             "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --without-ax25 \
    --without-festival \
    --without-gpsman \
    --without-imagemagick \
    --without-libproj \
    --without-geotiff \
    --without-pcre \
    --without-dbfawk \
    --without-map-cache 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test sparse +  pcre
#echo
echo -n "  45 TEST: Sparse + pcre:                 "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --without-ax25 \
    --without-festival \
    --without-gpsman \
    --without-imagemagick \
    --without-libproj \
    --without-geotiff \
    --without-shapelib \
    --without-dbfawk \
    --without-map-cache 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test sparse + dbfawk
#echo
echo -n "  44 TEST: Sparse + dbfawk:               "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --without-ax25 \
    --without-festival \
    --without-gpsman \
    --without-imagemagick \
    --without-libproj \
    --without-geotiff \
    --without-shapelib \
    --without-pcre \
    --without-map-cache 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test sparse + pcre/dbfawk
#echo
echo -n "  43 TEST: Sparse + shapelib/pcre/dbfawk: "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --without-ax25 \
    --without-festival \
    --without-gpsman \
    --without-imagemagick \
    --without-libproj \
    --without-geotiff \
    --without-map-cache 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test sparse + map-cache
#echo
echo -n "  42 TEST: Sparse + map-cache:            "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --without-ax25 \
    --without-festival \
    --without-gpsman \
    --without-imagemagick \
    --without-libproj \
    --without-geotiff \
    --without-shapelib \
    --without-pcre \
    --without-dbfawk 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test sparse + errorpopups
#echo
echo -n "  41 TEST: Sparse + errorpopups:          "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --without-ax25 \
    --without-festival \
    --without-gpsman \
    --without-imagemagick \
    --without-libproj \
    --without-geotiff \
    --without-shapelib \
    --without-pcre \
    --without-dbfawk \
    --without-map-cache \
    --with-errorpopups 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test sparse + libgc
#echo
echo -n "  40 TEST: Sparse + libgc:                "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --without-ax25 \
    --without-festival \
    --without-gpsman \
    --without-imagemagick \
    --without-libproj \
    --without-geotiff \
    --without-shapelib \
    --without-pcre \
    --without-dbfawk \
    --without-map-cache \
    --with-libgc 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test sparse + profiling
#echo
echo -n "  39 TEST: Sparse + profiling:            "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --without-ax25 \
    --without-festival \
    --without-gpsman \
    --without-imagemagick \
    --without-libproj \
    --without-geotiff \
    --without-shapelib \
    --without-pcre \
    --without-dbfawk \
    --without-map-cache \
    --with-profiling 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test sparse + rtree
#echo
echo -n "  38 TEST: Sparse + rtree:                "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --without-ax25 \
    --without-festival \
    --without-gpsman \
    --without-imagemagick \
    --without-libproj \
    --without-geotiff \
    --without-shapelib \
    --without-pcre \
    --without-dbfawk \
    --without-map-cache \
    --with-rtree 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test sparse + shapelib/rtree
#echo
echo -n "  37 TEST: Sparse + shapelib/rtree:       "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --without-ax25 \
    --without-festival \
    --without-gpsman \
    --without-imagemagick \
    --without-libproj \
    --without-geotiff \
    --without-pcre \
    --without-dbfawk \
    --without-map-cache \
    --with-rtree 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test sparse + lsb
#echo
echo -n "  36 TEST: Sparse + lsb:                  "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --without-ax25 \
    --without-festival \
    --without-gpsman \
    --without-imagemagick \
    --without-libproj \
    --without-geotiff \
    --without-shapelib \
    --without-pcre \
    --without-dbfawk \
    --without-map-cache \
    --with-lsb 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with ALL options enabled
#echo
echo -n "  35 TEST: ALL:                           "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --with-errorpopups \
    --with-libgc \
    --with-profiling \
    --with-rtree \
    --with-lsb 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with each flag in turn, one flag at a time
#echo
echo -n "  34 TEST: --without-ax25:                "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --without-ax25 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with each flag in turn, one flag at a time
#echo
echo -n "  33 TEST: --without-festival:            "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --without-festival 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with each flag in turn, one flag at a time
#echo
echo -n "  32 TEST: --without-gpsman:              "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --without-gpsman 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with each flag in turn, one flag at a time
#echo
echo -n "  31 TEST: --without-imagemagick:         "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --without-imagemagick 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with each flag in turn, one flag at a time
#echo
echo -n "  30 TEST: --without-libproj:             "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --without-libproj 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with each flag in turn, one flag at a time
#echo
echo -n "  29 TEST: --without-geotiff:             "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --without-geotiff 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with each flag in turn, one flag at a time
#echo
echo -n "  27 TEST: --without-shapelib:            "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --without-shapelib 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with each flag in turn, one flag at a time
#echo
echo -n "  26 TEST: --without-pcre:                "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --without-pcre 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with each flag in turn, one flag at a time
#echo
echo -n "  25 TEST: --without-dbfawk:              "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --without-dbfawk 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with each flag in turn, one flag at a time
#echo
echo -n "  24 TEST: --without-map-cache:           "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --without-map-cache 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with each flag in turn, one flag at a time
#echo
echo -n "  23 TEST: --with-errorpopups:            "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --with-errorpopups 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with each flag in turn, one flag at a time
#echo
echo -n "  22 TEST: --with-libgc:                  "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --with-libgc 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with each flag in turn, one flag at a time
#echo
echo -n "  21 TEST: --with-profiling:              "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --with-profiling 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with each flag in turn, one flag at a time
#echo
echo -n "  20 TEST: --with-rtree:                  "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --with-rtree 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with each flag in turn, one flag at a time
#echo
echo -n "  19 TEST: --with-lsb:                    "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --with-lsb 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with all but one option enabled
#echo
echo -n "  18 TEST: ALL --without-ax25:            "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --without-ax25 \
    --with-errorpopups \
    --with-libgc \
    --with-profiling \
    --with-rtree \
    --with-lsb 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with all but one option enabled
#echo
echo -n "  17 TEST: ALL --without-festival:        "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --without-festival \
    --with-errorpopups \
    --with-libgc \
    --with-profiling \
    --with-rtree \
    --with-lsb 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with all but one option enabled
#echo
echo -n "  16 TEST: ALL --without-gpsman:          "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --without-gpsman \
    --with-errorpopups \
    --with-libgc \
    --with-profiling \
    --with-rtree \
    --with-lsb 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with all but one option enabled
#echo
echo -n "  15 TEST: ALL --without-imagemagick:     "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --without-imagemagick \
    --with-errorpopups \
    --with-libgc \
    --with-profiling \
    --with-rtree \
    --with-lsb 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with all but one option enabled
#echo
echo -n "  14 TEST: ALL --without-libproj:         "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --without-libproj \
    --with-errorpopups \
    --with-libgc \
    --with-profiling \
    --with-rtree \
    --with-lsb 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with all but one option enabled
#echo
echo -n "  13 TEST: ALL --without-geotiff:         "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --without-geotiff \
    --with-errorpopups \
    --with-libgc \
    --with-profiling \
    --with-rtree \
    --with-lsb 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"

# Test with all but one option enabled
#echo
echo -n "  11 TEST: ALL --without-shapelib:        "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --without-shapelib \
    --with-errorpopups \
    --with-libgc \
    --with-profiling \
    --with-rtree \
    --with-lsb 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with all but one option enabled
#echo
echo -n "  10 TEST: ALL --without-pcre:            "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --without-pcre \
    --with-errorpopups \
    --with-libgc \
    --with-profiling \
    --with-rtree \
    --with-lsb 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with all but one option enabled
#echo
echo -n "  09 TEST: ALL --without-dbfawk:          "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --without-dbfawk \
    --with-errorpopups \
    --with-libgc \
    --with-profiling \
    --with-rtree \
    --with-lsb 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with all but one option enabled
#echo
echo -n "  08 TEST: ALL --without-map-cache:       "
rm -rf autom4te.cache
rm regression.log
(nice ./configure --without-map-cache \
    --with-errorpopups \
    --with-libgc \
    --with-profiling \
    --with-rtree \
    --with-lsb 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with all but one option enabled
#echo
echo -n "  07 TEST: ALL except errorpopups:        "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --with-libgc \
    --with-profiling \
    --with-rtree \
    --with-lsb 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with all but one option enabled
#echo
echo -n "  06 TEST: ALL except libgc:              "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --with-errorpopups \
    --with-profiling \
    --with-rtree \
    --with-lsb 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with all but one option enabled
#echo
echo -n "  05 TEST: ALL except profiling:          "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --with-errorpopups \
    --with-libgc \
    --with-rtree \
    --with-lsb 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with all but one option enabled
#echo
echo -n "  04 TEST: ALL except rtree:              "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --with-errorpopups \
    --with-libgc \
    --with-profiling \
    --with-lsb 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Test with all but one option enabled
#echo
echo -n "  03 TEST: ALL except lsb:                "
rm -rf autom4te.cache
rm regression.log
(nice ./configure \
    --with-errorpopups \
    --with-libgc \
    --with-profiling \
    --with-rtree 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



##################################################


# Test with ALL options enabled but various header files disabled
#echo
echo -n "  35 TEST: ALL: ImageMagick disabled      "
rm -rf autom4te.cache
rm regression.log
sudo chmod 000 /usr/include/magick  # Disable ImageMagick headers
(nice ./configure \
    --with-errorpopups \
    --with-libgc \
    --with-profiling \
    --with-rtree \
    --with-lsb 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
sudo chmod 755 /usr/include/magick  # Enable ImageMagick headers
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



##################################################



# Test default compile, no configure flags at all.  This test will
# also put the system back into a mode where a "make install" should
# be proper for this exact system.
#echo
echo -n "  01 TEST: Default configure:             "
rm -rf autom4te.cache
rm regression.log
(nice ./configure 2>&1) >> regression.log
#echo -n "        "
head -1 summary.log
(nice make clean 2>&1) >/dev/null
(nice make 2>&1) >> regression.log
grep -i warning regression.log
grep -i error regression.log | grep -vi errorpopups | grep -v "checking for strerror"



# Cleanup
rm -rf autom4te.cache
rm regression.log

date

