Commit Graph

62 Commits (9fdca96f8bd2211a99fe88e57b70cbecefa20b6d)

Author SHA1 Message Date
Andrey Lihatskiy 1b68f71348 #824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed 2024-04-29 07:56:09 +03:00
Ansariel ba74152c82 Replace BOOST_FOREACH with standard C++ range-based for-loops 2024-01-09 20:44:50 +02:00
Nat Goodspeed 4b158580e5 SL-18837: Lowercasing pathname for string compare is Windows-only. 2023-07-17 16:47:50 -04:00
Nat Goodspeed c77737b925 SL-18837: Windows failures in setWorkingDirectory(): C: vs. c: (sigh)
Normalize the case of the name of the temp directory for string comparison.
2023-07-10 15:26:21 -04:00
Nat Goodspeed d8292a6291 SL-18837: Disable APR_LOG for now, but leave notes for the future. 2023-07-10 14:46:14 -04:00
Nat Goodspeed 31ccef8a66 SL-18837: Revert "Force llprocess_test and llleap_test to use just 'python'."
Turns out that the pathname of the Python executable wasn't the issue.

This reverts commit 7dc6211ad5.
2023-07-10 14:35:41 -04:00
Nat Goodspeed 7dc6211ad5 SL-18837: Force llprocess_test and llleap_test to use just 'python'.
On GitHub Windows runners, trying to make build.yaml set PYTHON=python in the
environment doesn't work: integration tests still fail with "Access is denied"
because they're still trying to execute the interpreter's full pathname.

Instead, make llprocess_test and llleap_test detect the case of GitHub Windows
and override the environment variable PYTHON with a baked-in string constant
"python".
2023-07-08 14:08:16 -04:00
Nat Goodspeed 1ec6c74404 SL-18837: Set APR_LOG once for the whole job
instead of a new value for each LLProcess::create() invocation.

Since the internal apr_log() function only looks at APR_LOG once per process,
the first test (which succeeded, hence no log file dump) left the log file
open with that same original pathname. Resetting the APR_LOG environment
variable for subsequent runs only made the new code in llprocess_test look for
files that were never created.
2023-07-08 11:08:16 -04:00
Nat Goodspeed f37d2c3076 SL-18837: Don't use LLDir, use NamedTempFile::temp_path.
Remove llcommon circular dependency on llfilesystem, which doesn't work for
this case anyway.
2023-07-08 09:04:33 -04:00
Nat Goodspeed 908fb3fed6 SL-18837: Ditch unreferenced name of caught exception 2023-07-07 20:54:34 -04:00
Nat Goodspeed 09c5b01997 SL-18837: Hook in LLDir to allow reading APR log file. 2023-07-07 20:02:33 -04:00
Nat Goodspeed 8aa3a0a7ed SL-18837: Fix spurious semi 2023-07-07 19:48:02 -04:00
Nat Goodspeed 8f81e1fa87 SL-18837: Fix "lldir.h" #include 2023-07-07 17:47:57 -04:00
Nat Goodspeed 1fc8758458 SL-18837: Coax APR to log LLProcess launch attempts; show log file. 2023-07-07 17:31:50 -04:00
Nat Goodspeed c4b5d089da SL-18837: Partially revert e933ace, keeping useful tweaks.
Introducing indirection via test_python_script.py did NOT address the "Access
is denied" errors on GitHub Windows runners.
2023-07-07 16:57:20 -04:00
Nat Goodspeed e933ace53b SL-18837: Try to bypass Windows perm problem with Python indirection. 2023-07-07 14:07:12 -04:00
Nat Goodspeed ca510f6c29 SL-18837: Try giving temp Python scripts a .py extension.
On GitHub Windows Actions runners, we're getting permissions errors trying to
tell the Python interpreter to run a NamedTempFile script. Try using
NamedExtTempFile to give each such script a .py extension.
2023-06-05 22:08:26 -04:00
Mnikolenko Productengine b42e468b48 merge fix 2022-03-14 20:40:39 +02:00
Mnikolenko Productengine 0aaf5284dc Merge branch 'master' into DRTVWR-539
# Conflicts:
#	autobuild.xml
#	doc/contributions.txt
#	indra/cmake/GLOD.cmake
#	indra/llcommon/tests/llprocess_test.cpp
#	indra/newview/VIEWER_VERSION.txt
#	indra/newview/lldrawpoolavatar.cpp
#	indra/newview/llfloatermodelpreview.cpp
#	indra/newview/llmodelpreview.cpp
#	indra/newview/llviewertexturelist.cpp
#	indra/newview/llvovolume.cpp
#	indra/newview/viewer_manifest.py
2022-03-02 00:46:10 +02:00
Bennett Goble f729cfc33f SL-15742: Convert build scripts to Python 3
This changeset makes it possible to build the Second Life viewer using
Python 3. It is designed to be used with an equivalent Autobuild branch
so that a developer can compile without needing Python 2 on their
machine.

Breaking change: Python 2 support ending

Rather than supporting two versions of Python, including one that was
discontinued at the beginning of the year, this branch focuses on
pouring future effort into Python 3 only. As a result, scripts do not
need to be backwards compatible. This means that build environments,
be they on personal computers and on build agents, need to have a
compatible interpreter.

Notes

- SLVersionChecker will still use Python 2 on macOS
- Fixed the message template url used by template_verifier.py
2021-12-10 14:42:49 -08:00
Brad Payne (Vir Linden) d343313f3f SL-15742 - python 3 support for integration test script 2021-09-15 20:08:23 +01:00
Nat Goodspeed 98cfe13c2a DRTVWR-476: Improve llprocess_test.cpp diagnostic output.
If the test<1>() child process terminates with nonzero rc, also report any
stdout/stderr it might have emitted first.
2020-03-25 18:44:04 -04:00
Nat Goodspeed adb3f447b3 DRTVWR-493: Introduce test catch_what(), catch_llerrs() functions.
Use them in place of awkward try/catch test boilerplate.
2019-08-10 20:33:59 -04:00
Nat Goodspeed c4096f670c SL-10153: Review and rationalize fetching paths from environment.
Use LLStringUtil::getenv() or getoptenv() whenever we fetch a string that will
be used as a pathname.

Use LLFile::tmpdir() instead of getenv("TEMP").

As an added extra-special bonus, finally clean up $TMP/llcontrol-test-zzzzzz
directories that have been accumulating every time we run a local build!
2018-12-14 15:38:13 -05:00
Callum Prentice 9dd7c67012 Pull in improvements to LLProcess termination via a commit from Nat Linden here: 4f39500cb4?at=default 2017-04-19 16:50:56 -07:00
Oz Linden c8726aba30 remove execute permission from many files that should not have it 2015-11-10 09:48:56 -05:00
Nat Goodspeed a2bb483f2d Disambiguate a few ensure() calls.
These were of the form ensure(std::string, something convertible to bool). Not
sure what the ambiguity was, but ensure(std::string, bool(something)) works
better.
2014-12-11 13:12:20 -05:00
Richard Linden 52da9f5f49 merge with viewer-release 2013-09-09 18:58:41 -07:00
Richard Linden 0b96a0e80c BUILDFIX: corrected template parameter for LL_BAD_TEMPLATE_INSTANTIATION macro in llunit 2013-08-26 18:37:07 -07:00
Richard Linden 4c7f489629 BUILDFIX: replaced function that was accidentally removed 2013-08-23 15:02:37 -07:00
Richard Linden a77f424945 BUILDFIX: fix for crashes in unit tests on mac and linux 2013-08-23 13:41:51 -07:00
Nat Goodspeed c5c412469a MAINT-2302: Make llprocess test<6> output less like a build error.
build.sh LogScan greps for "error:" (among other things) so removing the colon
from the test name "syntax_error" should help.
2013-06-29 10:12:30 -04:00
Nat Goodspeed 92d184847a MAINT-2302: Re-enable previously-disabled LLProcess tests for diagnosis. 2013-06-29 10:10:51 -04:00
Graham Madarasz fd447189c5 Merge 3.5.1 into Materials 2013-04-25 21:00:16 -07:00
Oz Linden 8fe17529c6 fix? race condition that occasionally fails in unit test 2013-04-09 15:57:23 -04:00
Graham Madarasz bf6182daa8 Update Mac and Windows breakpad builds to latest 2013-03-29 07:50:08 -07:00
Oz Linden dfc3faf240 workaround by skipping llprocess tests that frequently fail on Windows 2013-01-31 10:33:39 -05:00
Nat Goodspeed 7d3cf544c7 Add timeout functionality to waitfor() helper functions.
Otherwise, a stuck child process could potentially hang the test, and thus the
whole viewer build.
2012-03-13 14:15:11 -04:00
Nat Goodspeed f904867720 Make CaptureLog::withMessage() raise tut::failure if not found.
All known callers were using ensure(! withMessage(...).empty()). Centralize
that logic. Make failure message report the string being sought and the log
messages in which it wasn't found.
In case someone does want to permit the search to fail, add an optional
'required' parameter, default true.
Leverage new functionality in llprocess_test.cpp.
2012-03-01 14:33:23 -05:00
Nat Goodspeed 2596816f31 Break out TestRecorder class as CaptureLog into wrapllerrs.h.
Giving more unit tests the ability to capture and examine log output is
generally useful. Renaming the class just makes it less ambiguous: what's a
TestRecorder? Something that records tests?
2012-03-01 13:43:52 -05:00
Nat Goodspeed 3649eda62a Guarantee LLProcess::Params::postend listener any ReadPipe data.
Previously one might get process-terminated notification but still have to
wait for the child process's final data to arrive on one or more ReadPipes.
That required complex consumer timing logic to handle incomplete pending
ReadPipe data, e.g. a partial last line with no terminating newline. New code
guarantees that by the time LLProcess sends process-terminated notification,
all pending pipe data will have been buffered in ReadPipes.
Document LLProcess::ReadPipe::getPump() notification event; add "eof" key.
Add LLProcess::ReadPipe::getline() and read() convenience methods.
Add static LLProcess::getline() and basename() convenience methods, publishing
logic already present elsewhere.
Use ReadPipe::getline() and read() in unit tests.
Add unit test for "eof" event on ReadPipe::getPump().
Add unit test verifying that final data have been buffered by termination
notification event.
2012-02-29 17:10:19 -05:00
Nat Goodspeed 7fd281ac99 Reduce redundancy in llprocess_test.cpp using get_test_name(). 2012-02-27 15:24:14 -05:00
Nat Goodspeed 14ddc6474a Tighten up LLProcess pipe support, per Richard's code review.
Clarify wording in some of the doc comments; be a bit more explicit about some
of the parameter fields.
Make some query methods 'const'.
Change default LLProcess::ReadPipe::getLimit() value to 0: don't post any
incoming data with notification event unless caller requests it. But do post
pertinent FILESLOT in case caller reuses same listener for both stdout and
stderr.
Use more idiomatic, readable syntax for accessing LLProcess::Params data.
2012-02-23 13:41:26 -05:00
Nat Goodspeed 999484a608 Let LLProcess consumer specify desired description for logging.
If caller runs (e.g.) a Python script, it's not very helpful to a human log
reader to keep seeing LLProcess instances logged as /pathname/to/python (pid).
If caller is aware, the code can at least use the script name as the desc --
or maybe even a hint as to the script's purpose.
If caller doesn't explicitly pass a desc, at least shorten to just the
basename of the executable.
2012-02-20 14:22:32 -05:00
Nat Goodspeed 8b5d5f9652 Make LLProcess post termination event to specified pump if desired.
This way a caller need not spin on isRunning(); we can just listen for the
requested termination event.
Post a similar event containing error message if for any reason
LLProcess::create() failed to launch the child.
Add unit tests for both cases.
2012-02-20 12:40:38 -05:00
Nat Goodspeed f52cf4be70 Fix typos in a few LLProcess::ReadPipe::find() unit tests.
The typos didn't make for invalid tests, but they made a few tests redundant
while leaving other (subtly different) cases untested.
2012-02-16 21:10:06 -05:00
Nat Goodspeed a06ba836c7 Fix bug in LLProcess::ReadPipe::peek() substring computation.
Add unit tests for peek() with substring args, reimplemented contains(),
various forms of find().
(yay unit tests)
2012-02-16 17:35:34 -05:00
Nat Goodspeed 4ecf9d6a2d Add unit test for LLProcess::ReadPipe::setLimit(). 2012-02-16 16:40:14 -05:00
Nat Goodspeed e92c311354 Add LLProcess::ReadPipe::find() methods, with corresponding npos.
If it's useful to have contains() to tell you whether incoming data contains a
particular substring, and if it's useful for contains() and peek() to accept
an offset within that data, then it's useful to allow you to get the offset of
a desired substring within that data. But of course a find() returning offset
needs something like std::string::npos for "not found"; borrow that
convention.
Support both find(const std::string&) and find(char); the latter permits a
more efficient implementation. In fact, make find(string) recognize a string
of length 1 and leverage the find(char) implementation.
Given that, reimplement contains(mumble) as shorthand for find(mumble) != npos.
Implement find() overloads using std::search() and std::find() on
boost::asio::streambuf character iterators, rather than copying to std::string
and then using string search like previous contains() implementation.
Reimplement WritePipeImpl::tick() and ReadPipeImpl::tick() to write/read
directly from/to boost::asio::streambuf data, instead of copying to/from a
temporary flat buffer.
As long as ReadPipeImpl::tick() keeps successfully filling buffers, keep
reading. Previous implementation would only handle a long child write over
successive tick() calls. Stop on read error or when we come up short.
2012-02-16 16:05:04 -05:00
Nat Goodspeed 85057908c3 Add unit test for listening on LLProcess::ReadPipe::getPump(). 2012-02-15 21:55:53 -05:00