summaryrefslogtreecommitdiff
path: root/regress/infra-unittests
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2020-05-22 15:10:17 +0000
committerrillig <rillig@pkgsrc.org>2020-05-22 15:10:17 +0000
commite52b35218080c4b41a92e7c5cf02d4aec838d82d (patch)
treea4f3842cb7b6fc38578c448b9dc5f0bdccb1b623 /regress/infra-unittests
parent107929eeeb43a08064732a8128920711e248d748 (diff)
downloadpkgsrc-e52b35218080c4b41a92e7c5cf02d4aec838d82d.tar.gz
regess/infra-unittests: add test for unknown configure option
Diffstat (limited to 'regress/infra-unittests')
-rw-r--r--regress/infra-unittests/gnu-configure-strict.sh48
1 files changed, 46 insertions, 2 deletions
diff --git a/regress/infra-unittests/gnu-configure-strict.sh b/regress/infra-unittests/gnu-configure-strict.sh
index 746856a162a..ee4c9c7134d 100644
--- a/regress/infra-unittests/gnu-configure-strict.sh
+++ b/regress/infra-unittests/gnu-configure-strict.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# $NetBSD: gnu-configure-strict.sh,v 1.1 2020/05/21 13:42:10 rillig Exp $
+# $NetBSD: gnu-configure-strict.sh,v 1.2 2020/05/22 15:10:17 rillig Exp $
#
# Tests for GNU_CONFIGURE_STRICT handling in mk/configure/gnu-configure.mk.
#
@@ -348,7 +348,6 @@ if test_case_begin 'realistic example from gettext-tools-0.20.2 as of 2020-05-21
CONFIGURE_ARGS+= --mandir=/home/pbulk/pkg/man
.include "setup.mk"
- #RUN=set -eux;
.include "mk/configure/gnu-configure.mk"
EOF
@@ -397,3 +396,48 @@ if test_case_begin 'realistic example from gettext-tools-0.20.2 as of 2020-05-21
test_case_end
fi
+
+
+if test_case_begin 'configure script without enable_http variable'; then
+
+ # textproc/opensp as of 2020-05-22 has a configure script
+ # generated by Autoconf 2.59. That configure script recognizes
+ # --enable-http but does not have a corresponding variable
+ # definition in a line of their own.
+ #
+ # The word --enable-http appears twice in that file. Once in the
+ # --help text, and once in a shell comment saying "Check whether
+ # --enable-http or --disable-http was given". Therefore, detect
+ # the available options using the --help text.
+
+ create_file 'configure' <<-EOF
+ Optional features:
+ --disable-nls do not use Native Language Support
+ --enable-http include support for http
+ EOF
+ create_file 'testcase.mk' <<-EOF
+ GNU_CONFIGURE_STRICT= yes
+ CONFIGURE_DIRS= .
+ CONFIGURE_ARGS+= --enable-http
+ CONFIGURE_ARGS+= --enable-nls
+
+ .include "setup.mk"
+ .include "mk/configure/gnu-configure.mk"
+ EOF
+
+
+ run_bmake 'testcase.mk' '_check-unknown-configure-options' \
+ 1> "$tmpdir/output" 2>&1 \
+ && exitcode=0 || exitcode=$?
+
+ assert_that "$exitcode" --equals '1'
+ assert_that "$tmpdir/output" --file-is-lines \
+ 'error: [gnu-configure.mk] option --enable-http not found in ./configure' \
+ 'error: [gnu-configure.mk] option --enable-nls not found in ./configure' \
+ '*** Error code 1' \
+ '' \
+ 'Stop.' \
+ "$make: stopped in $PWD"
+
+ test_case_end
+fi