summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2012-06-26 09:41:35 -0400
committerOz Linden <oz@lindenlab.com>2012-06-26 09:41:35 -0400
commit5c2c85c6f7f7552a184169bc5959a84efac05895 (patch)
tree48a0bacb64a21b0201f40b40b0eed00d2a6ef677
parent0f958faacd37461a26af76d34a6b29744a2cd1ec (diff)
integrate Nats improvements to test logging with mine
-rw-r--r--indra/test/test.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/indra/test/test.cpp b/indra/test/test.cpp
index 8df404f16b..dc8580fe69 100644
--- a/indra/test/test.cpp
+++ b/indra/test/test.cpp
@@ -456,6 +456,13 @@ void stream_usage(std::ostream& s, const char* app)
s << "\tList all available test groups." << std::endl;
s << " " << app << " --group=uuid" << std::endl;
s << "\tRun the test group 'uuid'." << std::endl;
+
+ s << "\n\n"
+ << "In any event, logs are recorded in the build directory by appending\n"
+ << "the suffix '.log' to the full path name of this application.\n"
+ << "If no level is specified as described above, these log files are at\n"
+ << "DEBUG level.\n"
+ ;
}
void stream_groups(std::ostream& s, const char* app)
@@ -482,24 +489,25 @@ int main(int argc, char **argv)
#ifndef LL_WINDOWS
::testing::InitGoogleMock(&argc, argv);
#endif
- LLError::initForApplication(".", false /* do not log to stderr */);
- LLError::setFatalFunction(wouldHaveCrashed);
- LLError::setDefaultLevel(LLError::LEVEL_DEBUG);
- // ^ possibly overridden by --debug, LOGTEST or LOGFAIL
-
// LOGTEST overrides default, but can be overridden by --debug or LOGFAIL.
const char* LOGTEST = getenv("LOGTEST");
if (LOGTEST)
{
+ LLError::initForApplication(".", true /* log to stderr */);
LLError::setDefaultLevel(LLError::decodeLevel(LOGTEST));
}
+ else
+ {
+ LLError::initForApplication(".", false /* do not log to stderr */);
+ LLError::setDefaultLevel(LLError::LEVEL_DEBUG);
+ }
+ LLError::setFatalFunction(wouldHaveCrashed);
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();
#endif