mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-27 03:40:24 +00:00
Use PROJECT_SOURCE_DIR in tests
This commit is contained in:
parent
ebf6f50523
commit
1fbf50fb13
2 changed files with 4 additions and 4 deletions
|
@ -115,7 +115,7 @@ file(DOWNLOAD
|
||||||
|
|
||||||
target_compile_definitions(openmw_test_suite
|
target_compile_definitions(openmw_test_suite
|
||||||
PRIVATE OPENMW_DATA_DIR=u8"${CMAKE_CURRENT_BINARY_DIR}/data"
|
PRIVATE OPENMW_DATA_DIR=u8"${CMAKE_CURRENT_BINARY_DIR}/data"
|
||||||
OPENMW_TEST_SUITE_SOURCE_DIR=u8"${CMAKE_CURRENT_SOURCE_DIR}")
|
OPENMW_PROJECT_SOURCE_DIR=u8"${PROJECT_SOURCE_DIR}")
|
||||||
|
|
||||||
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16 AND MSVC)
|
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16 AND MSVC)
|
||||||
target_precompile_headers(openmw_test_suite PRIVATE
|
target_precompile_headers(openmw_test_suite PRIVATE
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
#ifndef OPENMW_TEST_SUITE_SOURCE_DIR
|
#ifndef OPENMW_PROJECT_SOURCE_DIR
|
||||||
#define OPENMW_TEST_SUITE_SOURCE_DIR ""
|
#define OPENMW_PROJECT_SOURCE_DIR "."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
|
@ -26,7 +26,7 @@ namespace
|
||||||
{
|
{
|
||||||
std::ifstream file;
|
std::ifstream file;
|
||||||
file.exceptions(std::ios::failbit | std::ios::badbit);
|
file.exceptions(std::ios::failbit | std::ios::badbit);
|
||||||
file.open(std::filesystem::path{ OPENMW_TEST_SUITE_SOURCE_DIR } / "toutf8" / "data"
|
file.open(std::filesystem::path{ OPENMW_PROJECT_SOURCE_DIR } / "apps" / "openmw_test_suite" / "toutf8" / "data"
|
||||||
/ Misc::StringUtils::stringToU8String(fileName));
|
/ Misc::StringUtils::stringToU8String(fileName));
|
||||||
std::stringstream buffer;
|
std::stringstream buffer;
|
||||||
buffer << file.rdbuf();
|
buffer << file.rdbuf();
|
||||||
|
|
Loading…
Reference in a new issue