From 05a3203d8274a0a0999faad128f629614b8d62c5 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 26 Sep 2012 17:04:57 -0700 Subject: SH-3275 WIP Run viewer metrics for object update messages fixed various issues related to unit tests and LLThreadLocalPtr initialization and teardown --- indra/test/test.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'indra/test/test.cpp') diff --git a/indra/test/test.cpp b/indra/test/test.cpp index dc8580fe69..2b66c6aa26 100644 --- a/indra/test/test.cpp +++ b/indra/test/test.cpp @@ -512,15 +512,10 @@ int main(int argc, char **argv) ctype_workaround(); #endif - apr_initialize(); - apr_pool_t* pool = NULL; - if(APR_SUCCESS != apr_pool_create(&pool, NULL)) - { - std::cerr << "Unable to initialize pool" << std::endl; - return 1; - } + ll_init_apr(); + apr_getopt_t* os = NULL; - if(APR_SUCCESS != apr_getopt_init(&os, pool, argc, argv)) + if(APR_SUCCESS != apr_getopt_init(&os, gAPRPoolp, argc, argv)) { std::cerr << "apr_getopt_init() failed" << std::endl; return 1; @@ -602,7 +597,7 @@ int main(int argc, char **argv) if (LOGFAIL) { LLError::ELevel level = LLError::decodeLevel(LOGFAIL); - replayer.reset(new LLReplayLogReal(level, pool)); + replayer.reset(new LLReplayLogReal(level, gAPRPoolp)); } else { @@ -646,7 +641,7 @@ int main(int argc, char **argv) s.close(); } - apr_terminate(); + ll_cleanup_apr(); int retval = (success ? 0 : 1); return retval; -- cgit v1.2.3 From c136b432140f892a56d4996d5ed77e903ff0b32d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 15 Nov 2012 19:46:09 -0800 Subject: SH-3406 WIP convert fast timers to lltrace system eliminated min and max macros from windows.h got rest of viewer to compile against llfasttimer changes --- indra/test/test.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/test/test.cpp') diff --git a/indra/test/test.cpp b/indra/test/test.cpp index 2b66c6aa26..8bd302ce7a 100644 --- a/indra/test/test.cpp +++ b/indra/test/test.cpp @@ -40,6 +40,7 @@ #include "tests/wrapllerrs.h" // RecorderProxy #include "stringize.h" #include "namedtempfile.h" +#include "lltrace.h" #include "apr_pools.h" #include "apr_getopt.h" @@ -513,7 +514,8 @@ int main(int argc, char **argv) #endif ll_init_apr(); - + LLTrace::init(); + apr_getopt_t* os = NULL; if(APR_SUCCESS != apr_getopt_init(&os, gAPRPoolp, argc, argv)) { -- cgit v1.2.3 From 68413515029f50713c70e4adec3ce6fd1022d59f Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Sun, 6 Jan 2013 21:37:31 -0800 Subject: SH-3468 WIP add memory tracking base class fix for unit test failures...cleanup apr without destroying pools, allowing LLProxy to clean itself up as a singleton (and avoiding spurious dependencies associated with manually destorying singletons that rely on apr pools) --- indra/test/test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/test/test.cpp') diff --git a/indra/test/test.cpp b/indra/test/test.cpp index 8bd302ce7a..d75040393c 100644 --- a/indra/test/test.cpp +++ b/indra/test/test.cpp @@ -643,7 +643,7 @@ int main(int argc, char **argv) s.close(); } - ll_cleanup_apr(); + ll_cleanup_apr(false); int retval = (success ? 0 : 1); return retval; -- cgit v1.2.3 From 3c341a11ab7b8f3fd18afcf3f50af6dfafa632c2 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 8 Jan 2013 00:25:07 -0800 Subject: SH-3468 WIP add memory tracking base class more fixes for unit test crashes added llcommon initialization/teardown for unit tests that indirectly trigger lltrace changed access of atomic refcount to use preincrement/decrement operators to reflect desired semantics always call apr_initialize in LLCommon::initClass, even if already initialized...apr does internal reference counting to keep things straight --- indra/test/test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/test/test.cpp') diff --git a/indra/test/test.cpp b/indra/test/test.cpp index d75040393c..8bd302ce7a 100644 --- a/indra/test/test.cpp +++ b/indra/test/test.cpp @@ -643,7 +643,7 @@ int main(int argc, char **argv) s.close(); } - ll_cleanup_apr(false); + ll_cleanup_apr(); int retval = (success ? 0 : 1); return retval; -- cgit v1.2.3 From 0ba9a00c3116b69745f2d5070ce772d5d4965dbf Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 8 Jan 2013 23:50:27 -0800 Subject: SH-3468 WIP add memory tracking base class cleaned up hacks used to get unit tests working LLTrace::init now supports recursive initialization/cleanup put NOMINMAX back in win32 header wrappers --- indra/test/test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/test/test.cpp') diff --git a/indra/test/test.cpp b/indra/test/test.cpp index 8bd302ce7a..28de88201c 100644 --- a/indra/test/test.cpp +++ b/indra/test/test.cpp @@ -514,8 +514,8 @@ int main(int argc, char **argv) #endif ll_init_apr(); - LLTrace::init(); + LLTrace::init(); apr_getopt_t* os = NULL; if(APR_SUCCESS != apr_getopt_init(&os, gAPRPoolp, argc, argv)) { -- cgit v1.2.3 From 04bdc8ba83c297945dd60489c241b88adf892ff4 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 1 Jul 2013 17:04:01 -0700 Subject: SH-4294 FIX Interesting: Statistics Texture cache hit rate is always 0% also, removed LLTrace::init and cleanup removed derived class implementation of memory stat for LLMemTrackable is automatic now --- indra/test/test.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/test/test.cpp') diff --git a/indra/test/test.cpp b/indra/test/test.cpp index 28de88201c..10f71a2843 100755 --- a/indra/test/test.cpp +++ b/indra/test/test.cpp @@ -41,6 +41,7 @@ #include "stringize.h" #include "namedtempfile.h" #include "lltrace.h" +#include "lltracethreadrecorder.h" #include "apr_pools.h" #include "apr_getopt.h" @@ -483,6 +484,8 @@ void wouldHaveCrashed(const std::string& message) tut::fail("llerrs message: " + message); } +static LLTrace::ThreadRecorder* sMasterThreadRecorder = NULL; + int main(int argc, char **argv) { // The following line must be executed to initialize Google Mock @@ -515,7 +518,11 @@ int main(int argc, char **argv) ll_init_apr(); - LLTrace::init(); + if (!sMasterThreadRecorder) + { + sMasterThreadRecorder = new LLTrace::ThreadRecorder(); + LLTrace::set_master_thread_recorder(sMasterThreadRecorder); + } apr_getopt_t* os = NULL; if(APR_SUCCESS != apr_getopt_init(&os, gAPRPoolp, argc, argv)) { -- cgit v1.2.3