From 15d37713b9113a6f70dde48c764df02c76e18cbc Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 22 Aug 2022 21:00:42 -0400 Subject: DRTVWR-558: Fix builds on macOS 12.5 Monterey. Always search for python3[.exe] instead of plain 'python'. macOS Monterey no longer bundles Python 2 at all. Explicitly make PYTHON_EXECUTABLE a cached value so if the user edits it in CMakeCache.txt, it won't be overwritten by indra/cmake/Python.cmake. Do NOT set DYLD_LIBRARY_PATH for test executables! That has Bad Effects, as discussed in https://stackoverflow.com/q/73418423/5533635. Instead, create symlinks from build-mumble/sharedlibs/Resources -> Release/Resources and from build-mumble/test/Resources -> ../sharedlibs/Release/Resources. For test executables in sharedlibs/RelWithDebInfo and test/RelWithDebInfo, this supports our dylibs' baked-in load path @executable_path/../Resources. That load path assumes running in a standard app bundle (which the viewer in fact does), but we've been avoiding creating an app bundle for every test program. These symlinks allow us to continue doing that while avoiding DYLD_LIBRARY_PATH. Add indra/llcommon/apply.h. The LL::apply() function and its wrapper macro VAPPLY were very useful in diagnosing the problem. Tweak llleap_test.cpp. This source was modified extensively for diagnostic purposes; these are the small improvements that remain. --- indra/llcommon/tests/llleap_test.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'indra/llcommon/tests') diff --git a/indra/llcommon/tests/llleap_test.cpp b/indra/llcommon/tests/llleap_test.cpp index 9754353ab0..25db4b6542 100644 --- a/indra/llcommon/tests/llleap_test.cpp +++ b/indra/llcommon/tests/llleap_test.cpp @@ -15,10 +15,11 @@ #include "llleap.h" // STL headers // std headers +#include // external library headers +//#include #include #include -#include // other Linden headers #include "../test/lltut.h" #include "../test/namedtempfile.h" @@ -29,7 +30,6 @@ #include "llstring.h" #include "stringize.h" #include "StringVec.h" -#include using boost::assign::list_of; @@ -110,11 +110,6 @@ namespace tut "import os\n" "import sys\n" "\n" - // Don't forget that this Python script is written to some - // temp directory somewhere! Its __file__ is useless in - // finding indra/lib/python. Use our __FILE__, with - // raw-string syntax to deal with Windows pathnames. - "mydir = os.path.dirname(r'" << __FILE__ << "')\n" "from llbase import llsd\n" "\n" "class ProtocolError(Exception):\n" @@ -241,9 +236,10 @@ namespace tut "import sys\n" "sys.stderr.write('''Hello from Python!\n" "note partial line''')\n"); + StringVec vcommand{ PYTHON, script.getName() }; +// std::string command{ boost::algorithm::join(vcommand, " ") }; CaptureLog log(LLError::LEVEL_INFO); - waitfor(LLLeap::create(get_test_name(), - sv(list_of(PYTHON)(script.getName())))); + waitfor(LLLeap::create(get_test_name(), vcommand)); log.messageWith("Hello from Python!"); log.messageWith("note partial line"); } -- cgit v1.2.3 From 2c95174031ecf3970bee685d90c3e2469cd15254 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 23 Aug 2022 17:23:40 -0400 Subject: DRTVWR-558: Remove references to string join() per code review. --- indra/llcommon/tests/llleap_test.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/llcommon/tests') diff --git a/indra/llcommon/tests/llleap_test.cpp b/indra/llcommon/tests/llleap_test.cpp index 25db4b6542..daa84df792 100644 --- a/indra/llcommon/tests/llleap_test.cpp +++ b/indra/llcommon/tests/llleap_test.cpp @@ -17,7 +17,6 @@ // std headers #include // external library headers -//#include #include #include // other Linden headers @@ -237,7 +236,6 @@ namespace tut "sys.stderr.write('''Hello from Python!\n" "note partial line''')\n"); StringVec vcommand{ PYTHON, script.getName() }; -// std::string command{ boost::algorithm::join(vcommand, " ") }; CaptureLog log(LLError::LEVEL_INFO); waitfor(LLLeap::create(get_test_name(), vcommand)); log.messageWith("Hello from Python!"); -- cgit v1.2.3 From 592abc460c96b63b1b1e0d15914f7b64a0c88038 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 26 Aug 2022 22:49:16 -0400 Subject: DRTVWR-568: More cleanup of deleted obsolete std library features. --- indra/llcommon/tests/llleap_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/tests') diff --git a/indra/llcommon/tests/llleap_test.cpp b/indra/llcommon/tests/llleap_test.cpp index daa84df792..7ee36a9ea6 100644 --- a/indra/llcommon/tests/llleap_test.cpp +++ b/indra/llcommon/tests/llleap_test.cpp @@ -525,7 +525,7 @@ namespace tut result.ensure(); } - struct TestLargeMessage: public std::binary_function + struct TestLargeMessage { TestLargeMessage(const std::string& PYTHON_, const std::string& reader_module_, const std::string& test_name_): -- cgit v1.2.3