diff options
| author | Pavel Raiskup <praiskup@redhat.com> | 2014-09-17 00:22:38 +0200 |
|---|---|---|
| committer | Pavel Raiskup <praiskup@redhat.com> | 2014-09-17 14:06:10 +0200 |
| commit | 093be6d640d01d7cd24a2d87f6901aa3b3cf4fc6 (patch) | |
| tree | 8e47e5610adb86691ddcb4f02d198eb4869af7b3 /tests | |
| parent | 6ff8c6247cf4dec81f5899b09995d25c957ad7d5 (diff) | |
| download | postgresql-setup-093be6d640d01d7cd24a2d87f6901aa3b3cf4fc6.tar.gz postgresql-setup-093be6d640d01d7cd24a2d87f6901aa3b3cf4fc6.tar.xz postgresql-setup-093be6d640d01d7cd24a2d87f6901aa3b3cf4fc6.zip | |
testsuite: configury & and add first test-case
This required little bit of generalization so I moved the SED_CALL
into configure.ac to have it available for tests/Makefile.am also.
The first testsuite just checks that no un-expanded @pattern@
exists in generated files.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/Makefile.am | 44 | ||||
| -rw-r--r-- | tests/atlocal.in | 1 | ||||
| -rw-r--r-- | tests/testsuite.at | 17 |
3 files changed, 62 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..1ec404d --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,44 @@ +EXTRA_DIST = testsuite.at \ + package.m4 \ + $(TESTSUITE) \ + atlocal.in + +$(srcdir)/package.m4: $(top_srcdir)/configure.ac + $(AM_V_GEN):;{ \ + echo '# Signature of the current package.' && \ + echo 'm4_define([AT_PACKAGE_NAME],' && \ + echo ' [$(PACKAGE_NAME)])' && \ + echo 'm4_define([AT_PACKAGE_TARNAME],' && \ + echo ' [$(PACKAGE_TARNAME)])' && \ + echo 'm4_define([AT_PACKAGE_VERSION],' && \ + echo ' [$(PACKAGE_VERSION)])' && \ + echo 'm4_define([AT_PACKAGE_STRING],' && \ + echo ' [$(PACKAGE_STRING)])' && \ + echo 'm4_define([AT_PACKAGE_BUGREPORT],' && \ + echo ' [$(PACKAGE_BUGREPORT)])'; \ + echo 'm4_define([AT_PACKAGE_URL],' && \ + echo ' [$(PACKAGE_URL)])'; \ + } >'$(srcdir)/package.m4' + +TESTSUITE = $(srcdir)/testsuite +CHECK_DEPS = atconfig atlocal $(TESTSUITE) $(TEST_GEN_FILES_LIST) + +atlocal: atlocal.in $(c_s) + $(INSTANTIATE) + +check-local: $(CHECK_DEPS) + $(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS) + +installcheck-local: $(CHECK_DEPS) + $(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' $(TESTSUITEFLAGS) + +clean-local: + test ! -f '$(TESTSUITE)' || \ + $(SHELL) '$(TESTSUITE)' --clean + +AUTOTEST = $(AUTOM4TE) --language=autotest + +$(TESTSUITE): $(srcdir)/testsuite.at $(srcdir)/package.m4 + $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at && \ + mv $@.tmp $@ + diff --git a/tests/atlocal.in b/tests/atlocal.in new file mode 100644 index 0000000..6015f6b --- /dev/null +++ b/tests/atlocal.in @@ -0,0 +1 @@ +TEST_GEN_FILES_LIST=@TEST_GEN_FILES_LIST@ diff --git a/tests/testsuite.at b/tests/testsuite.at new file mode 100644 index 0000000..9d18b29 --- /dev/null +++ b/tests/testsuite.at @@ -0,0 +1,17 @@ +AT_INIT +AT_COLOR_TESTS + +AT_SETUP([Check files are generated correctly]) +AT_CHECK([file_list=$top_srcdir/$at_testdir/$TEST_GEN_FILES_LIST +test -f "$file_list" || { echo "no such file '$file_list'" ; exit 1 ; } + +pattern='@[[a-zA-Z0-9_]]*@' + +while read file; do + file=${top_srcdir}/$file + grep $pattern $file && echo "file $file is incomplete" && exit 1 +done < $file_list + +exit 0 +]) +AT_CLEANUP |
