Commit 7bda4a43 authored by Pavel Vainerman's avatar Pavel Vainerman

(tests): предварительная реализация с использованием automake testsuite

parent ce100cdc
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
############################################################################ ############################################################################
FIRSTSUBDIRS=IDL FIRSTSUBDIRS=IDL
SUBDIRS=. src lib include Utilities extensions python docs SUBDIRS=. src lib include Utilities tests extensions python docs
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libUniSet2.pc pkgconfig_DATA = libUniSet2.pc
...@@ -17,3 +17,5 @@ clean-local: ...@@ -17,3 +17,5 @@ clean-local:
install-data-local: install-data-local:
$(MAKE) -C $(FIRSTSUBDIRS) -j1 install $(MAKE) -C $(FIRSTSUBDIRS) -j1 install
\ No newline at end of file
...@@ -12,14 +12,15 @@ AC_CONFIG_HEADER(uniset-config.h) ...@@ -12,14 +12,15 @@ AC_CONFIG_HEADER(uniset-config.h)
dnl Initialize maintainer mode dnl Initialize maintainer mode
AM_MAINTAINER_MODE AM_MAINTAINER_MODE
dnl Initialize test suite dnl Initialize test suite
AC_CONFIG_TESTDIR(tests)
#CATCH_TEST_ARGS="-s" #CATCH_TEST_ARGS="-s"
CATCH_TEST_ARGS= CATCH_TEST_ARGS=
AC_SUBST(CATCH_TEST_ARGS) AC_SUBST(CATCH_TEST_ARGS)
TESTS_ENVIRONMENT="CATCH_TEST_ARGS=\"${CATCH_TEST_ARGS}\" \$(top_builddir)/Utilities/scripts/catch-test-run.sh" CATCH_TESTS_ENVIRONMENT="CATCH_TEST_ARGS=\"$(CATCH_TEST_ARGS)\" \$(top_builddir)/Utilities/scripts/catch-test-run.sh"
AC_SUBST(TESTS_ENVIRONMENT) AC_SUBST(CATCH_TESTS_ENVIRONMENT)
dnl Checks for programs. dnl Checks for programs.
AC_PROG_INSTALL AC_PROG_INSTALL
......
SUBDIR=SMemoryTest SUBDIR=SMemoryTest
#noinst_PROGRAMS = tests tests_with_conf tests_with_sm #noinst_PROGRAMS = tests tests_with_conf tests_with_sm
check_PROGRAMS = tests tests_with_conf tests_with_sm check_PROGRAMS = tests tests_with_conf tests_with_sm
TESTS_ENVIRONMENT=$(CATCH_TESTS_ENVIRONMENT)
TESTS=tests tests_with_conf.sh tests_with_sm.sh TESTS=tests tests_with_conf.sh tests_with_sm.sh
tests_SOURCES = tests.cc digitalfilter.cc tests_SOURCES = tests.cc digitalfilter.cc
......
...@@ -4,10 +4,6 @@ ...@@ -4,10 +4,6 @@
check_PROGRAMS = tests tests_with_conf check_PROGRAMS = tests tests_with_conf
#TESTS_ENVIRONMENT = CATCH_TEST_ARGS="$(CATCH_TEST_ARGS)" ./test-run.sh
TESTS = tests tests_with_conf.sh
EXTRA_DIR=$(TESTS)
#umutex sscanf_hexthreadtst dlog #umutex sscanf_hexthreadtst dlog
tests_SOURCES = tests.cc passivetimer.cc hourglass.cc delaytimer.cc unixml.cc tests_SOURCES = tests.cc passivetimer.cc hourglass.cc delaytimer.cc unixml.cc
...@@ -37,8 +33,36 @@ tests_with_conf_CPPFLAGS = -I$(top_builddir)/include -I$(includedir)/Catch ...@@ -37,8 +33,36 @@ tests_with_conf_CPPFLAGS = -I$(top_builddir)/include -I$(includedir)/Catch
# dlog_CPPFLAGS = -I$(top_builddir)/include ${SIGC_CFLAGS} $(COMCPP_CFLAGS) # dlog_CPPFLAGS = -I$(top_builddir)/include ${SIGC_CFLAGS} $(COMCPP_CFLAGS)
# #
testdir=$(top_builddir)/tests # testdir=$(top_builddir)/tests
#check-local: tests tests_with_conf #check-local: tests tests_with_conf
# $(SHELL) $(testdir)/tests 2>/dev/null # $(SHELL) $(testdir)/tests 2>/dev/null
# $(SHELL) $(testdir)/tests_with_conf -- --confile $(testdir)/tests_with_conf.xml --prop-id2 -10 --ulog-no-debug 2>/dev/null # $(SHELL) $(testdir)/tests_with_conf -- --confile $(testdir)/tests_with_conf.xml --prop-id2 -10 --ulog-no-debug 2>/dev/null
# TESTS_ENVIRONMENT=$(CATCH_TESTS_ENVIRONMENT)
TESTS=tests tests_with_conf.sh
TESTSUITE_AT=testsuite.at
TESTSUITE=testsuite
EXTRA_DIR=package.m4 $(TESTS) $(TESTSUITE) $(TESTSUITE_AT)
testsuite: package.m4 $(TESTS) $(TESTSUITE_AT)
autom4te -l autotest $(TESTSUITE_AT) -o $@
clean-local:
rm -rf *.log
check-local: atconfig $(TESTSUITE) $(TESTS)
$(SHELL) $(TESTSUITE) $(TESTSUITEFLAGS)
package.m4: Makefile
:;{ \
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)])' && \
echo 'm4_define([AT_PACKAGE_URL], [$(PACKAGE_URL)])'; \
} > $@-t
mv $@-t $@
#!/bin/sh
[ -n "$3" ] && exit $3
cd $1
exec $2
exit 1
#!/bin/sh
SID=$1
[ -z "$SID" ] && SID=1
echo "check auto ID configuration..."
uniset-start.sh -f ./conftest --confile test.xml --prop-id2 -10
echo "check id from file configuration..."
uniset-start.sh -f ./conftest --confile testID.xml
#!/bin/sh #!/bin/sh
# '--' - нужен для отделения аоргументов catch, от наших.. # '--' - нужен для отделения аоргументов catch, от наших..
./tests_with_conf $* -- --confile tests_with_conf.xml --prop-id2 -10 --ulog-no-debug ./tests_with_conf $* -- --confile tests_with_conf.xml --prop-id2 -10 --ulog-no-debug && exit 0 || exit 1
m4_include(package.m4)
AT_COLOR_TESTS
AT_INIT([Uniset test suite])
AT_SETUP([Basic tests])
AT_CHECK([at-test-launch.sh $abs_top_builddir/$AUTOTEST_PATH tests 77],[0],[ignore],[ignore])
AT_CLEANUP
AT_SETUP([Tests with conf])
AT_CHECK([at-test-launch.sh $abs_top_builddir/$AUTOTEST_PATH tests_with_conf.sh],[0],[ignore],[ignore])
AT_CLEANUP
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment