diff options
author | rillig <rillig@pkgsrc.org> | 2020-05-23 12:11:33 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2020-05-23 12:11:33 +0000 |
commit | 7a4237402d77c6392a71bbe52362651b1dfb6ebb (patch) | |
tree | 3c9c37769f65535819961bd0388db7de5d2ce0b4 /regress | |
parent | 3ea1254177d6cb2e8caf73b627fa4324c14edd57 (diff) | |
download | pkgsrc-7a4237402d77c6392a71bbe52362651b1dfb6ebb.tar.gz |
mk/configure: fix configure options check for custom CONFIGURE_SCRIPT
Seen in cross/arm-none-eabi-gdb.
Diffstat (limited to 'regress')
-rw-r--r-- | regress/infra-unittests/gnu-configure-strict.sh | 58 |
1 files changed, 57 insertions, 1 deletions
diff --git a/regress/infra-unittests/gnu-configure-strict.sh b/regress/infra-unittests/gnu-configure-strict.sh index 56933183766..e718fbda59d 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.4 2020/05/23 07:30:18 rillig Exp $ +# $NetBSD: gnu-configure-strict.sh,v 1.5 2020/05/23 12:11:33 rillig Exp $ # # Tests for GNU_CONFIGURE_STRICT handling in mk/configure/gnu-configure.mk. # @@ -25,6 +25,8 @@ test_case_set_up() { OPSYS= NetBSD WRKDIR= $PWD WRKSRC= $PWD + + CONFIGURE_SCRIPT?= ./configure EOF } @@ -453,3 +455,57 @@ if test_case_begin 'configure script without enable_http variable'; then test_case_end fi + + +if test_case_begin 'custom CONFIGURE_SCRIPT in relative directory'; then + + create_file 'pkgname-1.0/configure.gnu' <<-EOF + if test "\${enable_option+set}" = set; then :; fi + EOF + mkdir 'build' + create_file 'testcase.mk' <<-EOF + GNU_CONFIGURE_STRICT= yes + CONFIGURE_DIRS= build + CONFIGURE_SCRIPT= ../pkgname-1.0/configure.gnu + CONFIGURE_ARGS= --enable-option + + .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 '0' + assert_that "$tmpdir/output" --file-is-empty + + test_case_end +fi + + +if test_case_begin 'custom CONFIGURE_SCRIPT in absolute directory'; then + + create_file 'pkgname-1.0/configure.gnu' <<-EOF + if test "\${enable_option+set}" = set; then :; fi + EOF + mkdir 'build' + create_file 'testcase.mk' <<-EOF + GNU_CONFIGURE_STRICT= yes + CONFIGURE_DIRS= build + CONFIGURE_SCRIPT= \${WRKDIR}/pkgname-1.0/configure.gnu + CONFIGURE_ARGS= --enable-option + + .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 '0' + assert_that "$tmpdir/output" --file-is-empty + + test_case_end +fi |