1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-30 03:32:36 +00:00

allow to be run from anywhere

This commit is contained in:
Bret Curtis 2023-04-28 21:51:59 +02:00
parent 600649260c
commit 126a04200a
2 changed files with 7 additions and 1 deletions

View File

@ -9,6 +9,8 @@ openmw_add_executable(openmw-iniimporter-tests ${INIIMPORTER_TESTS_SRC_FILES})
target_include_directories(openmw-iniimporter-tests SYSTEM PRIVATE ${GTEST_INCLUDE_DIRS})
target_include_directories(openmw-iniimporter-tests SYSTEM PRIVATE ${GMOCK_INCLUDE_DIRS})
add_definitions(-DCMAKE_BINARY_DIR="${CMAKE_BINARY_DIR}")
target_link_libraries(openmw-iniimporter-tests PRIVATE
GTest::GTest
GMock::GMock

View File

@ -4,6 +4,10 @@
#include <sstream>
#include <vector>
#ifndef CMAKE_BINARY_DIR
#define CMAKE_BINARY_DIR "." // default to current directory
#endif
struct TestParam
{
std::string name;
@ -32,7 +36,7 @@ Archive 1=game2.bsa
std::filesystem::path tempCfgFile = std::filesystem::temp_directory_path() / (param.fileName + ".cfg");
std::stringstream cmd;
cmd << "./openmw-iniimporter -i " << tempIniFile << " -c " << tempCfgFile;
cmd << CMAKE_BINARY_DIR << "/openmw-iniimporter -i " << tempIniFile << " -c " << tempCfgFile;
int ret = std::system(cmd.str().c_str());
ASSERT_EQ(ret, 0);