summaryrefslogtreecommitdiff
path: root/TestScripts
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2022-05-07 10:25:05 -0400
committerJeffrey Walton <noloader@gmail.com>2022-05-07 10:25:05 -0400
commite7cf389c1ce8953b11a9a5805b3edb990bcc57ee (patch)
tree43387bd16f7ea751e85f770be08adfb99a1590d9 /TestScripts
parent5208cca6178e8cf71e96cd8c6636887909f1a308 (diff)
downloadcryptopp-git-e7cf389c1ce8953b11a9a5805b3edb990bcc57ee.tar.gz
Add C++23 testing to cryptest.sh
Diffstat (limited to 'TestScripts')
-rwxr-xr-xTestScripts/cryptest.sh105
1 files changed, 97 insertions, 8 deletions
diff --git a/TestScripts/cryptest.sh b/TestScripts/cryptest.sh
index 1c47f308..1f715609 100755
--- a/TestScripts/cryptest.sh
+++ b/TestScripts/cryptest.sh
@@ -346,21 +346,22 @@ fi
mkdir -p "${TMPDIR}" &>/dev/null
rm -f "${TMPDIR}/test.exe" &>/dev/null
-if [[ (-z "$HAVE_CXX17") ]]; then
- HAVE_CXX17=0
+
+if [[ (-z "$HAVE_CXX23") ]]; then
+ HAVE_CXX23=0
rm -f "${TMPDIR}/test.exe" &>/dev/null
- "${CXX}" -std=c++17 "${test_prog}" -o "${TMPDIR}/test.exe" &>/dev/null
+ "${CXX}" -std=c++23 "${test_prog}" -o "${TMPDIR}/test.exe" &>/dev/null
if [[ "$?" -eq 0 ]]; then
- HAVE_CXX17=1
+ HAVE_CXX23=1
fi
fi
rm -f "${TMPDIR}/test.exe" &>/dev/null
-if [[ (-z "$HAVE_GNU17") ]]; then
- HAVE_GNU17=0
- "${CXX}" -std=gnu++17 "${test_prog}" -o "${TMPDIR}/test.exe" &>/dev/null
+if [[ (-z "$HAVE_GNU23") ]]; then
+ HAVE_GNU23=0
+ "${CXX}" -std=gnu++23 "${test_prog}" -o "${TMPDIR}/test.exe" &>/dev/null
if [[ "$?" -eq 0 ]]; then
- HAVE_GNU17=1
+ HAVE_GNU23=1
fi
fi
@@ -384,6 +385,25 @@ if [[ (-z "$HAVE_GNU20") ]]; then
fi
rm -f "${TMPDIR}/test.exe" &>/dev/null
+if [[ (-z "$HAVE_CXX17") ]]; then
+ HAVE_CXX17=0
+ rm -f "${TMPDIR}/test.exe" &>/dev/null
+ "${CXX}" -std=c++17 "${test_prog}" -o "${TMPDIR}/test.exe" &>/dev/null
+ if [[ "$?" -eq 0 ]]; then
+ HAVE_CXX17=1
+ fi
+fi
+
+rm -f "${TMPDIR}/test.exe" &>/dev/null
+if [[ (-z "$HAVE_GNU17") ]]; then
+ HAVE_GNU17=0
+ "${CXX}" -std=gnu++17 "${test_prog}" -o "${TMPDIR}/test.exe" &>/dev/null
+ if [[ "$?" -eq 0 ]]; then
+ HAVE_GNU17=1
+ fi
+fi
+
+rm -f "${TMPDIR}/test.exe" &>/dev/null
if [[ (-z "$HAVE_CXX14") ]]; then
HAVE_CXX14=0
"${CXX}" -std=c++14 "${test_prog}" -o "${TMPDIR}/test.exe" &>/dev/null
@@ -991,6 +1011,8 @@ echo "HAVE_CXX17: $HAVE_CXX17" | tee -a "$TEST_RESULTS"
echo "HAVE_GNU17: $HAVE_GNU17" | tee -a "$TEST_RESULTS"
echo "HAVE_CXX20: $HAVE_CXX20" | tee -a "$TEST_RESULTS"
echo "HAVE_GNU20: $HAVE_GNU20" | tee -a "$TEST_RESULTS"
+echo "HAVE_CXX23: $HAVE_CXX20" | tee -a "$TEST_RESULTS"
+echo "HAVE_GNU23: $HAVE_GNU20" | tee -a "$TEST_RESULTS"
if [[ "$HAVE_LDGOLD" -ne 0 ]]; then
echo "HAVE_LDGOLD: $HAVE_LDGOLD" | tee -a "$TEST_RESULTS"
@@ -3651,6 +3673,73 @@ if [[ "$HAVE_GNU20" -ne 0 ]]; then
fi
############################################
+# gnu++23 debug and release build
+if [[ "$HAVE_GNU23" -ne 0 ]]; then
+
+ ############################################
+ # Debug build
+ echo
+ echo "************************************" | tee -a "$TEST_RESULTS"
+ echo "Testing: Debug, gnu++23" | tee -a "$TEST_RESULTS"
+ echo
+
+ TEST_LIST+=("Debug, gnu++23")
+
+ "$MAKE" clean &>/dev/null
+ rm -f "${TMPDIR}/test.exe" &>/dev/null
+
+ CXXFLAGS="$DEBUG_CXXFLAGS -std=gnu++23 $USER_CXXFLAGS"
+ CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" "$MAKE" "${MAKEARGS[@]}" 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"
+ FAILED_LIST+=("Debug, gnu++23")
+ 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"
+ FAILED_LIST+=("Debug, gnu++23")
+ 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"
+ FAILED_LIST+=("Debug, gnu++23")
+ fi
+ fi
+
+ ############################################
+ # Release build
+ echo
+ echo "************************************" | tee -a "$TEST_RESULTS"
+ echo "Testing: Release, gnu++23" | tee -a "$TEST_RESULTS"
+ echo
+
+ TEST_LIST+=("Release, gnu++23")
+
+ "$MAKE" clean &>/dev/null
+ rm -f "${TMPDIR}/test.exe" &>/dev/null
+
+ CXXFLAGS="$RELEASE_CXXFLAGS -std=gnu++23 $USER_CXXFLAGS"
+ CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" "$MAKE" "${MAKEARGS[@]}" 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"
+ FAILED_LIST+=("Release, gnu++23")
+ 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"
+ FAILED_LIST+=("Release, gnu++23")
+ 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"
+ FAILED_LIST+=("Release, gnu++23")
+ fi
+ fi
+fi
+
+############################################
# X32 debug and release build
if [[ "$HAVE_X32" -ne 0 ]]; then