#!/bin/sh 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 -O0 -g -ggdb3 -Wall -Wextra -Wpedantic -Wno-pointer-sign -Wno-attributes -fsanitize=address,undefined ' (cd ..; ./make) download 'auxiliary/GraphemeBreakTest.txt' download 'auxiliary/WordBreakTest.txt' download 'NormalizationTest.txt' grep '^[^#]' data/CasefoldTest >casefold.in grep '^[^#]' data/LowercaseTest >lower.in grep '^[^#]' data/TitlecaseTest >title.in grep '^[^#]' data/UppercaseTest >upper.in grep '^[^#]' data/WordHumanBreakTest >wbrk-human.in sed -En 's/\s+//g; s/÷?#.*//g; /./p' data/GraphemeBreakTest >gbrk.in sed -En 's/\s+//g; s/÷?#.*//g; /./p' data/WordBreakTest >wbrk.in sed -En 's/(#|^@).*//; s/\s+$//; /./p' data/NormalizationTest >norm.in for src in *.c do cc $FLAGS -o "${src%.*}" "$src" ../libmlib.a done 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 {} \;