summaryrefslogtreecommitdiff
path: root/indra/test/test.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2012-06-24 07:27:34 -0400
committerOz Linden <oz@lindenlab.com>2012-06-24 07:27:34 -0400
commitf92e7d30a8ae4b1017968c253bb90f5eb05e1725 (patch)
tree6fb402c32570e911b79e19c9a131b5e335b7ef18 /indra/test/test.cpp
parentfb1fa8434a1a84105f67e72fdf72d300be2951bb (diff)
Add logging during tests (debug level, to test-specific files)
Diffstat (limited to 'indra/test/test.cpp')
-rw-r--r--indra/test/test.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/indra/test/test.cpp b/indra/test/test.cpp
index e58e7293fb..abe8f4f77b 100644
--- a/indra/test/test.cpp
+++ b/indra/test/test.cpp
@@ -113,13 +113,16 @@ public:
virtual void run_started()
{
//std::cout << "run_started" << std::endl;
+ LL_INFOS("TestRunner")<<"Test Started"<< LL_ENDL;
}
virtual void group_started(const std::string& name) {
+ LL_INFOS("TestRunner")<<"Unit test group_started name=" << name << LL_ENDL;
*mStream << "Unit test group_started name=" << name << std::endl;
}
virtual void group_completed(const std::string& name) {
+ LL_INFOS("TestRunner")<<"Unit test group_completed name=" << name << LL_ENDL;
*mStream << "Unit test group_completed name=" << name << std::endl;
}
@@ -167,9 +170,11 @@ public:
if(!tr.message.empty())
{
*mStream << ": '" << tr.message << "'";
+ LL_WARNS("TestRunner") << "not ok : "<<tr.message << LL_ENDL;
}
*mStream << std::endl;
}
+ LL_INFOS("TestRunner")<<out.str()<<LL_ENDL;
}
virtual int getFailedTests() const { return mFailedTests; }
@@ -389,11 +394,14 @@ int main(int argc, char **argv)
#ifndef LL_WINDOWS
::testing::InitGoogleMock(&argc, argv);
#endif
- LLError::initForApplication(".");
+ LLError::initForApplication(".", false /* do not log to stderr */);
LLError::setFatalFunction(wouldHaveCrashed);
- LLError::setDefaultLevel(LLError::LEVEL_ERROR);
- //< *TODO: should come from error config file. Note that we
- // have a command line option that sets this to debug.
+ LLError::setDefaultLevel(LLError::LEVEL_DEBUG);
+ LLError::setPrintLocation(true);
+ std::string test_app_name(argv[0]);
+ std::string test_log = test_app_name + ".log";
+ LLFile::remove(test_log);
+ LLError::logToFile(test_log);
#ifdef CTYPE_WORKAROUND
ctype_workaround();