Fix test scripts on ancient Bash
This showed up on Solaris 9 with Bash 2.05. Also see https://unix.stackexchange.com/q/468579/56041pull/723/head
parent
590f8573c4
commit
1d5eaf5268
|
|
@ -11,6 +11,12 @@ SED=sed
|
||||||
AWK=awk
|
AWK=awk
|
||||||
MAKE=make
|
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
|
# Fixup, Solaris and friends
|
||||||
if [[ (-d /usr/xpg4/bin) ]]; then
|
if [[ (-d /usr/xpg4/bin) ]]; then
|
||||||
SED=/usr/xpg4/bin/sed
|
SED=/usr/xpg4/bin/sed
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,12 @@ function cleanup {
|
||||||
}
|
}
|
||||||
trap cleanup EXIT
|
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
|
# Fixup for Solaris and BSDs
|
||||||
if [[ ! -z $(command -v gmake) ]]; then
|
if [[ ! -z $(command -v gmake) ]]; then
|
||||||
MAKE=gmake
|
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
|
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PWD_DIR=$(pwd)
|
|
||||||
|
|
||||||
rm -rf "$PWD_DIR/cmake_build"
|
rm -rf "$PWD_DIR/cmake_build"
|
||||||
mkdir -p "$PWD_DIR/cmake_build"
|
mkdir -p "$PWD_DIR/cmake_build"
|
||||||
cd "$PWD_DIR/cmake_build"
|
cd "$PWD_DIR/cmake_build"
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,12 @@
|
||||||
# This is a test script that can be used on some Linux/Unix/Apple machines to automate testing
|
# 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.
|
# 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
|
# Tags to test
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,12 @@ MAKE=make
|
||||||
DISASS=objdump
|
DISASS=objdump
|
||||||
DISASSARGS=("--disassemble")
|
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
|
# Fixup, Solaris and friends
|
||||||
if [[ (-d /usr/xpg4/bin) ]]; then
|
if [[ (-d /usr/xpg4/bin) ]]; then
|
||||||
SED=/usr/xpg4/bin/sed
|
SED=/usr/xpg4/bin/sed
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,12 @@
|
||||||
# run 'governor.sh powersave' or reboot. The script is based on code by
|
# run 'governor.sh powersave' or reboot. The script is based on code by
|
||||||
# Andy Polyakov, http://www.openssl.org/~appro/cryptogams/.
|
# 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
|
if [ "x$1" = "x" ]; then
|
||||||
echo "usage: $0 on[demand]|pe[rformance]|po[wersave]|us[erspace]?"
|
echo "usage: $0 on[demand]|pe[rformance]|po[wersave]|us[erspace]?"
|
||||||
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
|
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,12 @@ MAKE=make
|
||||||
DISASS=objdump
|
DISASS=objdump
|
||||||
DISASSARGS=("--disassemble")
|
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
|
# Fixup, Solaris and friends
|
||||||
if [[ (-d /usr/xpg4/bin) ]]; then
|
if [[ (-d /usr/xpg4/bin) ]]; then
|
||||||
SED=/usr/xpg4/bin/sed
|
SED=/usr/xpg4/bin/sed
|
||||||
|
|
|
||||||
6
test.cpp
6
test.cpp
|
|
@ -143,6 +143,12 @@ int scoped_main(int argc, char *argv[])
|
||||||
_CrtSetDbgFlag( tempflag );
|
_CrtSetDbgFlag( tempflag );
|
||||||
#endif
|
#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
|
try
|
||||||
{
|
{
|
||||||
RegisterFactories(All);
|
RegisterFactories(All);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue