Fixing the non-SQLite tests, the ones adopted from DB.

This commit is contained in:
Gregory Burd 2009-09-01 09:53:56 -04:00
parent f157b8d0e4
commit 62311bde64
14 changed files with 39 additions and 12 deletions

0
dist/pubdef.in vendored Normal file
View file

0
docs_src/m4/m4.links Normal file
View file

View file

@ -260,13 +260,13 @@ int pydbsql_statement_recompile(pydbsql_Statement* self, PyObject* params)
* version 3.2.2 or later. For older DBSQL releases, that might not * version 3.2.2 or later. For older DBSQL releases, that might not
* even define DBSQL_VERSION_NUMBER, we do it the manual way. * even define DBSQL_VERSION_NUMBER, we do it the manual way.
*/ */
#ifdef DBSQL_VERSION_NUMBER #ifdef DBSQL_VERSION_NUMBER
#if DBSQL_VERSION_NUMBER >= 3002002 #if DBSQL_VERSION_NUMBER >= 3002002
(void)dbsql_transfer_bindings(self->st, new_st); (void)dbsql_transfer_bindings(self->st, new_st);
#endif #endif
#else #else
statement_bind_parameters(self, params); statement_bind_parameters(self, params);
#endif #endif
(void)dbsql_finalize(self->st); (void)dbsql_finalize(self->st);
self->st = new_st; self->st = new_st;

View file

@ -2,14 +2,15 @@
# #
# Check to make sure that the code samples in the documents build. # Check to make sure that the code samples in the documents build.
d=../../../db_docs d=../../docs
b=../../build_unix
[ -d $d ] || { [ -d $d ] || {
echo 'FAIL: cannot find source distribution directory.' echo 'FAIL: cannot find source distribution directory.'
exit 1 exit 1
} }
[ -f ../libsqldb.a ] || (cd .. && make libsqldb.a) || { [ -f $b/libdbsql.a ] || (cd $b && make libdbsql.a) || {
echo 'FAIL: unable to find or build libsqldb.a' echo 'FAIL: unable to find or build libdbsql.a'
exit 1 exit 1
} }

View file

@ -15,8 +15,15 @@ f=$d/build_win32/libdb.def
t1=__1 t1=__1
t2=__2 t2=__2
trap 'rm -f $t1 $t2' 0 1 2 3 13 15
exitv=0 exitv=0
[ -f $f ] || {
echo 'FAIL: unable to find or build' $f
exit 1
}
sed '/; /d' $f | sed '/; /d' $f |
egrep @ | egrep @ |
awk '{print $1}' | awk '{print $1}' |

View file

@ -15,8 +15,9 @@ t1=__1
t2=__2 t2=__2
t3=__3 t3=__3
trap 'rm -f $t1 $t2 $t3' 0 1 2 3 13 15
find $d -name '*.c' -o -name '*.cpp' | find $d -name '*.c' -o -name '*.cpp' |
sed -e '/queue.h/d' |
xargs egrep '^[ ][ ]*#' > $t1 xargs egrep '^[ ][ ]*#' > $t1
test -s $t1 && { test -s $t1 && {
echo "FAIL: found #defines with leading white space:" echo "FAIL: found #defines with leading white space:"

View file

@ -9,11 +9,14 @@ d=../..
exit 1 exit 1
} }
trap 'rm -f t t.c' 0 1 2 3 13 15
cat << END_OF_CODE > t.c cat << END_OF_CODE > t.c
#include <sys/types.h> #include <sys/types.h>
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
int chk(FILE *, char *); int chk(FILE *, char *);

View file

@ -11,6 +11,8 @@ d=../..
t=__1 t=__1
trap 'rm -f $t1' 0 1 2 3 13 15
egrep -w off_t $d/*/*.[ch] $d/*/*.in | egrep -w off_t $d/*/*.[ch] $d/*/*.in |
sed -e "/_/d" > $t sed -e "/_/d" > $t

View file

@ -13,7 +13,10 @@ t1=__1
t2=__2 t2=__2
t3=__3 t3=__3
trap 'rm -f $t1 $t2 $t3' 0 1 2 3 13 15
egrep '__P' $d/src/inc/*.h | egrep '__P' $d/src/inc/*.h |
sed -e '/db_int.h/d' |
sed -e 's/[ ][ ]*__P.*//' \ sed -e 's/[ ][ ]*__P.*//' \
-e 's/^.*[ *]//' \ -e 's/^.*[ *]//' \
> $t1 > $t1

View file

@ -61,7 +61,7 @@ Check that pubdef.in has everything listed in dbsql.in.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
END_OF_TEXT END_OF_TEXT
f=$d/src/db.in f=$d/src/dbsql.in
sed -n \ sed -n \
-e 's/^#define[ ]*\(DBSQL_[A-Z_0-9][A-Z_0-9]*\).*/\1/p' \ -e 's/^#define[ ]*\(DBSQL_[A-Z_0-9][A-Z_0-9]*\).*/\1/p' \
-e 's/^[ ]*\(DBSQL_[A-Z_]*\)=[0-9].*/\1/p' \ -e 's/^[ ]*\(DBSQL_[A-Z_]*\)=[0-9].*/\1/p' \
@ -77,7 +77,7 @@ done
cat <<END_OF_TEXT cat <<END_OF_TEXT
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Check that db.in has everything listed in pubdef.in. Check that dbsql.in has everything listed in pubdef.in.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
END_OF_TEXT END_OF_TEXT

View file

@ -10,10 +10,14 @@ d=../..
exit 1 exit 1
} }
[ -d $d/build_win32 ] || exit 0
f=$d/dist/srcfiles.in f=$d/dist/srcfiles.in
t1=__1 t1=__1
t2=__2 t2=__2
trap 'rm -f $t1 $t2' 0 1 2 3 13 15
sed -e '/^[ #]/d' \ sed -e '/^[ #]/d' \
-e '/^$/d' < $f | -e '/^$/d' < $f |
awk '{print $1}' > $t1 awk '{print $1}' > $t1

View file

@ -11,6 +11,8 @@ d=../..
t1=__1 t1=__1
trap 'rm -f $t1' 0 1 2 3 13 15
sed -e '/^#include/d' \ sed -e '/^#include/d' \
-e '/"/!d' \ -e '/"/!d' \
-e 's/^[^"]*//' \ -e 's/^[^"]*//' \

View file

@ -13,6 +13,8 @@ d=../..
t1=__1 t1=__1
t2=__2 t2=__2
trap 'rm -f $t1 $t2' 0 1 2 3 13 15
(cd $d && ls -F | egrep / | sort | (cd $d && ls -F | egrep / | sort |
sed -e 's/\///' \ sed -e 's/\///' \
-e '/_\//d' \ -e '/_\//d' \

View file

@ -16,11 +16,13 @@ docs=$d/docs_src
exitv=0 exitv=0
t=__tmp t=__tmp
trap 'rm -f $t1 IGNORE' 0 1 2 3 13 15
# Extract the field names for a structure from the dbsql.h file. # Extract the field names for a structure from the dbsql.h file.
inc_fields() inc_fields()
{ {
sed -e "/struct $1 {/,/^};$/p" \ sed -e "/struct $1 {/,/^};$/p" \
-e d < $d/src/inc/dbsql.in | -e d < $d/src/dbsql.in |
sed -e 1d \ sed -e 1d \
-e '$d' \ -e '$d' \
-e '/;/!d' \ -e '/;/!d' \