diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2023-07-07 14:07:12 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2023-07-07 14:07:12 -0400 |
commit | e933ace53b24b732d4111169e3c5964a8591a29e (patch) | |
tree | 80ae1f8e63eedde8e3684c82f4f397341363392e /indra/test | |
parent | f54c1215676f26480d88b4588bb0eeb9c05f50d9 (diff) |
SL-18837: Try to bypass Windows perm problem with Python indirection.
Diffstat (limited to 'indra/test')
-rw-r--r-- | indra/test/namedtempfile.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/indra/test/namedtempfile.h b/indra/test/namedtempfile.h index 4343361f41..525a35000d 100644 --- a/indra/test/namedtempfile.h +++ b/indra/test/namedtempfile.h @@ -65,8 +65,7 @@ public: boost::filesystem::remove(mPath); } - // On Windows, path::native() returns a wstring - std::string getName() const { return ll_convert<std::string>(mPath.native()); } + std::string getName() const { return mPath.string(); } void peep() { @@ -78,12 +77,9 @@ public: std::cout << "---\n"; } -protected: - void createFile(const std::string_view& pfx, - const Streamer& func, - const std::string_view& sfx) + static boost::filesystem::path temp_path(const std::string_view& pfx="", + const std::string_view& sfx="") { - // Create file in a temporary place. // This variable is set by GitHub actions and is the recommended place // to put temp files belonging to an actions job. const char* RUNNER_TEMP = getenv("RUNNER_TEMP"); @@ -97,9 +93,17 @@ protected: // with underscores instead of hyphens: some use cases involve // temporary Python scripts tempdir / stringize(pfx, "%%%%_%%%%_%%%%_%%%%", sfx) }; - mPath = boost::filesystem::unique_path(tempname); - boost::filesystem::ofstream out{ mPath }; + return boost::filesystem::unique_path(tempname); + } +protected: + void createFile(const std::string_view& pfx, + const Streamer& func, + const std::string_view& sfx) + { + // Create file in a temporary place. + mPath = temp_path(pfx, sfx); + boost::filesystem::ofstream out{ mPath }; // Write desired content. func(out); } |