From 07c208dbc6d625487670f662f70dcfa6d84b0dd2 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sun, 14 Jul 2019 22:43:31 -0400 Subject: [PATCH] Filter out static_assert from Posix assert test --- TestScripts/cryptest.sh | 6 +++--- cryptest.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/TestScripts/cryptest.sh b/TestScripts/cryptest.sh index b79a6577..fef4289a 100755 --- a/TestScripts/cryptest.sh +++ b/TestScripts/cryptest.sh @@ -1054,15 +1054,15 @@ if true; then TEST_LIST+=("No Posix NDEBUG or assert") FAILED=0 - # Filter out C++ and Doxygen comments. + # Search for headers. Filter out C++ abd Doxygen comments. COUNT=$(cat ./*.h ./*.cpp | "$GREP" -v '//' | "$GREP" -c -E '(assert.h|cassert)') if [[ "$COUNT" -ne "0" ]]; then FAILED=1 echo "FAILED: found Posix assert headers" | tee -a "$TEST_RESULTS" fi - # Filter out C++ and Doxygen comments. - COUNT=$(cat ./*.h ./*.cpp | "$GREP" -v '//' | "$GREP" -c -E 'assert[[:space:]]*\(') + # Search for asserts. Filter out C++, Doxygen comments and static_assert. + COUNT=$(cat ./*.h ./*.cpp | "$GREP" -v -E '//|_assert' | "$GREP" -c -E 'assert[[:space:]]*\(') if [[ "$COUNT" -ne "0" ]]; then FAILED=1 echo "FAILED: found use of Posix assert" | tee -a "$TEST_RESULTS" diff --git a/cryptest.sh b/cryptest.sh index b79a6577..fef4289a 100755 --- a/cryptest.sh +++ b/cryptest.sh @@ -1054,15 +1054,15 @@ if true; then TEST_LIST+=("No Posix NDEBUG or assert") FAILED=0 - # Filter out C++ and Doxygen comments. + # Search for headers. Filter out C++ abd Doxygen comments. COUNT=$(cat ./*.h ./*.cpp | "$GREP" -v '//' | "$GREP" -c -E '(assert.h|cassert)') if [[ "$COUNT" -ne "0" ]]; then FAILED=1 echo "FAILED: found Posix assert headers" | tee -a "$TEST_RESULTS" fi - # Filter out C++ and Doxygen comments. - COUNT=$(cat ./*.h ./*.cpp | "$GREP" -v '//' | "$GREP" -c -E 'assert[[:space:]]*\(') + # Search for asserts. Filter out C++, Doxygen comments and static_assert. + COUNT=$(cat ./*.h ./*.cpp | "$GREP" -v -E '//|_assert' | "$GREP" -c -E 'assert[[:space:]]*\(') if [[ "$COUNT" -ne "0" ]]; then FAILED=1 echo "FAILED: found use of Posix assert" | tee -a "$TEST_RESULTS"