Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/regress/infra-unittests regess/infra-unittests: add te...
details: https://anonhg.NetBSD.org/pkgsrc/rev/b5e51b5a5ef0
branches: trunk
changeset: 432466:b5e51b5a5ef0
user: rillig <rillig%pkgsrc.org@localhost>
date: Fri May 22 15:10:17 2020 +0000
description:
regess/infra-unittests: add test for unknown configure option
diffstat:
regress/infra-unittests/gnu-configure-strict.sh | 48 +++++++++++++++++++++++-
1 files changed, 46 insertions(+), 2 deletions(-)
diffs (67 lines):
diff -r 5fc78b3a44ef -r b5e51b5a5ef0 regress/infra-unittests/gnu-configure-strict.sh
--- a/regress/infra-unittests/gnu-configure-strict.sh Fri May 22 13:45:28 2020 +0000
+++ b/regress/infra-unittests/gnu-configure-strict.sh Fri May 22 15:10:17 2020 +0000
@@ -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 @@
CONFIGURE_ARGS+= --mandir=/home/pbulk/pkg/man
.include "setup.mk"
- #RUN=set -eux;
.include "mk/configure/gnu-configure.mk"
EOF
@@ -397,3 +396,48 @@
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
Home |
Main Index |
Thread Index |
Old Index