Filter out static_assert from Posix assert test

pull/867/head
Jeffrey Walton 2019-07-14 22:43:31 -04:00
parent 769643bbe1
commit 07c208dbc6
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
2 changed files with 6 additions and 6 deletions

View File

@ -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"

View File

@ -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"