Fix tests under FreeBSD.

check-debug, check-path, and check-system-flags used the following
pattern which fails under FreeBSD's /bin/sh

  VAR_NAME=value run_test --args

When this is run VAR_NAME is not exported to `run_test` so I changed
this pattern to:

  VAR_NAME=value
  export VAR_NAME
  run_test --args

Also added `unset` in a few cases where it would/could make a
difference.
This commit is contained in:
Dave Shawley 2020-05-01 10:58:50 +00:00
parent eb866ade77
commit dadb7301f2
3 changed files with 21 additions and 4 deletions

View file

@ -14,7 +14,12 @@ Global variable definition 'pc_top_builddir' = '\$(top_builddir)'
Error printing enabled by default due to use of output options besides --exists, --atleast/exact/max-version or --list-all. Value of --silence-errors: 0
Error printing enabled
$PACKAGE_VERSION"
PKG_CONFIG_DEBUG_SPEW=1 run_test --version
PKG_CONFIG_DEBUG_SPEW=1
export PKG_CONFIG_DEBUG_SPEW
run_test --version
unset PKG_CONFIG_DEBUG_SPEW
RESULT="Error printing enabled by default due to use of output options besides --exists, --atleast/exact/max-version or --list-all. Value of --silence-errors: 0
Error printing enabled

View file

@ -5,7 +5,10 @@ set -e
# PKG_CONFIG_PATH
RESULT=""
PKG_CONFIG_PATH="$srcdir/sub" run_test --exists sub1
PKG_CONFIG_PATH="$srcdir/sub"
export PKG_CONFIG_PATH
run_test --exists sub1
unset PKG_CONFIG_PATH
# default pkg-config path, making sure to resolve the variables fully
eval pc_path="$pc_path"

View file

@ -23,10 +23,16 @@ run_test --libs system
# Make sure that the full paths come out when the *_ALLOW_SYSTEM_*
# variables are set
RESULT="-I/usr/include"
PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 run_test --cflags system
PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS
run_test --cflags system
RESULT="-L/usr/lib -lsystem"
PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 run_test --libs system
PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
export PKG_CONFIG_ALLOW_SYSTEM_LIBS
run_test --libs system
unset PKG_CONFIG_ALLOW_SYSTEM_CFLAGS PKG_CONFIG_ALLOW_SYSTEM_LIBS
# Set the system paths to something else and test that the output
# contains the full paths
@ -39,6 +45,9 @@ run_test --cflags system
RESULT="-L/usr/lib -lsystem"
run_test --libs system
# Mark a bunch of stuff for export in the following loops
export CPATH C_INCLUDE_PATH CPP_INCLUDE_PATH INCLUDE
# Now check that the various GCC environment variables also update the
# system include path
for var in CPATH C_INCLUDE_PATH CPP_INCLUDE_PATH; do