From 5c778701d98c642ecff97d044cd1c0b8b862aba3 Mon Sep 17 00:00:00 2001 From: Aliaksey Kandratsenka Date: Sun, 12 Feb 2017 17:54:59 -0800 Subject: [PATCH] added tcmalloc minimal unittest with ASSERTs checked --- .gitignore | 2 ++ Makefile.am | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/.gitignore b/.gitignore index af098ff..d40845a 100644 --- a/.gitignore +++ b/.gitignore @@ -124,6 +124,8 @@ /stack_trace_table_test.exe /stacktrace_unittest /system_alloc_unittest +/tcm_min_asserts_unittest +/tcm_min_asserts_unittest.exe /tcmalloc_and_profiler_unittest /tcmalloc_both_unittest /tcmalloc_debug_unittest diff --git a/Makefile.am b/Makefile.am index c3c3a6a..0d4b9f1 100755 --- a/Makefile.am +++ b/Makefile.am @@ -553,6 +553,20 @@ tcmalloc_minimal_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS) tcmalloc_minimal_unittest_LDADD = $(LIBTCMALLOC_MINIMAL) \ liblogging.la $(PTHREAD_LIBS) +# lets make sure we exerice ASSERTs in at least in statically linked +# configuration +TESTS += tcm_min_asserts_unittest +tcm_min_asserts_unittest_SOURCES = src/tests/tcmalloc_unittest.cc \ + src/tests/testutil.h src/tests/testutil.cc \ + $(libtcmalloc_minimal_internal_la_SOURCES) \ + $(libtcmalloc_minimal_la_SOURCES) \ + $(TCMALLOC_UNITTEST_INCLUDES) +tcm_min_asserts_unittest_CXXFLAGS = -DNO_TCMALLOC_SAMPLES -DNO_HEAP_CHECK \ + $(PTHREAD_CFLAGS) $(AM_CXXFLAGS) $(NO_BUILTIN_CXXFLAGS) +tcm_min_asserts_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS) +tcm_min_asserts_unittest_LDADD = $(LIBSPINLOCK) libmaybe_threads.la \ + liblogging.la $(PTHREAD_LIBS) + TESTS += tcmalloc_minimal_large_unittest WINDOWS_PROJECTS += vsprojects/tcmalloc_minimal_large/tcmalloc_minimal_large_unittest.vcproj tcmalloc_minimal_large_unittest_SOURCES = src/tests/tcmalloc_large_unittest.cc @@ -1000,6 +1014,19 @@ tcmalloc_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS) # first linkline to make sure our malloc 'wins'. tcmalloc_unittest_LDADD = $(LIBTCMALLOC) liblogging.la $(PTHREAD_LIBS) +# # lets make sure we exerice ASSERTs in at least in statically linked +# # configuration +# TESTS += tcm_asserts_unittest +# tcm_asserts_unittest_SOURCES = src/tests/tcmalloc_unittest.cc \ +# src/tests/testutil.h src/tests/testutil.cc \ +# $(libtcmalloc_internal_la_SOURCES) \ +# $(libtcmalloc_la_SOURCES) \ +# $(TCMALLOC_UNITTEST_INCLUDES) +# tcm_asserts_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS) $(NO_BUILTIN_CXXFLAGS) +# tcm_asserts_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS) +# tcm_asserts_unittest_LDADD = $(LIBSPINLOCK) libmaybe_threads.la libstacktrace.la \ +# liblogging.la $(PTHREAD_LIBS) + # This makes sure it's safe to link in both tcmalloc and # tcmalloc_minimal. (One would never do this on purpose, but perhaps # by accident...) When we can compile libprofiler, we also link it in