summaryrefslogtreecommitdiff
path: root/utils/Makefile
diff options
context:
space:
mode:
authorDavid M. Lee <dlee@digium.com>2012-11-16 00:08:00 +0000
committerDavid M. Lee <dlee@digium.com>2012-11-16 00:08:00 +0000
commit752ffc69d4280af591f15a1d6f6310da0dddd5ef (patch)
tree1ddcdb7481fb00bf6cdddce4a27aa8fc68caa7ca /utils/Makefile
parent7ec134a8d706203e3426ad1d781394798e2929c9 (diff)
Migrate hashtest/hashtest2 to be unit tests.
Both hashtest and hashtest2 are manual testing apps that thrash hash tables (hashtab and ao2 containers, respectively), by spinning up several threads that randomly insert, delete, lookup and iterate over the hash table. If the app doesn't crash, the hash table probably passes the test. Those utils are not a part of the typical Asterisk build, so they do not usually get compiled. This all makes them less that useful. This patch removes those manual test programs and replaces them with Asterisk unit test modules (test_{hashtab,astobj2}_thrash.so). It also attempts to make the tests more deterministic. * Rather than spinning up some number of threads that operate on the hash table randomly, spin up four threads that concurrenly add, remove, lookup and iterate over the hash table. * Each thread checks the state of the hash table both during and after execution, and indicates a test failure if things are not as expected. * Each thread times out after 60 seconds to prevent deadlocking the unit test run. (closes issue ASTERISK-20505) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2189/ ........ Merged revisions 376306 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 376315 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 376339 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376341 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'utils/Makefile')
-rw-r--r--utils/Makefile7
1 files changed, 1 insertions, 6 deletions
diff --git a/utils/Makefile b/utils/Makefile
index aff39ce78..4bd898ce7 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -88,7 +88,7 @@ clean:
rm -f *.s *.i
rm -f md5.c strcompat.c ast_expr2.c ast_expr2.h ast_expr2f.c pbx_ael.c pval.c hashtab.c lock.c
rm -f aelparse.c aelbison.c conf2ael
- rm -f utils.c strings.c threadstorage.c sha1.c astobj2.c hashtest2 hashtest refcounter
+ rm -f utils.c strings.c threadstorage.c sha1.c astobj2.c refcounter
rm -f db1-ast/.*.d
@$(MAKE) -C db1-ast clean
@@ -175,11 +175,6 @@ threadstorage.c: $(ASTTOPDIR)/main/threadstorage.c
$(ECHO_PREFIX) echo " [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
$(CMD_PREFIX) cp "$<" "$@"
-hashtest2.o: _ASTCFLAGS+=-O0
-hashtest2: hashtest2.o md5.o lock.o utils.o strings.o astobj2.o sha1.o strcompat.o threadstorage.o clicompat.o poll.o
-
-hashtest: hashtest.o md5.o hashtab.o lock.o utils.o strings.o sha1.o strcompat.o threadstorage.o clicompat.o poll.o
-hashtest.o: _ASTCFLAGS+=-O0
refcounter: refcounter.o md5.o hashtab.o lock.o utils.o strings.o sha1.o strcompat.o threadstorage.o clicompat.o poll.o
refcounter.o: _ASTCFLAGS+=-O0