aboutsummaryrefslogtreecommitdiff
path: root/test/run-tests
blob: e19b611968b7ab2c9e0026a5902d6801df46309c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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 {} \;