diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-05-04 01:10:47 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-05-04 01:10:47 +0200 |
commit | 250a3031b25530ccf172c67772d861095dac8022 (patch) | |
tree | d8e7d7538fdbe03c17c061d95fe7cddac1dc4b05 /test/run-tests | |
parent | 80547771dec846193f8ed963e93290baeae6fa5d (diff) |
Inline gen-test-data
Diffstat (limited to 'test/run-tests')
-rwxr-xr-x | test/run-tests | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/test/run-tests b/test/run-tests index f4c872b..1d6cf56 100755 --- a/test/run-tests +++ b/test/run-tests @@ -3,6 +3,13 @@ set -e cd "${0%/*}" +download() +{ + s="$(basename "$1" .txt)" + test -f "data/$s" || + wget -q "https://www.unicode.org/Public/15.1.0/ucd/$1" -O "data/$s" +} + readonly FLAGS=' -std=c23 -I../include -Og -ggdb3 @@ -13,22 +20,24 @@ readonly FLAGS=' (cd ..; ./make) -./gen-test-data +download 'auxiliary/GraphemeBreakTest.txt' +download 'auxiliary/WordBreakTest.txt' + +grep '^[^#]' data/LowercaseTest >lower.in +grep '^[^#]' data/UppercaseTest >upper.in +sed -En 's/\s+//g; s/÷?#.*//g; /./p' data/GraphemeBreakTest >gnext.in +sed -En 's/\s+//g; s/÷?#.*//g; /./p' data/WordBreakTest >wnext.in for src in *.c do - dst="${src%.*}" - gcc $FLAGS -o "$dst" "$src" ../libmlib.a + gcc $FLAGS -o "${src%.*}" "$src" ../libmlib.a done -s="$(find . -maxdepth 1 \ - -type f -executable \ - -not -name gen-test-data \ - -not -name run-tests \ - -exec echo rm "*.in" {} +)" -trap "$s" EXIT - -find . -type f -executable \ - -not -name gen-test-data \ - -not -name run-tests \ - -exec {} \; +trap "$( + find . -maxdepth 1 \ + -type f -executable \ + -not -name run-tests \ + -exec echo rm "*.in" {} + +)" EXIT + +find . -type f -executable -not -name run-tests -exec {} \; |