diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-10-11 08:05:14 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-10-11 08:18:43 +0200 |
commit | 5c65e79edcbf220b0422151e08547ca796a44221 (patch) | |
tree | 8312a65c0603ff565c043c90f29c5171aad8e196 /tests | |
parent | 84e5cb9b3496527d43af974f2f89396d8145d743 (diff) |
tests: Add boilerplate to be able to have tests in libosmo-abis
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 42 | ||||
-rw-r--r-- | tests/testsuite.at | 12 |
2 files changed, 54 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 640f4ef..724285c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -28,3 +28,45 @@ ipa_proxy_test_SOURCES = ipa_proxy_test.c ipa_proxy_test_LDADD = $(top_builddir)/src/libosmoabis.la \ $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) \ $(LIBOSMOVTY_LIBS) + + +# boilerplate for the tests +# The `:;' works around a Bash 3.2 bug when the output is not writeable. +$(srcdir)/package.m4: $(top_srcdir)/configure.ac + :;{ \ + 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' + +EXTRA_DIST = testsuite.at $(srcdir)/package.m4 $(TESTSUITE) + +TESTSUITE = $(srcdir)/testsuite + +check-local: atconfig $(TESTSUITE) + $(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS) + +installcheck-local: atconfig $(TESTSUITE) + $(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' \ + $(TESTSUITEFLAGS) + +clean-local: + test ! -f '$(TESTSUITE)' || \ + $(SHELL) '$(TESTSUITE)' --clean + $(RM) -f atconfig + +AUTOM4TE = $(SHELL) $(top_srcdir)/missing --run autom4te +AUTOTEST = $(AUTOM4TE) --language=autotest +$(TESTSUITE): $(srcdir)/testsuite.at $(srcdir)/package.m4 + $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at + mv $@.tmp $@ diff --git a/tests/testsuite.at b/tests/testsuite.at new file mode 100644 index 0000000..1358534 --- /dev/null +++ b/tests/testsuite.at @@ -0,0 +1,12 @@ +AT_INIT +AT_BANNER([Regression tests.]) + +# Example for tests.. copy and uncomment. This creates a new category +# and test. It will copy the expected output to expout and then run +# the given test. The stdout will be compared with the expout to determine +# if the test was successfull. +# AT_SETUP([NAME]) +# AT_KEYWORDS([NAME]) +# cat $abs_srcdir/NAME/NAME_test.ok > expout +# AT_CHECK([$abs_top_builddir/tests/NAME/NAME_test], [], [expout]) +# AT_CLEANUP |