Add simple test suite.
This commit is contained in:
parent
4e996af1b1
commit
379dc16c5e
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,6 +1,8 @@
|
||||
|
||||
*.o
|
||||
*.output
|
||||
*.log
|
||||
*.trs
|
||||
|
||||
Makefile
|
||||
Makefile.in
|
||||
|
@ -10,7 +10,9 @@ pkgconfig_DATA = libsqlpars.pc
|
||||
# TESTS = test/unitester
|
||||
|
||||
# noinst_PROGRAMS = $(TESTS)
|
||||
EXTRA_DIST=sql.y sql.l
|
||||
EXTRA_DIST = sql.y sql.l \
|
||||
test-ok.sh test-fail.sh \
|
||||
fail1.sql ok1.sql
|
||||
|
||||
sql_SOURCES = exec.c sql-parser.h
|
||||
nodist_sql_SOURCES = sql.c sql.tab.c sql.tab.h sql.lex.h
|
||||
@ -24,3 +26,5 @@ sql.tab.c sql.tab.h: sql.y Makefile
|
||||
sql.c sql.lex.h: sql.l Makefile
|
||||
${LEX} -o $@ $<
|
||||
|
||||
TESTS = test-ok.sh test-fail.sh
|
||||
|
||||
|
12
test-fail.sh
Executable file
12
test-fail.sh
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
for testfn in $srcdir/fail*.sql
|
||||
do
|
||||
cat $testfn | ./sql
|
||||
if [ $? -ne 1 ]
|
||||
then
|
||||
echo "Failed on $testfn"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
12
test-ok.sh
Executable file
12
test-ok.sh
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
for testfn in $srcdir/ok*.sql
|
||||
do
|
||||
cat $testfn | ./sql
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "Failed on $testfn"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user