mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-05 13:20:11 +00:00
Merge pull request #13758 from JJenkx/windows/tests-unicode-temp-syslog-identity
fix(tests): run syslog, console identity, Audio3d and shader cache directory tests under a Unicode TEMP on Windows
This commit is contained in:
5 files changed
+36
-6
No files matched your search
@@ -11087,7 +11087,7 @@ void pipelineCacheHeaderTests(const Device& device) {
|
||||
Require(versionDirectory.native().size() >= 220 && versionDirectory.native().size() <= 249, "the pipeline cache directory is not between 220 and 249 characters");
|
||||
#ifdef _WIN32
|
||||
_putenv_s("ANYPS5_NO_SHADER_CACHE", "0");
|
||||
_putenv_s("ANYPS5_SHADER_CACHE_DIR", directory.string().c_str());
|
||||
_wputenv_s(L"ANYPS5_SHADER_CACHE_DIR", directory.c_str());
|
||||
#else
|
||||
setenv("ANYPS5_NO_SHADER_CACHE", "0", 1);
|
||||
setenv("ANYPS5_SHADER_CACHE_DIR", directory.string().c_str(), 1);
|
||||
|
||||
@@ -602,7 +602,11 @@ int main(int argc, char** argv) {
|
||||
std::filesystem::create_directories(cache);
|
||||
SetEnvironment("LAZY_RESOLVED_ABI_REFERENCE", reference.string());
|
||||
SetEnvironment("ANYPS5_NO_SHADER_CACHE", "0");
|
||||
#ifdef _WIN32
|
||||
_wputenv_s(L"ANYPS5_SHADER_CACHE_DIR", cache.c_str());
|
||||
#else
|
||||
SetEnvironment("ANYPS5_SHADER_CACHE_DIR", cache.string());
|
||||
#endif
|
||||
SetEnvironment("APS5_NO_PIPELINE_JOURNAL", "1");
|
||||
ClearEnvironment("APS5_LAZY_SHADER_PREPARE");
|
||||
const std::string command = "\"" + std::string(argv[0]) + "\" --eager-reference";
|
||||
|
||||
@@ -16,6 +16,15 @@
|
||||
#include <string_view>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
#ifdef _WIN32
|
||||
#ifndef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -655,11 +664,15 @@ int RunAsPs4Process(const char* program) {
|
||||
file << std::string("TITLE\0TITLE_ID\0\0\0\0\0\0", 20) << std::string("Example\0", 8) << "CUSA00000" << std::string("\0\0\0", 3);
|
||||
}
|
||||
#ifdef _WIN32
|
||||
const std::string command = "\"cd /d \"" + directory.string() + "\" && \"" + program + "\" ps4-process\"";
|
||||
static_cast<void>(program);
|
||||
std::wstring executable(32768, L'\0');
|
||||
executable.resize(GetModuleFileNameW(nullptr, executable.data(), static_cast<DWORD>(executable.size())));
|
||||
const std::wstring command = L"\"cd /d \"" + directory.wstring() + L"\" && \"" + executable + L"\" ps4-process\"";
|
||||
const int status = _wsystem(command.c_str());
|
||||
#else
|
||||
const std::string command = "cd \"" + directory.string() + "\" && \"" + program + "\" ps4-process";
|
||||
#endif
|
||||
const int status = std::system(command.c_str());
|
||||
#endif
|
||||
std::filesystem::remove_all(directory);
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,15 @@
|
||||
#include <random>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#ifdef _WIN32
|
||||
#ifndef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -103,11 +112,14 @@ int main(int argc, char** argv) {
|
||||
file << std::string("TITLE\0TITLE_ID\0\0\0\0\0\0", 20) << std::string("Example\0", 8) << "CUSA00000" << std::string("\0\0\0", 3);
|
||||
}
|
||||
#ifdef _WIN32
|
||||
const std::string command = "\"cd /d \"" + directory.string() + "\" && \"" + argv[0] + "\" ps4-child\"";
|
||||
std::wstring executable(32768, L'\0');
|
||||
executable.resize(GetModuleFileNameW(nullptr, executable.data(), static_cast<DWORD>(executable.size())));
|
||||
const std::wstring command = L"\"cd /d \"" + directory.wstring() + L"\" && \"" + executable + L"\" ps4-child\"";
|
||||
const int status = _wsystem(command.c_str());
|
||||
#else
|
||||
const std::string command = "cd \"" + directory.string() + "\" && \"" + argv[0] + "\" ps4-child";
|
||||
#endif
|
||||
const int status = std::system(command.c_str());
|
||||
#endif
|
||||
std::filesystem::remove_all(directory);
|
||||
Require(status == 0, "the PS4 child process must succeed");
|
||||
return 0;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "prx/libc/include/Api.hpp"
|
||||
#include "prx/libc/include/general/VabiMacros.hpp"
|
||||
#include "tests/TemporaryFile.hpp"
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
@@ -14,7 +15,7 @@
|
||||
|
||||
static void Require(bool value) { if (!value) std::abort(); }
|
||||
int main() {
|
||||
auto* captured = std::tmpfile();
|
||||
auto* captured = TemporaryFile::Open();
|
||||
Require(captured != nullptr);
|
||||
std::fflush(stderr);
|
||||
#ifdef _WIN32
|
||||
|
||||
Reference in new issue
Block a user