Use PROJECT_SOURCE_DIR in tests

use_qt_lockfile
elsid 2 years ago
parent ebf6f50523
commit 1fbf50fb13
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -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…
Cancel
Save