X-Git-Url: https://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/4f931a71edce4d7456c233487703a894410fd599..00ae41703c606f0ea98febed8f67435f875f7e6f:/tests/general.at diff --git a/tests/general.at b/tests/general.at index 9e5fbcc..4001942 100644 --- a/tests/general.at +++ b/tests/general.at @@ -1,4 +1,4 @@ -dnl Copyright © 2019 Nick Bowler +dnl Copyright © 2019-2020 Nick Bowler dnl License GPLv2+: GNU General Public License version 2 or any later version. dnl This is free software: you are free to change and redistribute it. dnl There is NO WARRANTY, to the extent permitted by law. @@ -266,3 +266,46 @@ AT_CHECK([./main], [0], [Hello, World! ]) AT_CLEANUP + +AT_SETUP([GOB2_CHECK min-version test]) + +AT_DATA([configure.ac], +[[AC_PREREQ([2.62]) +AC_INIT([test], [0]) +AC_OUTPUT +]]) +AT_CHECK([$AUTOCONF && test -f configure || exit 77], [0], [ignore], [ignore]) + +m4_define([MYVER], + m4_bpatsubst(m4_dquote(m4_defn([AT_PACKAGE_VERSION])), [[^][0-9.]])) + +m4_define([MYVER_P1], m4_dquote(m4_reverse(m4_unquote( + m4_split(m4_defn([MYVER]), [[.]]))))) +m4_define([MYVER_P1], m4_join([.], m4_reverse( + m4_eval(m4_car(MYVER_P1)+1), m4_shift(MYVER_P1)))) + +AT_DATA([test.in], [[@GOB2@ +]]) + +cat >configure.ac <expout +AT_CHECK([cat test], [0], [expout], [ignore]) + +sed '/GOB2_CHECK/c\ +[GOB2_CHECK(]m4_dquote(m4_defn([MYVER_P1]))[)]' configure.ac >configure.new +mv -f configure.new configure.ac +AT_CHECK([$AUTOCONF --force]) +AT_CHECK([./configure], [1], [ignore], [ignore]) + +AT_CLEANUP