Browse Source

Add a test to ensure data/source files are not marked as executable.

master
Reece H. Dunn 5 years ago
parent
commit
02dc828ecb
3 changed files with 25 additions and 1 deletions
  1. 2
    0
      .gitignore
  2. 2
    1
      Makefile.am
  3. 21
    0
      tests/non-executable-files-with-executable-bit.test

+ 2
- 0
.gitignore View File

@@ -101,6 +101,7 @@ src/espeakedit
src/speak-ng

tests/*.test
tests/*.check
!tests/language-phonemes.test
!tests/language-pronunciation.test
!tests/language-numbers-cardinal.test
@@ -108,6 +109,7 @@ tests/*.test
!tests/language-replace.test
!tests/ssml.test
!tests/translate.test
!tests/non-executable-files-with-executable-bit.test

espeak-ng.pc


+ 2
- 1
Makefile.am View File

@@ -252,7 +252,8 @@ check: tests/encoding.check \
tests/language-replace.check \
tests/language-pronunciation.check \
tests/language-numbers-cardinal.check \
tests/language-numbers-ordinal.check
tests/language-numbers-ordinal.check \
tests/non-executable-files-with-executable-bit.check

##### fuzzer:


+ 21
- 0
tests/non-executable-files-with-executable-bit.test View File

@@ -0,0 +1,21 @@
#!/bin/sh

echo -n "testing files for executable bits that shouldn't be executable ... "

find * -executable -type f | \
grep -vE "compile|config\.(guess|status|sub)|configure|depcomp|install-sh|libtool|missing" | # Ignore autotools output \
grep -vE "*\.test|src(/\.libs)?/(e?speak-ng|.*\.so\..*)" | # Ignore built programs and libraries \
grep -vE "*.\.sh|tools/emoji" | # Ignore helper scripts \
grep -vE "src/ucd-tools/tools/(.*\.py|mkencodingtable)" | # Ignore ucd-tools helper scripts \
tee tests/non-executable-files-with-executable-bit.check > /dev/null

if [ -s tests/non-executable-files-with-executable-bit.check ] ; then
echo "found"
cat tests/non-executable-files-with-executable-bit.check
false
else
rm tests/non-executable-files-with-executable-bit.check
echo "none found"
true
fi


Loading…
Cancel
Save