mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 21:35:24 +00:00
Use PROJECT_SOURCE_DIR in tests
This commit is contained in:
parent
ebf6f50523
commit
1fbf50fb13
@ -115,7 +115,7 @@ file(DOWNLOAD
|
||||
|
||||
target_compile_definitions(openmw_test_suite
|
||||
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)
|
||||
target_precompile_headers(openmw_test_suite PRIVATE
|
||||
|
@ -6,8 +6,8 @@
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
|
||||
#ifndef OPENMW_TEST_SUITE_SOURCE_DIR
|
||||
#define OPENMW_TEST_SUITE_SOURCE_DIR ""
|
||||
#ifndef OPENMW_PROJECT_SOURCE_DIR
|
||||
#define OPENMW_PROJECT_SOURCE_DIR "."
|
||||
#endif
|
||||
|
||||
namespace
|
||||
@ -26,7 +26,7 @@ namespace
|
||||
{
|
||||
std::ifstream file;
|
||||
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));
|
||||
std::stringstream buffer;
|
||||
buffer << file.rdbuf();
|
||||
|
Loading…
x
Reference in New Issue
Block a user