Added PowerPC multiarch tests to cryptest.sh

pull/75/head
Jeffrey Walton 2015-12-03 12:39:25 -05:00
parent 0059f486ad
commit ac5bc5729e
1 changed files with 61 additions and 26 deletions

View File

@ -14,7 +14,7 @@
# Set to suite your taste
TEST_RESULTS=cryptest-result.txt
BENCHMARK_RESULTS=cryptest-bench.txt
WARN_TEST_RESULTS=cryptest-warn.txt
WARN_RESULTS=cryptest-warn.txt
# Respect user's preferred flags, but filter the stuff we expliclty test
#if [ ! -z "CXXFLAGS" ]; then
@ -33,7 +33,8 @@ IS_LINUX=$(uname -s | grep -i -c linux)
IS_CYGWIN=$(uname -s | grep -i -c cygwin)
IS_MINGW=$(uname -s | grep -i -c mingw)
IS_OPENBSD=$(uname -s | grep -i -c openbsd)
IS_X86_OR_X64=$(uname -m | egrep -i -c "(i386|i586|i686|amd64|x86_64)")
IS_INTEL=$(uname -m | egrep -i -c "(i386|i586|i686|amd64|x86_64)")
IS_PPC=$(uname -m | egrep -i -c "(Power|PPC)")
# We need to use the C++ compiler to determine if c++11 is available. Otherwise
# a mis-detection occurs on Mac OS X 10.9 and above. Below, we use the same
@ -112,13 +113,21 @@ if [ "$HAVE_UBSAN" -eq "0" ] || [ "$HAVE_ASAN" -eq "0" ]; then
HAVE_ASAN=0
fi
# Set to 0 if you don't have Multiarch
if [ "$IS_X86_OR_X64" -ne "0" ]; then
# Set to 0 if you don't have Intel multiarch
HAVE_INTEL_MULTIARCH=0
if [ "$IS_DARWIN" -ne "0" ] && [ "$IS_INTEL" -ne "0" ]; then
$CXX -x c++ -arch i386 -arch x86_64 -c adhoc.cpp.proto -o $TMP/adhoc > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
HAVE_MULTIARCH=1
else
HAVE_MULTIARCH=0
HAVE_INTEL_MULTIARCH=1
fi
fi
# Set to 0 if you don't have PPC multiarch
HAVE_PPC_MULTIARCH=0
if [ "$IS_DARWIN" -ne "0" ] && [ "$IS_PPC" -ne "0" ]; then
$CXX -x c++ -arch ppc -arch ppc64 -c adhoc.cpp.proto -o $TMP/adhoc > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
HAVE_PPC_MULTIARCH=1
fi
fi
@ -139,8 +148,11 @@ if [ "$IS_DARWIN" -ne "0" ]; then
echo "IS_DARWIN: $IS_DARWIN"
unset MallocScribble MallocPreScribble MallocGuardEdges
fi
if [ "$HAVE_MULTIARCH" -ne "0" ]; then
echo "HAVE_MULTIARCH: $HAVE_MULTIARCH"
if [ "$HAVE_INTEL_MULTIARCH" -ne "0" ]; then
echo "HAVE_INTEL_MULTIARCH: $HAVE_INTEL_MULTIARCH"
fi
if [ "$HAVE_PPC_MULTIARCH" -ne "0" ]; then
echo "HAVE_PPC_MULTIARCH: $HAVE_PPC_MULTIARCH"
fi
if [ "$IS_LINUX" -ne "0" ]; then
echo "IS_LINUX: $IS_LINUX"
@ -156,11 +168,6 @@ echo "User CXXFLAGS: $CXXFLAGS"
echo "Retained CXXFLAGS: $ADD_CXXFLAGS"
echo "Compiler:" $($CXX --version | head -1)
TEST_BEGIN=$(date)
echo
echo "Start time: $TEST_BEGIN"
############################################
############################################
# Remove previous test results
@ -173,6 +180,13 @@ touch "$BENCHMARK_RESULTS"
rm -f "$WARN_RESULTS" > /dev/null 2>&1
touch "$WARN_RESULTS"
############################################
############################################
TEST_BEGIN=$(date)
echo
echo "Start time: $TEST_BEGIN"
############################################
# Basic debug build
echo
@ -626,11 +640,11 @@ if [ "$IS_DARWIN" -ne "0" ] && [ "$HAVE_CXX11" -ne "0" ]; then
fi
############################################
# Darwin, Multiarch, c++03
if [ "$IS_DARWIN" -ne "0" ] && [ "$IS_X86_OR_X64" -ne "0" ]; then
# Darwin, Intel multiarch, c++03
if [ "$IS_DARWIN" -ne "0" ] && [ "$IS_INTEL" -ne "0" ]; then
echo
echo "************************************" | tee -a "$TEST_RESULTS"
echo "Testing: Darwin, Multiarch, c++03" | tee -a "$TEST_RESULTS"
echo "Testing: Darwin, Intel multiarch, c++03" | tee -a "$TEST_RESULTS"
echo
unset CXXFLAGS
@ -647,11 +661,11 @@ if [ "$IS_DARWIN" -ne "0" ] && [ "$IS_X86_OR_X64" -ne "0" ]; then
fi
############################################
# Darwin, Multiarch, c++11
if [ "$IS_DARWIN" -ne "0" ] && [ "$IS_X86_OR_X64" -ne "0" ]; then
# Darwin, Intel multiarch, c++11
if [ "$IS_DARWIN" -ne "0" ] && [ "$IS_INTEL" -ne "0" ]; then
echo
echo "************************************" | tee -a "$TEST_RESULTS"
echo "Testing: Darwin, Multiarch, c++11" | tee -a "$TEST_RESULTS"
echo "Testing: Darwin, Intel multiarch, c++11" | tee -a "$TEST_RESULTS"
echo
unset CXXFLAGS
@ -667,6 +681,27 @@ if [ "$IS_DARWIN" -ne "0" ] && [ "$IS_X86_OR_X64" -ne "0" ]; then
arch -x86_64 ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
fi
############################################
# Darwin, PowerPC multiarch
if [ "$IS_DARWIN" -ne "0" ] && [ "$IS_PPC" -ne "0" ]; then
echo
echo "************************************" | tee -a "$TEST_RESULTS"
echo "Testing: Darwin, PowerPC multiarch" | tee -a "$TEST_RESULTS"
echo
unset CXXFLAGS
"$MAKE" clean > /dev/null 2>&1
export CXXFLAGS="-DNDEBUG -g2 -O2 -arch ppc -arch ppc64 $ADD_CXXFLAGS"
"$MAKE" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
echo "Running PPC version..."
arch -ppc ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
arch -ppc ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
echo "Running PPC64 version..."
arch -ppc64 ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
arch -ppc64 ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
fi
############################################
# Darwin, c++03, Malloc Guards
if [ "$IS_DARWIN" -ne "0" ] && [ "$HAVE_CXX03" -ne "0" ]; then
@ -834,26 +869,26 @@ if [ "$CXX" == "g++" ] && [ "$HAVE_CXX11" -ne "0" ]; then
############################################
# Basic debug build
echo
echo "************************************" | tee -a "$WARN_TEST_RESULTS"
echo "Testing: debug, c++11, elevated warnings" | tee -a "$WARN_TEST_RESULTS"
echo "************************************" | tee -a "$WARN_RESULTS"
echo "Testing: debug, c++11, elevated warnings" | tee -a "$WARN_RESULTS"
echo
unset CXXFLAGS
"$MAKE" clean > /dev/null 2>&1
export CXXFLAGS="-DDEBUG -g2 -O2 -std=c++11 -DCRYPTOPP_NO_BACKWARDS_COMPATIBILITY_562 -Wall -Wextra -Wno-unknown-pragmas -Wstrict-aliasing=3 -Wstrict-overflow -Waggressive-loop-optimizations"
"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$WARN_TEST_RESULTS"
"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$WARN_RESULTS"
############################################
# Basic release build
echo
echo "************************************" | tee -a "$WARN_TEST_RESULTS"
echo "Testing: release, c++11, elevated warnings" | tee -a "$WARN_TEST_RESULTS"
echo "************************************" | tee -a "$WARN_RESULTS"
echo "Testing: release, c++11, elevated warnings" | tee -a "$WARN_RESULTS"
echo
unset CXXFLAGS
"$MAKE" clean > /dev/null 2>&1
export CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++11 -DCRYPTOPP_NO_BACKWARDS_COMPATIBILITY_562 -Wall -Wextra -Wno-unknown-pragmas -Wstrict-aliasing=3 -Wstrict-overflow -Waggressive-loop-optimizations"
"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$WARN_TEST_RESULTS"
"$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$WARN_RESULTS"
fi
############################################