mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-11-02 13:03:33 +00:00
* It is a trie. The max depth of the trie is the length of the longest prefix. The lookup is O(lookuped_prefix), but as the prefix length is limited, the lookup time is constant. * Each node can hold the entire prefix, has place for the rewrite rule with up to three digits. * A trie with 20k entries will take about 3MB ram. * Filling the trie 100 times takes ~800ms on my i7 laptop * 10.000.000 lookups take 315ms.. (for the same prefix). * 93/99 lines are tested, 6/6 functions are tested, 49 of 54 branches are tested. Only memory allocation failures are not covered * A late addition is to handle the '+' sign and to increase the number of chars in the rewrite prefix. The timing/line coverage has not been updated after this change.
62 lines
2.0 KiB
Makefile
62 lines
2.0 KiB
Makefile
SUBDIRS = gsm0408 db channel mgcp gprs si abis
|
|
|
|
if BUILD_NAT
|
|
SUBDIRS += bsc-nat bsc-nat-trie
|
|
endif
|
|
|
|
if BUILD_SMPP
|
|
SUBDIRS += smpp
|
|
endif
|
|
|
|
|
|
# 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) vty_test_runner.py
|
|
TESTSUITE = $(srcdir)/testsuite
|
|
DISTCLEANFILES = atconfig
|
|
|
|
if ENABLE_VTY_TESTS
|
|
python-tests: $(BUILT_SOURCES)
|
|
osmotestvty.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
|
|
osmotestconfig.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
|
|
$(PYTHON) $(srcdir)/vty_test_runner.py -w $(abs_top_builddir) -v
|
|
rm -f $(top_builddir)/hlr.sqlite3
|
|
else
|
|
python-tests: $(BUILT_SOURCES)
|
|
echo "Not running python-based tests (determined at configure-time)"
|
|
endif
|
|
|
|
check-local: atconfig $(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 $@
|