Commit Graph

89 Commits (61a842ee43923b190ce76ce9eeeb787e94d8e708)

Author SHA1 Message Date
Ansariel 9e415cdbb2 Merge branch 'DRTVWR-516-maint' of https://bitbucket.org/lindenlab/viewer 2021-05-25 11:03:48 +02:00
Oz Linden a9d271c5a2 SL-10297 merged 6.4.7 2020-08-24 13:11:07 -04:00
Anchor b5bb0794f0 [DRTVWR-476] - fix linking 2020-03-25 18:39:20 -04:00
Anchor 761d9aa3bf [DRTVWR-476] - test adding at beginiing of list 2020-03-25 18:39:20 -04:00
Anchor e039f5e29e [DRTVWR-476] - legacy_stdio_definitions shld be the last library linked 2020-03-25 18:39:20 -04:00
Nat Goodspeed 66981fab0b SL-793: Use Boost.Fiber instead of the "dcoroutine" library.
Longtime fans will remember that the "dcoroutine" library is a Google Summer
of Code project by Giovanni P. Deretta. He originally called it
"Boost.Coroutine," and we originally added it to our 3p-boost autobuild
package as such. But when the official Boost.Coroutine library came along
(with a very different API), and we still needed the API of the GSoC project,
we renamed the unofficial one "dcoroutine" to allow coexistence.

The "dcoroutine" library had an internal low-level API more or less analogous
to Boost.Context. We later introduced an implementation of that internal API
based on Boost.Context, a step towards eliminating the GSoC code in favor of
official, supported Boost code.

However, recent versions of Boost.Context no longer support the API on which
we built the shim for "dcoroutine." We started down the path of reimplementing
that shim using the current Boost.Context API -- then realized that it's time
to bite the bullet and replace the "dcoroutine" API with the Boost.Fiber API,
which we've been itching to do for literally years now.

Naturally, most of the heavy lifting is in llcoros.{h,cpp} and
lleventcoro.{h,cpp} -- which is good: the LLCoros layer abstracts away most of
the differences between "dcoroutine" and Boost.Fiber.

The one feature Boost.Fiber does not provide is the ability to forcibly
terminate some other fiber. Accordingly, disable LLCoros::kill() and
LLCoprocedureManager::shutdown(). The only known shutdown() call was in
LLCoprocedurePool's destructor.

We also took the opportunity to remove postAndSuspend2() and its associated
machinery: FutureListener2, LLErrorEvent, errorException(), errorLog(),
LLCoroEventPumps. All that dual-LLEventPump stuff was introduced at a time
when the Responder pattern was king, and we assumed we'd want to listen on one
LLEventPump with the success handler and on another with the error handler. We
have never actually used that in practice. Remove associated tests, of course.

There is one other semantic difference that necessitates patching a number of
tests: with "dcoroutine," fulfilling a future IMMEDIATELY resumes the waiting
coroutine. With Boost.Fiber, fulfilling a future merely marks the fiber as
ready to resume next time the scheduler gets around to it. To observe the test
side effects, we've inserted a number of llcoro::suspend() calls -- also in
the main loop.

For a long time we retained a single unit test exercising the raw "dcoroutine"
API. Remove that.

Eliminate llcoro_get_id.{h,cpp}, which provided llcoro::get_id(), which was a
hack to emulate fiber-local variables. Since Boost.Fiber has an actual API for
that, remove the hack.

In fact, use (new alias) LLCoros::local_ptr for LLSingleton's dependency
tracking in place of llcoro::get_id().

In CMake land, replace BOOST_COROUTINE_LIBRARY with BOOST_FIBER_LIBRARY. We
don't actually use the Boost.Coroutine for anything (though there exist
plausible use cases).
2020-03-25 17:32:45 -04:00
Nicky e6e66a953e Merge with viewer-vs2017 2019-06-06 14:37:27 +02:00
Nat Goodspeed ebcfbf277e Automated merge with ssh://bitbucket.org/lindenlab/viewer-release 2019-06-05 14:15:15 -04:00
Anchor 9c9601ce8a [DRTVWR-476] - fix linking 2019-05-08 18:57:33 -06:00
Anchor 616075f084 [DRTVWR-476] - test adding at beginiing of list 2019-05-08 18:05:49 -06:00
Anchor 6eb4e88d94 [DRTVWR-476] - legacy_stdio_definitions shld be the last library linked 2019-05-08 17:37:05 -06:00
Oz Linden e409c0492f convert to an explicit USE_BUGSPLAT switch in cmake, revise LL_ERRS approach 2019-03-02 11:58:11 -05:00
Ansariel 606adaffe7 Merge viewer-bugsplat 2018-09-12 18:09:43 +02:00
Oz Linden 9fd463bd94 remove only-partially-successful attempt to put teamcity blocks around targets 2018-09-07 09:13:57 -04:00
Oz Linden 49c483eeb3 add more block structure to TeamCity log output for components 2018-09-05 18:07:35 -04:00
Nat Goodspeed 26570cfd67 SL-793: Use Boost.Fiber instead of the "dcoroutine" library.
Longtime fans will remember that the "dcoroutine" library is a Google Summer
of Code project by Giovanni P. Deretta. He originally called it
"Boost.Coroutine," and we originally added it to our 3p-boost autobuild
package as such. But when the official Boost.Coroutine library came along
(with a very different API), and we still needed the API of the GSoC project,
we renamed the unofficial one "dcoroutine" to allow coexistence.

The "dcoroutine" library had an internal low-level API more or less analogous
to Boost.Context. We later introduced an implementation of that internal API
based on Boost.Context, a step towards eliminating the GSoC code in favor of
official, supported Boost code.

However, recent versions of Boost.Context no longer support the API on which
we built the shim for "dcoroutine." We started down the path of reimplementing
that shim using the current Boost.Context API -- then realized that it's time
to bite the bullet and replace the "dcoroutine" API with the Boost.Fiber API,
which we've been itching to do for literally years now.

Naturally, most of the heavy lifting is in llcoros.{h,cpp} and
lleventcoro.{h,cpp} -- which is good: the LLCoros layer abstracts away most of
the differences between "dcoroutine" and Boost.Fiber.

The one feature Boost.Fiber does not provide is the ability to forcibly
terminate some other fiber. Accordingly, disable LLCoros::kill() and
LLCoprocedureManager::shutdown(). The only known shutdown() call was in
LLCoprocedurePool's destructor.

We also took the opportunity to remove postAndSuspend2() and its associated
machinery: FutureListener2, LLErrorEvent, errorException(), errorLog(),
LLCoroEventPumps. All that dual-LLEventPump stuff was introduced at a time
when the Responder pattern was king, and we assumed we'd want to listen on one
LLEventPump with the success handler and on another with the error handler. We
have never actually used that in practice. Remove associated tests, of course.

There is one other semantic difference that necessitates patching a number of
tests: with "dcoroutine," fulfilling a future IMMEDIATELY resumes the waiting
coroutine. With Boost.Fiber, fulfilling a future merely marks the fiber as
ready to resume next time the scheduler gets around to it. To observe the test
side effects, we've inserted a number of llcoro::suspend() calls -- also in
the main loop.

For a long time we retained a single unit test exercising the raw "dcoroutine"
API. Remove that.

Eliminate llcoro_get_id.{h,cpp}, which provided llcoro::get_id(), which was a
hack to emulate fiber-local variables. Since Boost.Fiber has an actual API for
that, remove the hack.

In fact, use (new alias) LLCoros::local_ptr for LLSingleton's dependency
tracking in place of llcoro::get_id().

In CMake land, replace BOOST_COROUTINE_LIBRARY with BOOST_FIBER_LIBRARY. We
don't actually use the Boost.Coroutine for anything (though there exist
plausible use cases).
2018-05-10 21:46:07 -04:00
Nicky 985730a52c Merge. 2017-05-18 17:40:24 +02:00
Nat Goodspeed 322c4c6bec DRTVWR-418: Fix -std=c++11 llinstancetracker_test crash.
LLInstanceTracker<T> performs validation in ~LLInstanceTracker(). Normally
validation failure logs an error and terminates the program, which is fine. In
the test executable, though, we want validation failure to throw an exception
instead so we can catch it and continue testing other failure conditions. But
since destructors in C++11 are implicitly noexcept(true), that exception never
made it out of ~LLInstanceTracker(): it crashed the test program instead.
Declaring ~LLInstanceTracker() noexcept(false) solves that, allowing the test
program to catch the exception and continue.

However, if we unconditionally declare that, then every destructor anywhere in
the inheritance hierarchy for any LLInstanceTracker subclass must also be
noexcept(false)! That's way too pervasive, especially for functionality we
only need (or want) in a specific test executable.

Instead, make the CMake macros LL_ADD_PROJECT_UNIT_TESTS() and
LL_ADD_INTEGRATION_TEST() -- with which we define all viewer build-time tests
-- define two new command-line macros: LL_TEST=testname and LL_TEST_testname.
That way, preprocessor logic in a header file can detect whether it's being
compiled for production code or for a test executable.

(While at it, encapsulate in a new GET_OPT_SOURCE_FILE_PROPERTY() CMake macro
an ugly repetitive pattern. The builtin GET_SOURCE_FILE_PROPERTY() sets the
target variable to "NOTFOUND" -- rather than an empty string -- if the
specified property wasn't set. Every call to GET_SOURCE_FILE_PROPERTY() in
LL_ADD_PROJECT_UNIT_TESTS() was followed by a test for NOTFOUND and an
assignment to "". Wrap all that in a macro whose 'unset' value is "".)

Now llinstancetracker.h can detect when we're building the LLInstanceTracker
unit test executable, and *only then* declare ~LLInstanceTracker() as
noexcept(false). We #define LLINSTANCETRACKER_DTOR_NOEXCEPT to expand either
empty or noexcept(false), also detecting clang in C++11 mode. (It all works
fine without noexcept(false) until we turn on C++11 mode.)

We also use that macro for the StatBase class in lltrace.h. Turns out some of
the infrastructure headers required for tests in general, including the
LLInstanceTracker test, use LLInstanceTracker. Fortunately that appears to be
the only other class we must annotate this way for the LLInstanceTracker tests.
2017-05-08 09:09:22 -04:00
Nicky e19d7a7490 Merge with viewer64. 2017-02-14 19:49:51 +01:00
Oz Linden 725ba32d08 don't add llcorehttp to all tests 2016-12-20 17:18:56 -05:00
Nicky c218e524b2 Merge - Step 1; Still enough to do. 2015-10-26 20:20:13 +01:00
Rider Linden fc2e9ec3db swap common and core? 2015-08-17 14:45:52 -07:00
Rider Linden efbbbca9b0 Get unit tests (Integration and project) compiling and linking again. 2015-08-17 10:25:11 -07:00
rider e3b429cd85 These tests are just causing a cascade of errors.. 2015-08-14 21:39:07 -07:00
Rider Linden aa3042ea33 MAINT-5506: Converted llmessage untrusted sim message responder to coroutine.
Removed HTTPSender, HTTPNullSender, HTTPCapSender.
Moved UntrustedMessageCap storage into LLHost
Added boost libraries to PROJECT_x_TEST linkage.
2015-08-14 16:45:26 -07:00
Nicky 006190f2a1 Merge with tools update. 2015-05-05 13:09:27 +02:00
Ansariel a45088cb6b Merge LL V3.7.11 2015-01-12 12:54:15 +01:00
Oz Linden a959ede776 correct test construction macro target reference for integration tests 2014-10-21 17:56:13 -04:00
JJ Linden 5cb5c267ca fixes for cmake warnings about policy changes. could not fully test these changes 2014-10-13 12:46:55 -07:00
Oz Linden a98b4b6bee merge changes for 3.7.7-release 2014-05-07 11:09:04 -04:00
Oz Linden 776aadf4ef OPEN-199: replace the confusing STANDALONE switch with USESYSTEMLIBS 2014-03-19 17:30:07 -04:00
Tank_Master 6babf8abd2 Merge LL 3.7.7 2014-06-09 11:29:57 -07:00
Richard Linden 516061275b fixed unit tests being generated as Windows GUI projects instead of console projects 2014-01-09 12:18:34 -08:00
Graham Madarasz 3c486da165 Rollback the boost sys lib inclusion in integ tests as it was causing dup symbols 2013-03-27 07:38:46 -07:00
Oz Linden 4da3467961 Add Boost System library to all tests
I don't know what added this requirement, but this last night lots of
them started failing to link.
Also remove some obsolete commented-out stuff
2013-03-26 10:33:02 -04:00
simon@Simon-PC.lindenlab.com 4de7c27d93 Merge in viewer-development 2013-01-14 09:31:57 -08:00
Oz Linden a7dbaaa0af merge changes for DRTVWR-250 2013-01-08 09:45:27 -05:00
Logan Dethrow 7e59b10413 Removed duplicated block of code in LLAddBuildTest.cmake. Added comment to point to duplicated code. Replaced hard-coded tcmalloc link option with variable that is created in GooglePerfTools.cmake. 2012-12-07 19:38:12 -05:00
Dave Parks 5d34ac552f Automated merge with https://bitbucket.org/lindenlab/viewer-development 2012-11-20 17:03:55 -06:00
simon@Simon-PC.lindenlab.com 122a01cb9c Further attempts to erradicate TCMALLOC 2012-09-07 14:04:40 -07:00
Monty Brandenberg 81b9e29a1f DRTVWR-209 Merge of viewer-development with SH-3316 drano-http code.
Cmake files not merged correctly and had to be done by hand.  New memory
allocation made some memory usage tests in the llcorehttp integration
tests no longer valid.  Would like to work on LLLog sometime and get
it to be consistent.  Special flags needed for windows build of example
program.
2012-09-07 18:55:04 -04:00
Nicky a4a025a24d Remove downloading/installing of Google Mock/Test for tests. For Windows include and InitGoogleMock was removed with changelist 991 from 2009-09-10. As it causes problems with GCC 4.7.x remove all it on all platforms. 2013-03-13 18:10:39 +01:00
Kitty Barnett e1526c4048 Merged with Appearance-Misc tip
--HG--
branch : .RLVa
2013-02-20 14:26:21 +01:00
Kitty Barnett b368a21202 Merged with Appearance-Misc tip
--HG--
branch : .RLVa
2013-02-04 21:06:34 +01:00
Logan Dethrow 0302573348 Automated merge with ssh://bitbucket.org/lindenlab/viewer-development 2012-12-11 16:38:10 -05:00
Kitty Barnett 4c9f7abec9 Merged with Appearance-MixedViewers tip
--HG--
branch : .RLVa
2012-09-20 16:35:22 +02:00
William Todd Stinson a766e26db4 Backing out the changes contributing to DRTVWR-167 and DRTVWR-179 from the repository. 2012-09-10 10:37:02 -07:00
Brad Payne (Vir Linden) bf6bbe4642 MAINT-515 FIX, CHOP-100 FIX - technically we are avoiding these issues rather than fixing them; changing llcommon to be statically linked avoids the symbol issues with llcommon.dll 2012-08-02 11:45:38 -04:00
simon@Simon-PC.lindenlab.com 173d0fa213 Pull in viewer-development because it's painful. Merge with runitai's help. 2012-07-11 16:15:23 -07:00
Brad Payne (Vir Linden) 86d33e21a7 merge 2012-08-02 11:53:42 -04:00