test target

This commit is contained in:
anon 2024-05-30 14:28:51 +02:00
parent 2856f3f1d5
commit 9296b01d19

View File

@ -1,3 +1,5 @@
.PHONY: test
ifeq (${DEBUG}, 1)
LFLAGS += --debug --trace
YYFLAGS += --debug -Wall -Wcounterexamples
@ -26,6 +28,10 @@ GENSOURCE := $(addprefix object/,esql.tab.cpp esql.yy.cpp)
GENOBJECT := $(subst .cpp,.o,${GENSOURCE})
TEST.source := static_insert.sqc dynamic_insert.sqc
TEST.out := $(addprefix object/,$(addsuffix .out,${TEST.source}))
TEST.source := $(addprefix debug/,${TEST.source})
OUTPUT := esql
object/%.yy.cpp: source/%.l
@ -56,5 +62,15 @@ clean:
-rm object/*
-cd source/sqlfun/; make clean
test:
esql debug/static_insert.sqc
object/%.sqc.c: debug/%.sqc
bat $<
esql $< > $@
object/%.sqc.out: object/%.sqc.c
bat $<
${CC} $< -o $@ -lsqlite3
test.clean:
-rm object/*.sqc.*
test: test.clean ${TEST.out}