Files
simian/tests/physfs_test_utils.cpp
nick 3e23f7da8e
CI / build-and-test (push) Failing after 10m16s
CI / build-and-test (pull_request) Successful in 3m2s
feat: added physFS
2026-03-11 16:43:36 +13:00

32 lines
804 B
C++

#include "physfs_test_utils.h"
#include "PhysFSManager.h"
static bool g_initialized = false;
bool InitPhysFSTest(const std::filesystem::path& writeDir) {
if (!g_initialized) {
if (!PhysFSManager::Initialize("unit_tests")) {
return false;
}
g_initialized = true;
}
PhysFSManager::SetWriteDir(writeDir.string());
return true;
}
bool MountPhysFSTest(const std::filesystem::path& realPath, const std::string& mountPoint) {
return PhysFSManager::MountPath(realPath.string(), mountPoint, true);
}
bool UnmountPhysFSTest(const std::filesystem::path& realPath) {
return PhysFSManager::UnmountPath(realPath.string());
}
void ShutdownPhysFSTest() {
if (g_initialized) {
PhysFSManager::Shutdown();
g_initialized = false;
}
}