From a890e8851e16d75e72a3f1ca06e5f9ff41a0b7e9 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Mon, 4 Jul 2016 18:06:44 -0400 Subject: [PATCH] Add test for -std=gnu++03 --- cryptest.sh | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/cryptest.sh b/cryptest.sh index c28f80c7..6b04f892 100755 --- a/cryptest.sh +++ b/cryptest.sh @@ -227,6 +227,14 @@ if [[ (-z "$HAVE_CXX03") ]]; then fi fi +if [[ (-z "$HAVE_GNU03") ]]; then + HAVE_GNU03=0 + "$CXX" -DCRYPTOPP_ADHOC_MAIN -std=c++03 adhoc.cpp -o "$TMP/adhoc.exe" > /dev/null 2>&1 + if [[ "$?" -eq "0" ]]; then + HAVE_GNU03=1 + fi +fi + HAVE_O3=0 OPT_O3= "$CXX" -DCRYPTOPP_ADHOC_MAIN -O3 adhoc.cpp -o "$TMP/adhoc.exe" > /dev/null 2>&1 @@ -499,6 +507,7 @@ fi # C++03, C++11, C++14 and C++17 echo | tee -a "$TEST_RESULTS" echo "HAVE_CXX03: $HAVE_CXX03" | tee -a "$TEST_RESULTS" +echo "HAVE_GNU03: $HAVE_GNU03" | tee -a "$TEST_RESULTS" echo "HAVE_CXX11: $HAVE_CXX11" | tee -a "$TEST_RESULTS" echo "HAVE_GNU11: $HAVE_GNU11" | tee -a "$TEST_RESULTS" if [[ ("$HAVE_CXX14" -ne "0" || "$HAVE_CXX17" -ne "0" || "$HAVE_GNU14" -ne "0" || "$HAVE_GNU17" -ne "0") ]]; then @@ -961,6 +970,65 @@ if [[ "$HAVE_CXX03" -ne "0" ]]; then fi fi +############################################ +# gnu++03 debug and release build +if [[ "$HAVE_GNU03" -ne "0" ]]; then + + ############################################ + # Debug build + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: debug, gnu++03" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + rm -f adhoc.cpp > /dev/null 2>&1 + + export CXXFLAGS="$DEBUG_CXXFLAGS -std=gnu++03 ${RETAINED_CXXFLAGS[@]}" + "$MAKE" "${MAKEARGS[@]}" CXX="$CXX" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" + + if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then + echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS" + else + ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then + echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS" + fi + ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" + if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then + echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS" + fi + fi + + ############################################ + # Release build + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: release, gnu++03" | tee -a "$TEST_RESULTS" + echo + + unset CXXFLAGS + "$MAKE" clean > /dev/null 2>&1 + rm -f adhoc.cpp > /dev/null 2>&1 + + export CXXFLAGS="$RELEASE_CXXFLAGS -std=gnu++03 ${RETAINED_CXXFLAGS[@]}" + "$MAKE" "${MAKEARGS[@]}" CXX="$CXX" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" + + if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then + echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS" + else + ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then + echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS" + fi + ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" + if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then + echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS" + fi + fi +fi + ############################################ # c++11 debug and release build if [[ "$HAVE_CXX11" -ne "0" ]]; then