1842 |
02 Mar 09 |
peter |
# @configure_input@ |
1842 |
02 Mar 09 |
peter |
# $Id$ |
1842 |
02 Mar 09 |
peter |
3 |
|
4359 |
23 Aug 23 |
peter |
# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2019, 2020, 2023 Peter Johansson |
1842 |
02 Mar 09 |
peter |
5 |
# |
1842 |
02 Mar 09 |
peter |
# This file is part of the yat library, http://dev.thep.lu.se/yat |
1842 |
02 Mar 09 |
peter |
7 |
# |
1842 |
02 Mar 09 |
peter |
# The yat library is free software; you can redistribute it |
1842 |
02 Mar 09 |
peter |
# and/or modify it under the terms of the GNU General Public License as |
1842 |
02 Mar 09 |
peter |
# published by the Free Software Foundation; either version 3 of the |
1842 |
02 Mar 09 |
peter |
# License, or (at your option) any later version. |
1842 |
02 Mar 09 |
peter |
12 |
# |
1842 |
02 Mar 09 |
peter |
# The yat library is distributed in the hope that it will be useful, |
1842 |
02 Mar 09 |
peter |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1842 |
02 Mar 09 |
peter |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1842 |
02 Mar 09 |
peter |
# General Public License for more details. |
1842 |
02 Mar 09 |
peter |
17 |
# |
1842 |
02 Mar 09 |
peter |
# You should have received a copy of the GNU General Public License |
1842 |
02 Mar 09 |
peter |
# along with yat. If not, see <http://www.gnu.org/licenses/>. |
1842 |
02 Mar 09 |
peter |
20 |
|
1854 |
07 Mar 09 |
peter |
21 |
|
2519 |
11 Jul 11 |
peter |
# bootstrap a test project |
1854 |
07 Mar 09 |
peter |
23 |
# |
2205 |
27 Feb 10 |
peter |
bootstrap () |
2205 |
27 Feb 10 |
peter |
25 |
{ |
4326 |
12 Mar 23 |
peter |
$RM -rf m4 |
3038 |
07 Jun 13 |
peter |
$mkdir_p m4 |
3038 |
07 Jun 13 |
peter |
cp $abs_top_srcdir/m4/*.m4 m4/. |
4326 |
12 Mar 23 |
peter |
$RM -f m4/lt*.m4 m4/libtool.m4 |
3051 |
12 Jun 13 |
peter |
res=0 |
3945 |
20 Jul 20 |
peter |
export AUTOM4TE |
3945 |
20 Jul 20 |
peter |
export AUTOCONF |
3945 |
20 Jul 20 |
peter |
export AUTOHEADER |
3945 |
20 Jul 20 |
peter |
export AUTOMAKE |
3945 |
20 Jul 20 |
peter |
export ACLOCAL |
3945 |
20 Jul 20 |
peter |
export AUTOPOINT |
3945 |
20 Jul 20 |
peter |
export LIBTOOLIZE |
3945 |
20 Jul 20 |
peter |
export M4 |
3945 |
20 Jul 20 |
peter |
$AUTORECONF -si $verbose || res=$? |
2240 |
11 Apr 10 |
peter |
case $res in |
2240 |
11 Apr 10 |
peter |
0) |
2240 |
11 Apr 10 |
peter |
42 |
:;; |
2240 |
11 Apr 10 |
peter |
63) |
2528 |
26 Jul 11 |
peter |
exit_skip;; |
2240 |
11 Apr 10 |
peter |
45 |
*) |
2240 |
11 Apr 10 |
peter |
exit $res;; |
2240 |
11 Apr 10 |
peter |
esac |
2205 |
27 Feb 10 |
peter |
48 |
} |
1854 |
07 Mar 09 |
peter |
49 |
|
2458 |
03 Apr 11 |
peter |
# Usage: run PROG EXPECTED_EXITCODE [OPTION]... |
2458 |
03 Apr 11 |
peter |
run () |
2458 |
03 Apr 11 |
peter |
52 |
{ |
2520 |
11 Jul 11 |
peter |
test $# -ge 2 || exit_fatal |
2458 |
03 Apr 11 |
peter |
foo_prog=$1 |
2458 |
03 Apr 11 |
peter |
shift |
2458 |
03 Apr 11 |
peter |
expected_exitcode=$1 |
2458 |
03 Apr 11 |
peter |
shift |
2458 |
03 Apr 11 |
peter |
exitcode=0 |
2458 |
03 Apr 11 |
peter |
$foo_prog ${1+"$@"} > stdout 2>stderr || exitcode=$? |
2458 |
03 Apr 11 |
peter |
cat stderr >&2 |
2458 |
03 Apr 11 |
peter |
cat stdout |
2520 |
11 Jul 11 |
peter |
test $exitcode = $expected_exitcode || Exit 1 |
2458 |
03 Apr 11 |
peter |
63 |
} |
2205 |
27 Feb 10 |
peter |
64 |
|
2519 |
11 Jul 11 |
peter |
Exit () { set +x; exit $1; } |
2519 |
11 Jul 11 |
peter |
warn_ () { echo $@ >&2; } |
2519 |
11 Jul 11 |
peter |
exit_fail () { warn_ "$me: failed test: $@"; Exit 1; } |
2519 |
11 Jul 11 |
peter |
exit_fatal () { warn_ "$me: hard error: $@"; Exit 99; } |
2692 |
28 Feb 12 |
peter |
exit_skip () { warn_ "$me: skipped test: $@"; Exit 77; } |
2519 |
11 Jul 11 |
peter |
exit_success () { echo "$me: successsful test: $@"; Exit 0; } |
2519 |
11 Jul 11 |
peter |
71 |
|
3036 |
03 Jun 13 |
peter |
check_requirements () |
3036 |
03 Jun 13 |
peter |
73 |
{ |
2528 |
26 Jul 11 |
peter |
# if required tool is not available, exit_skip |
1854 |
07 Mar 09 |
peter |
if test -n "$required"; then |
1854 |
07 Mar 09 |
peter |
for tool in $required; do |
1854 |
07 Mar 09 |
peter |
case $tool in |
3945 |
20 Jul 20 |
peter |
aclocal) |
3945 |
20 Jul 20 |
peter |
echo "$me: running $ACLOCAL --version" |
3945 |
20 Jul 20 |
peter |
($ACLOCAL --version) || exit_skip; |
3945 |
20 Jul 20 |
peter |
81 |
;; |
3945 |
20 Jul 20 |
peter |
autoconf) |
3945 |
20 Jul 20 |
peter |
echo "$me: running $AUTOCONF --version" |
3945 |
20 Jul 20 |
peter |
($AUTOCONF --version) || exit_skip; |
3945 |
20 Jul 20 |
peter |
85 |
;; |
2406 |
12 Jan 11 |
peter |
automake) |
3844 |
13 Sep 19 |
peter |
echo "$me: running $AUTOMAKE --version" |
3844 |
13 Sep 19 |
peter |
($AUTOMAKE --version) || exit_skip; |
2406 |
12 Jan 11 |
peter |
# skip test if automake older than v1.10 |
2406 |
12 Jan 11 |
peter |
version_am=`$tool --version | head -n 1 | cut -f 2 -d ')'` |
2406 |
12 Jan 11 |
peter |
ver_major=`echo ${version_am} | cut -f 1 -d '.'` |
2528 |
26 Jul 11 |
peter |
test ${ver_major} -ge 1 || exit_skip |
2406 |
12 Jan 11 |
peter |
ver_minor=`echo ${version_am} | cut -f 2 -d '.'` |
2528 |
26 Jul 11 |
peter |
test ${ver_major} -gt 1 || test ${ver_minor} -ge 10 || exit_skip |
2406 |
12 Jan 11 |
peter |
95 |
;; |
2519 |
11 Jul 11 |
peter |
doxygen) |
3890 |
26 Mar 20 |
peter |
test x"${have_doxygen}" = x"yes" || exit_skip no doxygen |
2519 |
11 Jul 11 |
peter |
98 |
;; |
3400 |
30 Mar 15 |
peter |
htslib) |
3890 |
26 Mar 20 |
peter |
test x"${have_htslib}" = x"yes" || exit_skip no libbam |
2981 |
04 Feb 13 |
peter |
101 |
;; |
3100 |
01 Nov 13 |
peter |
libmy-shared) |
3100 |
01 Nov 13 |
peter |
test -r test/lib/libmy-shared.la || exit_fatal "no 'libmy-shared.la'" |
3100 |
01 Nov 13 |
peter |
test -s test/lib/libmy-shared.la || exit_skip no shared lib |
3100 |
01 Nov 13 |
peter |
105 |
;; |
3100 |
01 Nov 13 |
peter |
libmy-static) |
3100 |
01 Nov 13 |
peter |
test -r test/lib/libmy-static.a || exit_fatal "no 'libmy-static.a'" |
3100 |
01 Nov 13 |
peter |
test -s test/lib/libmy-static.a || exit_skip no static lib |
3100 |
01 Nov 13 |
peter |
109 |
;; |
1854 |
07 Mar 09 |
peter |
libtool) |
3844 |
13 Sep 19 |
peter |
echo "$me: running $LIBTOOLIZE --version" |
3844 |
13 Sep 19 |
peter |
($LIBTOOLIZE --version) || exit_skip libtool not available; |
1854 |
07 Mar 09 |
peter |
113 |
;; |
3945 |
20 Jul 20 |
peter |
pkg-config) |
3945 |
20 Jul 20 |
peter |
echo hello |
3945 |
20 Jul 20 |
peter |
echo "$me: running $PKG_CONFIG --version" |
3945 |
20 Jul 20 |
peter |
($PKG_CONFIG --version) || exit_skip pkg-config not available; |
3945 |
20 Jul 20 |
peter |
118 |
;; |
3035 |
12 May 13 |
peter |
shared) |
3890 |
26 Mar 20 |
peter |
if (test "x${enable_shared}" = "xno"); then |
3035 |
12 May 13 |
peter |
echo shared disabled; |
3035 |
12 May 13 |
peter |
exit_skip; |
3035 |
12 May 13 |
peter |
fi |
3035 |
12 May 13 |
peter |
124 |
;; |
2244 |
20 Apr 10 |
peter |
static) |
3890 |
26 Mar 20 |
peter |
if (test "x${enable_static}" = "xno"); then |
3035 |
12 May 13 |
peter |
echo static disabled; |
2528 |
26 Jul 11 |
peter |
exit_skip; |
2244 |
20 Apr 10 |
peter |
fi |
2244 |
20 Apr 10 |
peter |
130 |
;; |
1854 |
07 Mar 09 |
peter |
131 |
*) |
1854 |
07 Mar 09 |
peter |
echo "$me: running $tool --version" |
2528 |
26 Jul 11 |
peter |
($tool --version) || exit_skip |
1854 |
07 Mar 09 |
peter |
esac |
1854 |
07 Mar 09 |
peter |
done |
1854 |
07 Mar 09 |
peter |
fi |
3036 |
03 Jun 13 |
peter |
137 |
} |
2692 |
28 Feb 12 |
peter |
138 |
|
3036 |
03 Jun 13 |
peter |
139 |
|
3036 |
03 Jun 13 |
peter |
me=$0 |
1842 |
02 Mar 09 |
peter |
# some defs we need in tests |
1846 |
04 Mar 09 |
peter |
test_dir=`echo $me.dir | sed -e 's,.*[\\/],,'` |
2739 |
07 Jun 12 |
peter |
test_dir="test/testSubDir/$test_dir" |
1842 |
02 Mar 09 |
peter |
abs_top_builddir=@abs_top_builddir@ |
1854 |
07 Mar 09 |
peter |
abs_top_srcdir=@abs_top_srcdir@ |
3112 |
10 Nov 13 |
peter |
enable_static="@enable_static@" |
3112 |
10 Nov 13 |
peter |
enable_shared="@enable_shared@" |
3110 |
09 Nov 13 |
peter |
lt_cv_objdir=@lt_cv_objdir@ |
2517 |
11 Jul 11 |
peter |
have_doxygen="@have_doxygen@" |
3890 |
26 Mar 20 |
peter |
have_htslib="@have_htslib@" |
3035 |
12 May 13 |
peter |
mkdir_p="@MKDIR_P@ --verbose" |
3038 |
07 Jun 13 |
peter |
verbose="--verbose" |
3038 |
07 Jun 13 |
peter |
silent= |
3112 |
10 Nov 13 |
peter |
configure_opts= |
3112 |
10 Nov 13 |
peter |
test x"$enable_shared" = x"no" && configure_opts="--disable-shared" |
3112 |
10 Nov 13 |
peter |
test x"$enable_static" = x"no" \ |
3112 |
10 Nov 13 |
peter |
&& configure_opts="$onfigure_options --disable-static" |
1842 |
02 Mar 09 |
peter |
158 |
|
3844 |
13 Sep 19 |
peter |
# set autotools variables if not set (se we use same as autoreconf) |
3844 |
13 Sep 19 |
peter |
: ${LIBTOOLIZE='libtoolize'} |
3945 |
20 Jul 20 |
peter |
: ${AUTOCONF='autoconf'} |
3945 |
20 Jul 20 |
peter |
: ${AUTOM4TE='autom4te'} |
3844 |
13 Sep 19 |
peter |
: ${AUTOMAKE='automake'} |
3945 |
20 Jul 20 |
peter |
: ${AUTOHEADER='autoheader'} |
3945 |
20 Jul 20 |
peter |
: ${AUTOPOINT='autopoint'} |
3945 |
20 Jul 20 |
peter |
: ${AUTORECONF='autoreconf'} |
3844 |
13 Sep 19 |
peter |
: ${ACLOCAL='aclocal'} |
3945 |
20 Jul 20 |
peter |
: ${GSL_CONFIG=@GSL_CONFIG@} |
3945 |
20 Jul 20 |
peter |
: ${M4=m4} |
3945 |
20 Jul 20 |
peter |
: ${MAKE=make} |
3945 |
20 Jul 20 |
peter |
: ${PKG_CONFIG='pkg-config'} |
4326 |
12 Mar 23 |
peter |
: ${RM=rm} |
4327 |
12 Mar 23 |
peter |
: ${EGREP=@EGREP@} |
4327 |
12 Mar 23 |
peter |
: ${GREP=@GREP@} |
3112 |
10 Nov 13 |
peter |
YAT_CONFIG=$abs_top_builddir/build_support/yat-config |
3365 |
01 Dec 14 |
peter |
YAT_LDFLAGS="@YAT_LDFLAGS@" |
3825 |
18 Jul 19 |
peter |
CXX="@CXX@" |
3825 |
18 Jul 19 |
peter |
CPPFLAGS="@CPPFLAGS@" |
3825 |
18 Jul 19 |
peter |
CXXFLAGS="@CXXFLAGS@" |
3365 |
01 Dec 14 |
peter |
LDFLAGS="@LDFLAGS@" |
2950 |
11 Jan 13 |
peter |
181 |
|
2517 |
11 Jul 11 |
peter |
# user is always right |
2517 |
11 Jul 11 |
peter |
test -z "$DOXYGEN" && DOXYGEN="@DOXYGEN@" |
3100 |
01 Nov 13 |
peter |
VERSION="@VERSION@" |