summaryrefslogtreecommitdiff
path: root/indra/llcommon/tests/llprocess_test.cpp
AgeCommit message (Collapse)Author
2024-05-23More vestigial whitespace fixesNat Goodspeed
2024-04-25Merge Maint YZ branch 'main' into DRTVWR-588-cleanup-timersNat Goodspeed
2024-01-09Replace BOOST_FOREACH with standard C++ range-based for-loopsAnsariel
2023-08-17DRTVWR-588: Try even harder to normalize Windows pathnames (SIGHH)Nat Goodspeed
2023-08-17DRTVWR-588: Try harder to normalize Windows pathames to compare.Nat Goodspeed
2023-08-17DRTVWR-588: Eliminate APR and Boost.Phoenix from NamedTempFile.Nat Goodspeed
NamedTempFile used to use APR calls to discover a suitable temp directory, synthesize a temp filename template, generate the unique file, write its content and ultimately delete it. This required a reference to gAPRPoolp as the default value of an optional constructor argument in case some usage demanded an alternative APR memory pool. It also used Boost.Phoenix placeholders to magically synthesize a callable. Replace APR calls with Boost.Filesystem; replace Boost.Phoenix with lambdas. Break out unique path generation logic as static NamedTempFile::temp_path(). In a nod to GitHub Actions builds, honor RUNNER_TEMP environment variable if set. test.cpp's RecordToTempFile need no longer pass an apr_pool_t* to NamedTempFile. NamedTempFile's constructor now accepts an optional suffix, making subclass NamedExtTempFile nearly trivial. It no longer needs to create or remove a symlink, for which it used to use APR calls. llprocess_test.cpp's NamedTempDir used to use Python's tempfile.mkdtemp() to create a temp directory, and apr_dir_remove() to destroy it. Replace both with NamedTempFile::temp_path() and Boost.Filesystem. Also add diagnostic output for LLProcess test failure. If llprocess_test cannot launch a child process, notice the APR_LOG environment variable recognized by our patched apr_suite to engage logging, and report the contents of that file.
2023-07-17SL-18837: Lowercasing pathname for string compare is Windows-only.Nat Goodspeed
2023-07-10SL-18837: Windows failures in setWorkingDirectory(): C: vs. c: (sigh)Nat Goodspeed
Normalize the case of the name of the temp directory for string comparison.
2023-07-10SL-18837: Disable APR_LOG for now, but leave notes for the future.Nat Goodspeed
2023-07-10SL-18837: Revert "Force llprocess_test and llleap_test to use just 'python'."Nat Goodspeed
Turns out that the pathname of the Python executable wasn't the issue. This reverts commit 7dc6211ad5ea83685a35c6fff740278343aa8b9d.
2023-07-08SL-18837: Force llprocess_test and llleap_test to use just 'python'.Nat Goodspeed
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-08SL-18837: Set APR_LOG once for the whole jobNat Goodspeed
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-08SL-18837: Don't use LLDir, use NamedTempFile::temp_path.Nat Goodspeed
Remove llcommon circular dependency on llfilesystem, which doesn't work for this case anyway.
2023-07-07SL-18837: Ditch unreferenced name of caught exceptionNat Goodspeed
2023-07-07SL-18837: Hook in LLDir to allow reading APR log file.Nat Goodspeed
2023-07-07SL-18837: Fix spurious semiNat Goodspeed
2023-07-07SL-18837: Fix "lldir.h" #includeNat Goodspeed
2023-07-07SL-18837: Coax APR to log LLProcess launch attempts; show log file.Nat Goodspeed
2023-07-07SL-18837: Partially revert e933ace, keeping useful tweaks.Nat Goodspeed
Introducing indirection via test_python_script.py did NOT address the "Access is denied" errors on GitHub Windows runners.
2023-07-07SL-18837: Try to bypass Windows perm problem with Python indirection.Nat Goodspeed
2023-06-05SL-18837: Try giving temp Python scripts a .py extension.Nat Goodspeed
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.
2022-03-14merge fixMnikolenko Productengine
2022-03-02Merge branch 'master' into DRTVWR-539Mnikolenko Productengine
# 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
2021-12-10SL-15742: Convert build scripts to Python 3Bennett Goble
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-09-15SL-15742 - python 3 support for integration test scriptBrad Payne (Vir Linden)
2020-03-25DRTVWR-476: Improve llprocess_test.cpp diagnostic output.Nat Goodspeed
If the test<1>() child process terminates with nonzero rc, also report any stdout/stderr it might have emitted first.
2019-08-10DRTVWR-493: Introduce test catch_what(), catch_llerrs() functions.Nat Goodspeed
Use them in place of awkward try/catch test boilerplate.
2018-12-14SL-10153: Review and rationalize fetching paths from environment.Nat Goodspeed
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!
2017-04-19Pull in improvements to LLProcess termination via a commit from Nat Linden ↵Callum Prentice
here: https://bitbucket.org/rider_linden/doduo-viewer/commits/4f39500cb46e879dbb732e6547cc66f3ba39959e?at=default
2015-11-10remove execute permission from many files that should not have itOz Linden
2014-12-11Disambiguate a few ensure() calls.Nat Goodspeed
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.
2013-09-09merge with viewer-releaseRichard Linden
2013-08-26BUILDFIX: corrected template parameter for LL_BAD_TEMPLATE_INSTANTIATION ↵Richard Linden
macro in llunit
2013-08-23BUILDFIX: replaced function that was accidentally removedRichard Linden
2013-08-23BUILDFIX: fix for crashes in unit tests on mac and linuxRichard Linden
2013-06-29MAINT-2302: Make llprocess test<6> output less like a build error.Nat Goodspeed
build.sh LogScan greps for "error:" (among other things) so removing the colon from the test name "syntax_error" should help.
2013-06-29MAINT-2302: Re-enable previously-disabled LLProcess tests for diagnosis.Nat Goodspeed
2013-04-25Merge 3.5.1 into MaterialsGraham Madarasz
2013-04-09fix? race condition that occasionally fails in unit testOz Linden
2013-03-29Update Mac and Windows breakpad builds to latestGraham Madarasz
2013-01-31workaround by skipping llprocess tests that frequently fail on WindowsOz Linden
2012-03-13Add timeout functionality to waitfor() helper functions.Nat Goodspeed
Otherwise, a stuck child process could potentially hang the test, and thus the whole viewer build.
2012-03-01Make CaptureLog::withMessage() raise tut::failure if not found.Nat Goodspeed
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-01Break out TestRecorder class as CaptureLog into wrapllerrs.h.Nat Goodspeed
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-02-29Guarantee LLProcess::Params::postend listener any ReadPipe data.Nat Goodspeed
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-27Reduce redundancy in llprocess_test.cpp using get_test_name().Nat Goodspeed
2012-02-23Tighten up LLProcess pipe support, per Richard's code review.Nat Goodspeed
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-20Let LLProcess consumer specify desired description for logging.Nat Goodspeed
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-20Make LLProcess post termination event to specified pump if desired.Nat Goodspeed
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-16Fix typos in a few LLProcess::ReadPipe::find() unit tests.Nat Goodspeed
The typos didn't make for invalid tests, but they made a few tests redundant while leaving other (subtly different) cases untested.