pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/regress/infra-unittests



Module Name:    pkgsrc
Committed By:   rillig
Date:           Fri May 22 15:10:17 UTC 2020

Modified Files:
        pkgsrc/regress/infra-unittests: gnu-configure-strict.sh

Log Message:
regess/infra-unittests: add test for unknown configure option


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
    pkgsrc/regress/infra-unittests/gnu-configure-strict.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/regress/infra-unittests/gnu-configure-strict.sh
diff -u pkgsrc/regress/infra-unittests/gnu-configure-strict.sh:1.1 pkgsrc/regress/infra-unittests/gnu-configure-strict.sh:1.2
--- pkgsrc/regress/infra-unittests/gnu-configure-strict.sh:1.1  Thu May 21 13:42:10 2020
+++ pkgsrc/regress/infra-unittests/gnu-configure-strict.sh      Fri May 22 15:10:17 2020
@@ -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 fr
                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 fr
 
        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