summaryrefslogtreecommitdiff
path: root/indra/test/test.cpp
AgeCommit message (Collapse)Author
2021-09-27SL-16093 Don't force the console window to be open on developer builds ↵Dave Parks
because it causes frame stalls while logging.
2020-04-03DRTVWR-476: Facilitate debugging test programs with logging.Nat Goodspeed
On Mac, even if you run a test program with --debug or set LOGTEST=DEBUG, it won't log to stderr if you're filtering build output or running the build in an emacs compile buffer. This is because, on Mac, a viewer launched by mouse rather than from the command line is passed a stderr stream that ultimately gets logged to the system Console. The shouldLogToStderr() function is intended to avoid spamming the Console with the (voluminous) viewer log output. It tests whether stderr isatty() and, if not, suppresses calling LLError::logToStderr(). This makes debugging test programs using log output trickier than necessary. Change shouldLogToStderr() to permit logging when either stderr isatty() or is a pipe. The original intention is preserved in that empirically, a viewer launched by mouse is passed a stderr stream identified as a character device rather than as a pipe. Also introduce SetEnv, a class that facilitates setting (e.g.) LOGTEST=DEBUG for specific test programs without setting it for all test programs in the build. Using the constructor for a static object means you can set environment variables before main() is entered, which is important because it's the main() function in test.cpp that acts on the LOGTEST and LOGFAIL environment variables. These changes make it unnecessary to retain the temporary change in test.cpp to force LOGTEST to DEBUG.
2020-04-03DRTVWR-476: Cherry-pick debug aids from commit 77b0c53 (fiber-mutex)Nat Goodspeed
2020-03-25DRTVWR-476: Conflate LOGFAIL env var empty with completely unset.Nat Goodspeed
Sometimes it's useful to be able to temporarily override an existing LOGFAIL setting in the current environment. It's far more convenient to prepend LOGFAIL='' to a command than to 'unset LOGFAIL' as a whole separate command -- and then remember to restore its previous value.
2020-03-25DRTVWR-476: Make test program --debug switch work like LOGTEST=DEBUG.Nat Goodspeed
The comments within indra/test/test.cpp promise that --debug is, in fact, like LOGTEST=DEBUG. Until now, that was a lie. LOGTEST=level displayed log output on stderr as well as in testprogram.log, while --debug did not. Add LLError::logToStderr() function, and make initForApplication() (i.e. commonInit()) call that instead of instantiating RecordToStderr inline. Also call it when test.cpp recognizes --debug switch. Remove the mFileRecorder, mFixedBufferRecorder and mFileRecorderFileName members from SettingsConfig. That tactic doesn't scale. Instead, add findRecorder<RECORDER>() and removeRecorder<RECORDER>() template functions to locate (or remove) a RecorderPtr to an object of the specified subclass. Both are based on an underlying findRecorderPos<RECORDER>() template function. Since we never expect to manage more than a handful of RecorderPtrs, and since access to the deleted members is very much application setup rather than any kind of ongoing access, a search loop suffices. logToFile() uses removeRecorder<RecordToFile>() rather than removing mFileRecorder (the only use of mFileRecorder). logToFixedBuffer() uses removeRecorder<RecordToFixedBuffer>() rather than removing mFixedBufferRecorder (the only use of mFixedBufferRecorder). Make RecordToFile store the filename with which it was instantiated. Add a getFilename() method to retrieve it. logFileName() is now based on findRecorder<RecordToFile>() instead of mFileRecorderFileName (the only use of mFileRecorderFileName). Make RecordToStderr::mUseANSI a simple bool rather than a three-state enum, and set it immediately on construction. Apparently the reason it was set lazily was because it consults its own checkANSI() method, and of course 'this' doesn't acquire the leaf class type until the constructor has completed successfully. But since nothing in checkANSI() depends on anything else in RecordToStderr, making it static solves that problem.
2019-08-19DRTVWR-493: When a test fails due to exception, display exception.Nat Goodspeed
2019-08-10DRTVWR-493: Introduce test catch_what(), catch_llerrs() functions.Nat Goodspeed
Use them in place of awkward try/catch test boilerplate.
2018-11-14Automated merge with ssh://bitbucket.org/lindenlab/viewer-releaseNat Goodspeed
2018-10-11Modify logging so that the in-viewer console and stderr do not escape line ↵Oz Linden
breaks Improve the implementation so that escaping is computed only once
2018-02-13mergeBrad Payne (Vir Linden)
2017-10-11mergeBrad Payne (Vir Linden)
2017-10-11merge changes for 5.0.8-releaseOz Linden
2017-06-30Added cycle_object_animations.lsl. Also change to test.cpp to see if it ↵Brad Payne (Vir Linden)
affects a g++ internal compiler error.
2017-06-20merge changes for 5.0.6-releaseOz Linden
2017-08-30MAINT-7758 Fixed freeze on loading lsl scripts from unicode named windows ↵andreykproductengine
folder.
2017-05-24no-op edit to force a rebuildBrad Payne (Vir Linden)
2017-04-11DRTVWR-434 - trivial code change to trigger TC rebuild, also slight ↵Brad Payne (Vir Linden)
improvement to a log message
2017-02-27Look for logcontrol-dev.xml in the user settings directoryOz Linden
2015-11-10remove execute permission from many files that should not have itOz Linden
2014-05-17MAINT-4009: Final pass refactoring to eliminate memory allocation related to ↵Stinson Linden
error reporting that is not properly cleaned up.
2014-05-16MAINT-4009: First pass refactoring to eliminate memory related to error ↵Stinson Linden
reporting that is not properly cleaned up.
2013-07-01SH-4294 FIX Interesting: Statistics Texture cache hit rate is always 0%Richard Linden
also, removed LLTrace::init and cleanup removed derived class implementation of memory stat for LLMemTrackable is automatic now
2013-06-05merge with viewer-releaseRichard Linden
2013-03-29Update Mac and Windows breakpad builds to latestGraham Madarasz
2013-01-08SH-3468 WIP add memory tracking base classRichard Linden
cleaned up hacks used to get unit tests working LLTrace::init now supports recursive initialization/cleanup put NOMINMAX back in win32 header wrappers
2013-01-08SH-3468 WIP add memory tracking base classRichard Linden
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
2013-01-06SH-3468 WIP add memory tracking base classRichard Linden
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)
2012-11-15SH-3406 WIP convert fast timers to lltrace systemRichard Linden
eliminated min and max macros from windows.h got rest of viewer to compile against llfasttimer changes
2012-09-26SH-3275 WIP Run viewer metrics for object update messagesRichard Linden
fixed various issues related to unit tests and LLThreadLocalPtr initialization and teardown
2012-06-26integrate Nats improvements to test logging with mineOz Linden
2012-06-25merge up to 3.3.3-release + pathfindingOz Linden
2012-06-24Add logging during tests (debug level, to test-specific files)Oz Linden
2012-05-09CHOP-900: Fix test.cpp merge errors merging up to viewer-releaseNat Goodspeed
2012-05-09Automated merge with http://hg.secondlife.com/viewer-releaseNat Goodspeed
2012-04-23IQA-463: LLError::addRecorder() claims ownership of passed Recorder*.Nat Goodspeed
That is, when the underlying LLError::Settings object is destroyed -- possibly at termination, possibly on LLError::restoreSettings() -- the passed Recorder* is deleted. There was much existing code that seemed as unaware of this alarming fact as I was myself. Passing to addRecorder() a pointer to a stack object, or to a member of some other object, is just Bad. It might be preferable to make addRecorder() accept std::auto_ptr<Recorder> to make the ownership transfer more explicit -- or even boost::shared_ptr<Recorder> instead, which would allow the caller to either forget or retain the passed Recorder. This preliminary pass retains the Recorder* dumb pointer API, but documents the ownership issue, and eliminates known instances of passing pointers to anything but a standalone heap Recorder subclass object.
2012-03-05Make test.cpp support LOGFAIL env var: only failed tests show log.Nat Goodspeed
Set LOGFAIL= one of ALL, DEBUG, INFO, WARN, ERROR, NONE. A passing test will run silently, as now; but a failing test will replay log output at the specified level or higher. While at it, support LOGTEST environment variable, same values. This is like setting --debug (or -d), but allows specifying an arbitrary level -- and, unlike --debug, can be set for a TeamCity build config without modifying any scripts or code. Publish LLError::decodeLevel(std::string), previously private to llerror.cpp.
2012-02-08Echo group_started, group_completed to test-program output file.Nat Goodspeed
This isn't recent oversight; in viewer-development the output file never contained those lines either. But it should. Using scoped_ptr is more robust than using a dumb pointer with inline "Oh yeah, don't forget to clean up that pointer" logic.
2012-02-07Disable MSVC warning C4702 (unreachable code) in Boost headers.Nat Goodspeed
2012-02-03Escape all strings embedded in TeamCity service messages.Nat Goodspeed
TeamCity requires that certain characters (notably "'") must be escaped when embedded in service messages: http://confluence.jetbrains.net/display/TCD65/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-ServiceMessages TUT frequently outputs messages containing "'", e.g. from ensure_equals() failure. We've seen TC output nesting get confused when it fails to process service messages properly due to parsing unescaped messages. Along with test<n> number, report test name (from set_test_name()) when available. Eliminate horsing around to produce normal output on both std::cout and possible output file. When output file is specified, use boost::iostreams::tee_device to do fanout for us. Improve placement (and possibly reliability) of service messages. Clean up a startling amount of redundancy in service-message production.
2010-08-25forcing all the teamcity service messages to be spat out at once per suite ↵Aaron Terrell (Enus)
to avoid incorrect TC reporting
2010-08-24seems that build out put sometimes concatenates and we miss a line in our ↵Aaron Terrell (Enus)
reporting parse, adding newlines at the beginning of each case out
2010-08-24commenting out object delete as windows builds are complaining: '[LogScan] ↵Aaron Terrell (Enus)
e:\w-enus_viewer-tut-teamcity\latest\indra\test\test.cpp(466) : error C2220: warning treated as error - no 'object' file generated [LogScan] e:\w-enus_viewer-tut-teamcity\latest\indra\test\test.cpp(466) : warning C4702: unreachable code'
2010-08-24subclassing is working, thanks to changes to the subclass constructor and ↵Aaron Terrell (Enus)
ridding it of member variables
2010-08-24clean commit of teamcity service message related changes of unit test ↵Aaron Terrell (Enus)
reporting into a clean repo
2010-08-13Change license from GPL to LGPL (version 2.1)Oz Linden
2009-10-16merge from latest svn/viewer-2-0 to hg/viewer-2-0Mark Palange (Mani)
2009-10-15DEV-41345 turn llmodularmath_tut into a real llmath unit test.Adam Moss
2009-10-12DEV-41080Adam Moss
remove weird double-printing of test results, make test-passing more *fun*!
2009-10-05merge with latest from lindenlab/svn-imports-viewer-20Mark Palange (Mani)
2009-10-03Merge inspectors UI project, gooey-4, into viewer-2 trunk. Added new ↵James Cook
tooltips to 3D avatars, 2D avatar names, and 3D objects. Refactors tooltips and text boxes, line editors, and text editors. Breaks LLExpandableTextBox, but a fix is coming. Resolved conflicts in lltexteditor.cpp, llchatitemscontainerctrl.cpp, llchatmsgbox.cpp, llfloaterbuycurrency.cpp, llnearbychat.cpp, floater_buy_currency.xml, and ru/strings.xml Merging revisions 134925-135157 of svn+ssh://svn.lindenlab.com/svn/linden/branches/gooey/gooey-4 into C:\source\viewer-2.0.0-3, respecting ancestry