#!/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 -Og -ggdb3 -Wall -Wextra -Wpedantic -Wno-pointer-sign -Wno-attributes ' (cd ..; ./make) download 'auxiliary/GraphemeBreakTest.txt' download 'auxiliary/WordBreakTest.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 for src in *.c do gcc $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 {} \;