Changeset 2225


Ignore:
Timestamp:
Mar 22, 2010, 11:29:41 PM (12 years ago)
Author:
Peter
Message:

fixes #613. Restructure tests to have a configure.ac with no included acinclude but include needed code in configure.ac instead. This makes it easier for autotools to give a useful diagnosis when autoconf is too old. The cache in the test were also removed (was never a good idea) so now tests are run from scratch every time, in fact, old testdir is removed before creating input files (such as configure.ac). This makes the tests a bit more time consuming, but they are also more accurate (reported failures have often been problem with the cache).

Location:
trunk/test
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/common_defs.sh.in

    r2205 r2225  
    7171echo "=== Running $me ==="
    7272
    73 ac_prog_libtool=
    7473# if required tool is not available, exit 77 to skip test
    7574if test -n "$required"; then
     
    8079      (echo "$me: running libtool --version" && libtool --version) || \
    8180      (echo "$me: running glibtool --version" && glibtool --version) || exit 77
    82       ac_prog_libtool="AC_PROG_LIBTOOL"
    8381      ;;
    8482      *.m4)
     
    9997move_if_change=@abs_top_srcdir@/build_support/move-if-change
    10098
     99rm -rf $test_dir
    101100@MKDIR_P@ --verbose $test_dir
    102 
    103 if (echo "$required" | grep autoconf); then
    104 # if not a new acinclude.m4 exists, create a dummy one
    105 if (test -f acinclude.m4 && \
    106     is_newest acinclude.m4 common_defs.sh $me); then
    107   :
    108 else
    109   echo "creating a dummy acinclude.m4"
    110   echo "dnl a dummy include" > $test_dir/acinclude.m4 
    111 fi
    112 fi
    113101
    114102cd $test_dir
    115103
    116 if (echo "$required" | grep autoconf); then
     104if (echo "$required" | grep autoconf > /dev/null); then
    117105echo "creating configure.ac"
    118 cat > configure.ac.tmp <<EOF
     106cat > configure.ac <<EOF
    119107AC_INIT([hello],[1.0])
    120108AC_CONFIG_SRCDIR([hello.cc])
     
    124112AC_PROG_CXXCPP
    125113AC_PROG_CXX
    126 $ac_prog_libtool
    127 m4_include(acinclude.m4)
    128 AC_CONFIG_FILES([Makefile])
    129 AC_OUTPUT
    130114EOF
    131 $move_if_change -v configure.ac.tmp configure.ac
     115if (echo "$required" | grep libtool > /dev/null); then
     116echo AC_PROG_LIBTOOL >> configure.ac
     117fi
     118
    132119
    133120echo "creating Makefile.am"
    134 cat > Makefile.am.tmp <<EOF
     121cat > Makefile.am <<EOF
    135122ACLOCAL_AMFLAGS = -I m4
    136123# dependency to rerun configure
     
    143130hello_SOURCES = hello.cc
    144131EOF
    145 $move_if_change -v Makefile.am.tmp Makefile.am
    146132
    147133echo "creating hello.cc"
    148 cat > hello.cc.tmp <<EOF
     134cat > hello.cc <<EOF
    149135#include <yat/utility/Vector.h>
    150136#include <yat/utility/version.h>
     
    167153}
    168154EOF
    169 $move_if_change -v hello.cc.tmp hello.cc
    170155fi #end of creation of autotool files
    171156
     
    176161      @MKDIR_P@ --verbose m4
    177162      echo "copying $tool"
    178       cp @abs_top_srcdir@/m4/$tool m4/$tool.tmp
    179       $move_if_change -v m4/$tool.tmp m4/$tool
     163      cp @abs_top_srcdir@/m4/$tool m4/$tool
    180164      ;;
    181165      *)
     
    186170 
    187171# turn on shell traces when in verbose mode
    188 if test -n "$YAT_TEST_VERBOSE"; then
     172if test -n "$VERBOSE"; then
    189173    set -x
    190174fi
  • trunk/test/static_test.sh

    r2206 r2225  
    2828. ./common_defs.sh || exit 1
    2929
    30 echo "Creating acinclude.m4"
    31 cat > acinclude.m4.tmp <<EOF
     30cat >> configure.ac <<EOF
    3231YAT_FIND_YAT
    3332CXX=\`\$yat_config --cxx\`
     
    3736YAT_LDADD=\`\$yat_config --link-libtool\`
    3837AC_SUBST(YAT_LDADD)
     38AC_CONFIG_FILES([Makefile])
     39AC_OUTPUT
    3940EOF
    40 $move_if_change -v acinclude.m4.tmp acinclude.m4
    4141
    4242echo "AM_LDFLAGS = -all-static" >> Makefile.am
     
    4545./configure --with-yat=$abs_top_builddir/build_support/yat-config
    4646
    47 # we always wanna relink
    48 rm -f hello
    4947make
    5048./hello || exit 1
  • trunk/test/yat_cpp_add_flag_test.sh

    r2205 r2225  
    2929. ./common_defs.sh || exit 1
    3030
    31 echo "Creating acinclude.m4"
    32 cat > acinclude.m4 <<EOF
     31cat >> configure.ac <<EOF
    3332YAT_CPP_ADD_FLAG([YAT_CPPFLAGS__], [-I/usr/include])
    3433YAT_CPP_ADD_FLAG([YAT_CPPFLAGS__], [-I/usr/local/include])
     
    3635YAT_CPP_ADD_FLAG([YAT_CPPFLAGS__], [-DHAVE_SOMETHING])
    3736AC_SUBST(YAT_CPPFLAGS__)
     37AC_CONFIG_FILES([Makefile])
     38AC_OUTPUT
    3839EOF
    3940
  • trunk/test/yat_cxx_add_flag_test.sh

    r2205 r2225  
    2929. ./common_defs.sh || exit 1
    3030
    31 echo "Creating acinclude.m4"
    32 cat > acinclude.m4 <<EOF
     31cat >> configure.ac <<EOF
    3332YAT_CXX_ADD_FLAG([YAT_CXXFLAGS__], [-DSOMETHING])
    3433YAT_CXX_ADD_FLAG([YAT_CXXFLAGS__], [-DSOMETHING])
    3534AC_SUBST(YAT_CXXFLAGS__)
     35AC_CONFIG_FILES([Makefile])
     36AC_OUTPUT
    3637EOF
    3738
  • trunk/test/yat_ld_add_flag_test.sh

    r2205 r2225  
    2929. ./common_defs.sh || exit 1
    3030
    31 echo "Creating acinclude.m4"
    32 cat > acinclude.m4 <<EOF
     31cat >> configure.ac <<EOF
    3332YAT_LD_ADD_FLAG([YAT_LDFLAGS__], [-L/usr/lib])
    3433YAT_LD_ADD_FLAG([YAT_LDFLAGS__], [-L/usr/local/lib])
     
    3635YAT_LD_ADD_FLAG([YAT_LDFLAGS__], [-L/opt/lib])
    3736AC_SUBST(YAT_LDFLAGS__)
     37AC_CONFIG_FILES([Makefile])
     38AC_OUTPUT
    3839EOF
    3940
  • trunk/test/yat_m4_test.sh

    r2206 r2225  
    2929. ./common_defs.sh || exit 1
    3030
    31 echo "Creating acinclude.m4"
    32 cat > acinclude.m4.tmp <<EOF
     31cat >> configure.ac <<EOF
    3332YAT_FIND_YAT
    3433CXX=\`\$yat_config --cxx\`
     
    3837YAT_LDADD=\`\$yat_config --link-libtool\`
    3938AC_SUBST(YAT_LDADD)
     39AC_CONFIG_FILES([Makefile])
     40AC_OUTPUT
    4041EOF
    41 $move_if_change -v acinclude.m4.tmp acinclude.m4
    4242
    4343bootstrap
  • trunk/test/yat_m4_test2.sh

    r2206 r2225  
    2828. ./common_defs.sh || exit 1
    2929
    30 echo "creating acinclude.m4"
    31 cat > acinclude.m4.tmp <<EOF
     30cat >> configure.ac <<EOF
    3231YAT_FIND_YAT(,[AC_MSG_ERROR([yat_find_yat failed - see warning above])])
    3332YAT_CHECK_VERSION([1.60.2],
     
    3635YAT_CHECK_LIB(,[AC_MSG_ERROR([yat_check_lib failed - see warning above])])
    3736YAT_CHECK_YAT([2.7.8],,AC_MSG_ERROR([yat_check_yat failed - see warning above]))
     37AC_CONFIG_FILES([Makefile])
     38AC_OUTPUT
    3839EOF
    39 $move_if_change -v acinclude.m4.tmp acinclude.m4
    4040
    4141bootstrap
Note: See TracChangeset for help on using the changeset viewer.