aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-07-28 16:45:54 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-07-30 21:24:26 +0200
commit4610f3d17473c4c2191598b3838c3e8f0098918e (patch)
treecf7477d3e64a8f13219d2e3f30eb5bbe1a7cf663
parentc0a6938d0ede31b7c94e74ad598efb952aa2a613 (diff)
tests: Move the RLCMACTest into the test directory and setup autotestzecke/misc/cleanups
-rw-r--r--.gitignore8
-rw-r--r--configure.ac1
-rw-r--r--src/Makefile.am11
-rw-r--r--tests/Makefile.am50
-rw-r--r--tests/rlcmac/RLCMACTest.cpp (renamed from src/RLCMACTest.cpp)4
-rw-r--r--tests/rlcmac/RLCMACTest.err0
-rw-r--r--tests/rlcmac/RLCMACTest.ok58
-rw-r--r--tests/testsuite.at10
8 files changed, 130 insertions, 12 deletions
diff --git a/.gitignore b/.gitignore
index 4f418d8..fec1b98 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,3 +27,11 @@ osmoappdesc.pyc
# binaries
src/osmo-pcu
src/osmo-pcu-remote
+
+# tests
+tests/atconfig
+tests/package.m4
+tests/rlcmac/.dirstamp
+tests/rlcmac/RLCMACTest
+tests/testsuite
+tests/testsuite.log
diff --git a/configure.ac b/configure.ac
index 58cbc35..3b2f380 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,6 +4,7 @@ AC_INIT([osmo-pcu],
[osmocom-pcu@lists.osmocom.org])
AM_INIT_AUTOMAKE([dist-bzip2])
+AC_CONFIG_TESTDIR(tests)
dnl kernel style compile messages
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
diff --git a/src/Makefile.am b/src/Makefile.am
index b20b0a9..38a4b3c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -50,12 +50,11 @@ libgprs_la_SOURCES += \
openbts_sock.cpp
endif
-noinst_PROGRAMS = \
- RLCMACTest
-
bin_PROGRAMS = \
osmo-pcu
+noinst_PROGRAMS =
+
if ENABLE_SYSMODSP
noinst_PROGRAMS += \
osmo-pcu-remote
@@ -75,12 +74,6 @@ noinst_HEADERS = \
sysmo_l1_if.h \
femtobts.h
-RLCMACTest_SOURCES = RLCMACTest.cpp
-RLCMACTest_LDADD = \
- libgprs.la \
- $(LIBOSMOCORE_LIBS) \
- $(COMMON_LA)
-
osmo_pcu_SOURCES = pcu_main.cpp
if ENABLE_SYSMODSP
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7581ea9..1faa5f4 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,5 +1,38 @@
+AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGB_CFLAGS) $(LIBOSMOGSM_CFLAGS) -I$(top_srcdir)/src/
+check_PROGRAMS = rlcmac/RLCMACTest
+rlcmac_RLCMACTest_SOURCES = rlcmac/RLCMACTest.cpp
+rlcmac_RLCMACTest_LDADD = \
+ $(top_builddir)/src/libgprs.la \
+ $(LIBOSMOCORE_LIBS) \
+ $(COMMON_LA)
+
+# 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) \
+ rlcmac/RLCMACTest.ok rlcmac/RLCMACTest.err
+
+DISTCLEANFILES = atconfig
+
+TESTSUITE = $(srcdir)/testsuite
# Python testing
if ENABLE_VTY_TESTS
@@ -12,5 +45,20 @@ python-tests: $(BUILT_SOURCES)
@echo "Not running python-based tests (determined at configure-time)"
endif
-check-local: $(BUILT_SOURCES)
+check-local: $(BUILT_SOURCES) $(TESTSUITE)
+ $(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS)
$(MAKE) $(AM_MAKEFLAGS) python-tests
+
+installcheck-local: atconfig $(TESTSUITE)
+ $(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' \
+ $(TESTSUITEFLAGS)
+
+clean-local:
+ test ! -f '$(TESTSUITE)' || \
+ $(SHELL) '$(TESTSUITE)' --clean
+
+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/src/RLCMACTest.cpp b/tests/rlcmac/RLCMACTest.cpp
index 843dc21..66bc53c 100644
--- a/src/RLCMACTest.cpp
+++ b/tests/rlcmac/RLCMACTest.cpp
@@ -54,8 +54,8 @@ void printSizeofRLCMAC()
cout << "sizeof RlcMacDownlink_t " << sizeof(RlcMacDownlink_t) << endl;
cout << "sizeof Packet_Access_Reject_t " << sizeof(Packet_Access_Reject_t) << endl;
- cout << "sizeof Packet_Cell_Change_Order_t " << sizeof(Packet_Cell_Change_Order_t) << endl;
- cout << "sizeof Packet_Downlink_Assignment_t " << sizeof(Packet_Downlink_Assignment_t) << endl;
+ cout << "sizeof Packet_Cell_Change_Order_t " << sizeof(Packet_Cell_Change_Order_t) << endl;
+ cout << "sizeof Packet_Downlink_Assignment_t " << sizeof(Packet_Downlink_Assignment_t) << endl;
cout << "sizeof Packet_Measurement_Order_Reduced_t " << sizeof(Packet_Measurement_Order_Reduced_t) << endl;
cout << "sizeof Packet_Neighbour_Cell_Data_t " << sizeof(Packet_Neighbour_Cell_Data_t) << endl;
cout << "sizeof Packet_Serving_Cell_Data_t " << sizeof(Packet_Serving_Cell_Data_t) << endl;
diff --git a/tests/rlcmac/RLCMACTest.err b/tests/rlcmac/RLCMACTest.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/rlcmac/RLCMACTest.err
diff --git a/tests/rlcmac/RLCMACTest.ok b/tests/rlcmac/RLCMACTest.ok
new file mode 100644
index 0000000..a931636
--- /dev/null
+++ b/tests/rlcmac/RLCMACTest.ok
@@ -0,0 +1,58 @@
+ DOWNLINK
+vector1 = 4e8250e3f1a81d882080b2b2b2b2b2b2b2b2b2b2b
+=========Start DECODE===========
++++++++++Finish DECODE++++++++++
+=========Start ENCODE=============
++++++++++Finish ENCODE+++++++++++
+vector1 = 4e8250e3f1a81d882080b2b2b2b2b2b2b2b2b2b2b
+vector2 = 4e8250e3f1a81d882080b2b2b2b2b2b2b2b2b2b2b
+vector1 == vector2 : TRUE
+vector1 = 4828247a6a074227210b2b2b2b2b2b2b2b2b2b2b2b
+=========Start DECODE===========
++++++++++Finish DECODE++++++++++
+=========Start ENCODE=============
++++++++++Finish ENCODE+++++++++++
+vector1 = 4828247a6a074227210b2b2b2b2b2b2b2b2b2b2b2b
+vector2 = 4828247a6a074227210b2b2b2b2b2b2b2b2b2b2b2b
+vector1 == vector2 : TRUE
+vector1 = 4724c040000000079eb2ac9402b2b2b2b2b2b
+=========Start DECODE===========
++++++++++Finish DECODE++++++++++
+=========Start ENCODE=============
++++++++++Finish ENCODE+++++++++++
+vector1 = 4724c040000000079eb2ac9402b2b2b2b2b2b
+vector2 = 4724c040000000079eb2ac9402b2b2b2b2b2b
+vector1 == vector2 : TRUE
+vector1 = 47283c367513ba33304242b2b2b2b2b2b2b2b2b2b2b2b
+=========Start DECODE===========
++++++++++Finish DECODE++++++++++
+=========Start ENCODE=============
++++++++++Finish ENCODE+++++++++++
+vector1 = 47283c367513ba33304242b2b2b2b2b2b2b2b2b2b2b2b
+vector2 = 47283c367513ba33304242b2b2b2b2b2b2b2b2b2b2b2b
+vector1 == vector2 : TRUE
+ UPLINK
+vector1 = 40e1e61d11f2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
+=========Start DECODE===========
++++++++++Finish DECODE++++++++++
+=========Start ENCODE=============
++++++++++Finish ENCODE+++++++++++
+vector1 = 40e1e61d11f2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
+vector2 = 40e1e61d11f2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
+vector1 == vector2 : TRUE
+vector1 = 40b802000000002480e0b2b2b2b2b2b2b2b2b
+=========Start DECODE===========
++++++++++Finish DECODE++++++++++
+=========Start ENCODE=============
++++++++++Finish ENCODE+++++++++++
+vector1 = 40b802000000002480e0b2b2b2b2b2b2b2b2b
+vector2 = 40b802000000002480e0b2b2b2b2b2b2b2b2b
+vector1 == vector2 : TRUE
+vector1 = 4016713dc09427ca2ae57ef90906aafc001f80222b
+=========Start DECODE===========
++++++++++Finish DECODE++++++++++
+=========Start ENCODE=============
++++++++++Finish ENCODE+++++++++++
+vector1 = 4016713dc09427ca2ae57ef90906aafc001f80222b
+vector2 = 4016713dc09427ca2ae57ef90906aafc001f80222b
+vector1 == vector2 : TRUE
diff --git a/tests/testsuite.at b/tests/testsuite.at
new file mode 100644
index 0000000..824c274
--- /dev/null
+++ b/tests/testsuite.at
@@ -0,0 +1,10 @@
+AT_INIT
+AT_BANNER([Regression tests])
+
+
+AT_SETUP([rlcmac])
+AT_KEYWORDS([rlcmac])
+cat $abs_srcdir/rlcmac/RLCMACTest.ok > expout
+cat $abs_srcdir/rlcmac/RLCMACTest.err > experr
+AT_CHECK([$abs_top_builddir/tests/rlcmac/RLCMACTest], [0], [expout], [experr])
+AT_CLEANUP