// Shared by the asset-backed tests (render_3d, mark_manager, python, window_tree). // They resolve original client paths ("ymir work/...", "locale/...", "mark/...") // against the working directory, like the Windows client root. CTest passes // AVA2_TEST_RUNDIR, a directory built by tools/make_test_rundir.py. #pragma once #include #include #include #include namespace ava2_test { // CTest SKIP_RETURN_CODE: the run directory is not available. constexpr int kSkip = 77; // Enters AVA2_TEST_RUNDIR when it is set. Returns false when it is set but // missing (the caller should exit kSkip); unset keeps the current directory. inline bool EnterTestRunDir() { const char* rundir = std::getenv("AVA2_TEST_RUNDIR"); if (!rundir || !*rundir) return true; std::error_code ec; if (!std::filesystem::is_directory(rundir, ec)) { std::cerr << "SKIP: AVA2_TEST_RUNDIR " << rundir << " missing; run tools/make_test_rundir.py" << std::endl; return false; } std::filesystem::current_path(rundir, ec); return !ec; } // Decoded AVA2 pack_maker tree (Maps/, property/, Sound/...). AVA2_PACK_MAKER // overrides the original developer path. inline std::string PackMaker() { if (const char* env = std::getenv("AVA2_PACK_MAKER"); env && *env) return env; return "/Users/shen/Work/Code/Metin2/AVA2/TEST/1. Client DEV/pack_maker"; } } // namespace ava2_test