aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/run.sh
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-12-06 11:41:44 +0100
committerlemon <lsof@mailbox.org>2025-12-06 11:55:41 +0100
commitd82f3052c813f671561362126d0fbe08568542d3 (patch)
treed82546bdf7f62e3461906c49fa3f3715d13422a6 /test/run.sh
parent2054983775165f3ae50b241aae71ccb4969eade4 (diff)
add command-line predefined macros (-D, -U)
Diffstat (limited to 'test/run.sh')
-rwxr-xr-xtest/run.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/run.sh b/test/run.sh
index 5e0bc0f..34d8101 100755
--- a/test/run.sh
+++ b/test/run.sh
@@ -16,11 +16,12 @@ run() {
echo ---- $f ---- >> log.txt
mkdir -p build/
args=$(awk '/\/\* ARGS:.*$/ {ORS=" ";for (i=3;i<NF;++i)print $i;ORS="\n";print""}' "$f")
+ cflags=$(awk '/\/\* CFLAGS:.*$/ {ORS=" ";for (i=3;i<NF;++i)print $i;ORS="\n";print""}' "$f")
awk '/\/\* EXPECT:$/ {x=k=any=1} x && /\*\// {x=0} x {if (!k)print $0;k=0} END{if(x||!any)exit 1;}' "$f" > "$expected"
if [ $? == 0 ]; then
obj=build/"$(echo "$f" | sed -s 's/\.c$/.o/')"
exe=build/"$(echo "$f" | sed -s 's/\.c$//')"
- if ! ( x $ANTCC "$f" -c -o "$obj" && x $ANTCC "$obj" -o "$exe" ); then
+ if ! ( x $ANTCC $cflags "$f" -c -o "$obj" && x $ANTCC $cflags "$obj" -o "$exe" ); then
echo !TEST ERROR $f
echo !FAILED TO COMPILE
echo '-------'