summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Collet <Cyan4973@users.noreply.github.com>2021-08-09 12:29:20 (GMT)
committerGitHub <noreply@github.com>2021-08-09 12:29:20 (GMT)
commit1a6e81310ec8311efcdeaa6a858f37e59b741750 (patch)
treec97de1b7b8beb5f2534ec5f72ddfe726f4ad585f
parenteb70459803b8ea1d879c011ed5c8f5d5c16d250b (diff)
parentb13108a5b695c254ea6e7e50d11821466f96e6ec (diff)
downloadlz4-1a6e81310ec8311efcdeaa6a858f37e59b741750.zip
lz4-1a6e81310ec8311efcdeaa6a858f37e59b741750.tar.gz
lz4-1a6e81310ec8311efcdeaa6a858f37e59b741750.tar.bz2
Merge pull request #1020 from servusdei2018/dev
ci: merge unicode lint to github actions and expand test coverage to ./tests/ directory
-rw-r--r--.github/workflows/ci.yml8
-rw-r--r--tests/unicode_lint.sh11
2 files changed, 18 insertions, 1 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5123f3c..84871c2 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -264,6 +264,7 @@ jobs:
# - valgrind
# - ubsan
# - asan
+# - unicode-lint
#
lz4-cppcheck:
name: make cppcheck
@@ -382,6 +383,13 @@ jobs:
- name: fuzzer
run: CC=clang MOREFLAGS=-fsanitize=address make V=1 -C tests clean test-fuzzer
+ unicode-lint:
+ name: lint unicode in ./lib/, ./tests/ and ./programs/
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2 # https://github.com/actions/checkout
+ - name: unicode lint
+ run: bash ./tests/unicode_lint.sh
###############################################################
diff --git a/tests/unicode_lint.sh b/tests/unicode_lint.sh
index 969fcc5..dc9f2c0 100644
--- a/tests/unicode_lint.sh
+++ b/tests/unicode_lint.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-# `unicode_lint.sh' determines whether source files under the ./lib/ and ./programs/ directories
+# `unicode_lint.sh' determines whether source files under the ./lib/, ./tests/ and ./programs/ directories
# contain Unicode characters, and fails if any do.
#
# See https://github.com/lz4/lz4/issues/1018
@@ -16,6 +16,15 @@ if [[ $result ]]; then
pass=false
fi
+# Scan ./tests/ for Unicode in source (*.c, *.h) files
+result=$(
+ find ./tests/ -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
result=$(
find ./programs/ -regex '.*\.\(c\|h\)$' -exec grep -P -n "[^\x00-\x7F]" {} \; -exec echo "{}: FAIL" \;