diff --git a/TestScripts/cryptest-autotools.sh b/TestScripts/cryptest-autotools.sh index f5c43c02..a4ca61b4 100755 --- a/TestScripts/cryptest-autotools.sh +++ b/TestScripts/cryptest-autotools.sh @@ -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 diff --git a/TestScripts/cryptest-cmake.sh b/TestScripts/cryptest-cmake.sh index c88ffe2d..4135faa1 100755 --- a/TestScripts/cryptest-cmake.sh +++ b/TestScripts/cryptest-cmake.sh @@ -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" diff --git a/TestScripts/cryptest-symbols.sh b/TestScripts/cryptest-symbols.sh index 2c077f13..c4d0154c 100755 --- a/TestScripts/cryptest-symbols.sh +++ b/TestScripts/cryptest-symbols.sh @@ -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 diff --git a/TestScripts/cryptest.sh b/TestScripts/cryptest.sh index 83a90340..fd8c530b 100755 --- a/TestScripts/cryptest.sh +++ b/TestScripts/cryptest.sh @@ -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 diff --git a/TestScripts/governor.sh b/TestScripts/governor.sh index 8271e3bf..982e1b89 100755 --- a/TestScripts/governor.sh +++ b/TestScripts/governor.sh @@ -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 diff --git a/cryptest.sh b/cryptest.sh index 83a90340..fd8c530b 100755 --- a/cryptest.sh +++ b/cryptest.sh @@ -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 diff --git a/test.cpp b/test.cpp index f7a2f6e6..0cac35be 100644 --- a/test.cpp +++ b/test.cpp @@ -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);