aboutsummaryrefslogtreecommitdiff
path: root/tests/Makefile.am
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2014-11-11 21:11:37 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2014-11-12 00:10:27 +0200
commit5d91de768f4a5f75f6b663e7d80c94f47e45de23 (patch)
tree8d07950953625faa8c9852379c071c7ea454b8c9 /tests/Makefile.am
parent55e620d377854d7416ee63d8e2d91905e78b421b (diff)
downloadvmod-dbrw-5d91de768f4a5f75f6b663e7d80c94f47e45de23.tar.gz
vmod-dbrw-5d91de768f4a5f75f6b663e7d80c94f47e45de23.tar.bz2
Add test suite.
* Makefile.am: Add tests subdir * configure.ac: Initialize testsuite. (DBRW_TEST_PARAMS,DBRW_TEST_SERVER) (DBRW_TEST_NAME,DBRW_TEST_USER) (DBRW_TEST_PASS,DBRW_TEST_DEBUG): New variables. * src/Makefile.am (noinst_LTLIBRARIES): New library libsql.la * src/dbrw.h (dbrw_backend_select): New proto. * src/be.c: New file. * src/mysql.c (check_errno): Add default clause. * src/vmod_dbrw.c (expand_backref): Fix memory deallocation error. (dbrw_sethdr): New function. (findmatch): Use dbrw_sethdr to set X-VMOD-DBRW-Status * tests/.gitignore: New file. * tests/initdb.c: New file. * tests/Makefile.am: New file. * tests/atlocal.in: New file. * tests/exact01.at: New file. * tests/initdb.at: New file. * tests/rewrite01.at: New file. * tests/rewrite02.at: New file. * tests/rewrite03.at: New file. * tests/rewrite04.at: New file. * tests/rewrite05.at: New file. * tests/rewrite06.at: New file. * tests/testsuite.at: New file.
Diffstat (limited to 'tests/Makefile.am')
-rw-r--r--tests/Makefile.am82
1 files changed, 82 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..1d0094e
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,82 @@
+# This file is part of vmod-dbrw
+# Copyright (C) 2013-2014 Sergey Poznyakoff
+#
+# Vmod-dbrw is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# Vmod-dbrw is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with vmod-dbrw. If not, see <http://www.gnu.org/licenses/>.
+
+EXTRA_DIST = $(TESTSUITE_AT) testsuite package.m4
+DISTCLEANFILES = atconfig $(check_SCRIPTS)
+MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE)
+
+
+## ------------ ##
+## package.m4. ##
+## ------------ ##
+
+$(srcdir)/package.m4: $(top_srcdir)/configure.ac
+ $(AM_V_GEN){ \
+ echo '# Signature of the current package.'; \
+ echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
+ echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
+ echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
+ echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
+ echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
+ } >$(srcdir)/package.m4
+
+#
+
+## ------------ ##
+## Test suite. ##
+## ------------ ##
+
+TESTSUITE_AT = \
+ exact01.at\
+ initdb.at\
+ rewrite01.at\
+ rewrite02.at\
+ rewrite03.at\
+ rewrite04.at\
+ rewrite05.at\
+ rewrite06.at\
+ testsuite.at
+
+TESTSUITE = $(srcdir)/testsuite
+M4=m4
+
+AUTOTEST = $(AUTOM4TE) --language=autotest
+$(TESTSUITE): package.m4 $(TESTSUITE_AT)
+ $(AUTOTEST) -I $(srcdir) testsuite.at -o $@.tmp
+ mv $@.tmp $@
+
+atconfig: $(top_builddir)/config.status
+ cd $(top_builddir) && ./config.status tests/$@
+
+clean-local:
+ test ! -f $(TESTSUITE) || $(SHELL) $(TESTSUITE) --clean
+
+check-local: atconfig atlocal $(TESTSUITE)
+ $(SHELL) $(TESTSUITE)
+
+# Run the test suite on the *installed* tree.
+#installcheck-local:
+# $(SHELL) $(TESTSUITE) AUTOTEST_PATH=$(exec_prefix)/bin
+
+
+check_PROGRAMS = initdb
+initdb_SOURCES = initdb.c
+initdb_LDADD = ../src/libsql.la
+initdb_CFLAGS = $(AM_CFLAGS)
+AM_CPPFLAGS = -I$(top_srcdir)/src
+
+
+

Return to:

Send suggestions and report system problems to the System administrator.