aboutsummaryrefslogtreecommitdiff
path: root/test/run-tests
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-04-22 21:27:07 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-04-22 21:27:07 +0200
commiteda8550f79f7f836a78f5909f1dccc008511d4f8 (patch)
treee2f801d7489a6eebeae92fef7b6b95c504668e44 /test/run-tests
parentc0a983a29af17415ef29058d72f1a9cd99ddd83f (diff)
Add a test for word breaking
Diffstat (limited to 'test/run-tests')
-rwxr-xr-xtest/run-tests33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/run-tests b/test/run-tests
new file mode 100755
index 0000000..e19b611
--- /dev/null
+++ b/test/run-tests
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+set -e
+cd "${0%/*}"
+
+readonly FLAGS='
+ -std=c23 -I../include
+ -Og -ggdb3
+ -Wall -Wextra -Wpedantic
+ -Wno-pointer-sign
+ -Wno-attributes
+'
+
+(cd ..; ./make)
+
+./gen-test-data
+
+for src in *.c
+do
+ dst="${src%.*}"
+ gcc $FLAGS -o "$dst" "$src" ../libmlib.a
+done
+
+s="$(find . -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 {} \;