diff options
| author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-07-30 19:10:46 -0400 | 
|---|---|---|
| committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-07-30 19:10:46 -0400 | 
| commit | 6ae4802e6d3ed7aa67c4946c434850de3be5ffe3 (patch) | |
| tree | 2bfeb690ba2dbf9849fb318d3f551a584278cee2 /indra/test/test.cpp | |
| parent | 020980fb4cd5f2cc18b56fa795c08c153a15bd4a (diff) | |
| parent | 58d5e223b8a15b4825b96923b5891b251c6ccc98 (diff) | |
merge
Diffstat (limited to 'indra/test/test.cpp')
| -rw-r--r-- | indra/test/test.cpp | 29 | 
1 files changed, 24 insertions, 5 deletions
| diff --git a/indra/test/test.cpp b/indra/test/test.cpp index 9d24383bcc..dc8580fe69 100644 --- a/indra/test/test.cpp +++ b/indra/test/test.cpp @@ -181,13 +181,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;  	} @@ -245,9 +248,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; } @@ -451,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) @@ -477,17 +489,24 @@ int main(int argc, char **argv)  #ifndef LL_WINDOWS  	::testing::InitGoogleMock(&argc, argv);  #endif -	LLError::initForApplication("."); -	LLError::setFatalFunction(wouldHaveCrashed); -	LLError::setDefaultLevel(LLError::LEVEL_ERROR); -	// ^ 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(); | 
