aboutsummaryrefslogtreecommitdiff
path: root/test/run-tests
blob: f4c872b7b597e8283e1c563cf6640830514a080a (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
34
#!/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 . -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 {} \;