diff options
author | Jiyong <jiyong.min@samsung.com> | 2023-12-26 10:55:00 +0900 |
---|---|---|
committer | Jiyong <jiyong.min@samsung.com> | 2023-12-26 11:08:07 +0900 |
commit | 3b773d382e34fcfc7c8995d8bd681a6ef0529b02 (patch) | |
tree | 2dd316dd1fb388662a34065d3e15b2298384fbfe /bash_test.sh | |
parent | 7fa2aaed0a5c855460b77fb1fedcc01591ff6470 (diff) | |
download | libjxl-3b773d382e34fcfc7c8995d8bd681a6ef0529b02.tar.gz libjxl-3b773d382e34fcfc7c8995d8bd681a6ef0529b02.tar.bz2 libjxl-3b773d382e34fcfc7c8995d8bd681a6ef0529b02.zip |
Imported Upstream version 0.9.0upstream/0.9.0upstream
Change-Id: I60862786d19d92bb65425923bfeaa8ec236d8722
Diffstat (limited to 'bash_test.sh')
-rwxr-xr-x | bash_test.sh | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/bash_test.sh b/bash_test.sh index 675026a..9bd28f4 100755 --- a/bash_test.sh +++ b/bash_test.sh @@ -18,14 +18,11 @@ test_includes() { if [ ! -e "$f" ]; then continue fi - # Check that the public files (in lib/include/ directory) don't use the full - # path to the public header since users of the library will include the - # library as: #include "jxl/foobar.h". - if [[ "${f#lib/include/}" != "${f}" ]]; then - if grep -i -H -n -E '#include\s*[<"]lib/include/jxl' "$f" >&2; then - echo "Don't add \"include/\" to the include path of public headers." >&2 - ret=1 - fi + # Check that the full paths to the public headers are not used, since users + # of the library will include the library as: #include "jxl/foobar.h". + if grep -i -H -n -E '#include\s*[<"]lib/include/jxl' "$f" >&2; then + echo "Don't add \"include/\" to the include path of public headers." >&2 + ret=1 fi if [[ "${f#third_party/}" == "$f" ]]; then @@ -103,9 +100,15 @@ test_printf_size_t() { ret=1 fi + if grep -n -E '[^_]gtest\.h' \ + $(git ls-files | grep -E '(\.c|\.cc|\.cpp|\.h)$' | grep -v -F /testing.h); then + echo "Don't include gtest directly, instead include 'testing.h'. " >&2 + ret=1 + fi + if grep -n -E 'gmock\.h' \ - $(git ls-files | grep -E '(\.c|\.cc|\.cpp|\.h)$' | grep -v -F /test_utils.h); then - echo "Don't include gmock directly, instead include 'test_utils.h'. " >&2 + $(git ls-files | grep -E '(\.c|\.cc|\.cpp|\.h)$' | grep -v -F /testing.h); then + echo "Don't include gmock directly, instead include 'testing.h'. " >&2 ret=1 fi @@ -122,7 +125,7 @@ test_printf_size_t() { fi done - for f in $(git ls-files | grep -E "\.h$" | grep -v -E '(printf_macros\.h|test_utils\.h)' | + for f in $(git ls-files | grep -E "\.h$" | grep -v -E '(printf_macros\.h|testing\.h)' | xargs grep -n 'PRI[udx]S'); do # Having PRIuS / PRIdS in a header file means that printf_macros.h may # be included before a system header, in particular before gtest headers. |