From 57ed27f46ef2870c2d692d82ec7d4fcb759bfba9 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Mon, 9 Aug 2021 05:33:20 -0700 Subject: minor documentation for unicode_lint --- tests/unicode_lint.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/unicode_lint.sh b/tests/unicode_lint.sh index dc9f2c0..cd65d2d 100644 --- a/tests/unicode_lint.sh +++ b/tests/unicode_lint.sh @@ -5,9 +5,11 @@ # # See https://github.com/lz4/lz4/issues/1018 +echo "Ensure no unicode character is present in source files *.{c,h}" pass=true # Scan ./lib/ for Unicode in source (*.c, *.h) files +echo "Scanning lib/" result=$( find ./lib/ -regex '.*\.\(c\|h\)$' -exec grep -P -n "[^\x00-\x7F]" {} \; -exec echo "{}: FAIL" \; ) @@ -16,18 +18,20 @@ if [[ $result ]]; then pass=false fi -# Scan ./tests/ for Unicode in source (*.c, *.h) files +# Scan ./programs/ for Unicode in source (*.c, *.h) files +echo "Scanning programs/" result=$( - find ./tests/ -regex '.*\.\(c\|h\)$' -exec grep -P -n "[^\x00-\x7F]" {} \; -exec echo "{}: FAIL" \; + find ./programs/ -regex '.*\.\(c\|h\)$' -exec grep -P -n "[^\x00-\x7F]" {} \; -exec echo "{}: FAIL" \; ) if [[ $result ]]; then echo "$result" pass=false fi -# Scan ./programs/ for Unicode in source (*.c, *.h) files +# Scan ./tests/ for Unicode in source (*.c, *.h) files +echo "Scanning tests/" result=$( - find ./programs/ -regex '.*\.\(c\|h\)$' -exec grep -P -n "[^\x00-\x7F]" {} \; -exec echo "{}: FAIL" \; + find ./tests/ -regex '.*\.\(c\|h\)$' -exec grep -P -n "[^\x00-\x7F]" {} \; -exec echo "{}: FAIL" \; ) if [[ $result ]]; then echo "$result" @@ -35,7 +39,7 @@ if [[ $result ]]; then fi if [ "$pass" = true ]; then - echo "All tests successful." + echo "All tests successful: no unicode character detected" echo "Result: PASS" exit 0 else -- cgit v0.12