Fix test scripts on ancient Bash

This showed up on Solaris 9 with Bash 2.05. Also see https://unix.stackexchange.com/q/468579/56041
pull/723/head
Jeffrey Walton 2018-09-12 13:06:28 -04:00
parent 590f8573c4
commit 1d5eaf5268
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
7 changed files with 42 additions and 2 deletions

View File

@ -11,6 +11,12 @@ SED=sed
AWK=awk
MAKE=make
# Fixup ancient Bash
# https://unix.stackexchange.com/q/468579/56041
if [[ -z "$BASH_SOURCE" ]]; then
BASH_SOURCE="$0"
fi
# Fixup, Solaris and friends
if [[ (-d /usr/xpg4/bin) ]]; then
SED=/usr/xpg4/bin/sed

View File

@ -6,6 +6,12 @@ function cleanup {
}
trap cleanup EXIT
# Fixup ancient Bash
# https://unix.stackexchange.com/q/468579/56041
if [[ -z "$BASH_SOURCE" ]]; then
BASH_SOURCE="$0"
fi
# Fixup for Solaris and BSDs
if [[ ! -z $(command -v gmake) ]]; then
MAKE=gmake
@ -22,8 +28,6 @@ if ! wget --no-check-certificate https://github.com/noloader/cryptopp-cmake/blob
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
PWD_DIR=$(pwd)
rm -rf "$PWD_DIR/cmake_build"
mkdir -p "$PWD_DIR/cmake_build"
cd "$PWD_DIR/cmake_build"

View File

@ -6,6 +6,12 @@
# This is a test script that can be used on some Linux/Unix/Apple machines to automate testing
# of the shared object to ensure linking and symbols don't go missing from release to release.
# Fixup ancient Bash
# https://unix.stackexchange.com/q/468579/56041
if [[ -z "$BASH_SOURCE" ]]; then
BASH_SOURCE="$0"
fi
############################################
# Tags to test

View File

@ -81,6 +81,12 @@ MAKE=make
DISASS=objdump
DISASSARGS=("--disassemble")
# Fixup ancient Bash
# https://unix.stackexchange.com/q/468579/56041
if [[ -z "$BASH_SOURCE" ]]; then
BASH_SOURCE="$0"
fi
# Fixup, Solaris and friends
if [[ (-d /usr/xpg4/bin) ]]; then
SED=/usr/xpg4/bin/sed

View File

@ -6,6 +6,12 @@
# run 'governor.sh powersave' or reboot. The script is based on code by
# Andy Polyakov, http://www.openssl.org/~appro/cryptogams/.
# Fixup ancient Bash
# https://unix.stackexchange.com/q/468579/56041
if [[ -z "$BASH_SOURCE" ]]; then
BASH_SOURCE="$0"
fi
if [ "x$1" = "x" ]; then
echo "usage: $0 on[demand]|pe[rformance]|po[wersave]|us[erspace]?"
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1

View File

@ -81,6 +81,12 @@ MAKE=make
DISASS=objdump
DISASSARGS=("--disassemble")
# Fixup ancient Bash
# https://unix.stackexchange.com/q/468579/56041
if [[ -z "$BASH_SOURCE" ]]; then
BASH_SOURCE="$0"
fi
# Fixup, Solaris and friends
if [[ (-d /usr/xpg4/bin) ]]; then
SED=/usr/xpg4/bin/sed

View File

@ -143,6 +143,12 @@ int scoped_main(int argc, char *argv[])
_CrtSetDbgFlag( tempflag );
#endif
#ifdef _SUNPRO_CC
// No need for thread safety for the test program
cout.set_safe_flag(stream_MT::unsafe_object);
cin.set_safe_flag(stream_MT::unsafe_object);
#endif
try
{
RegisterFactories(All);