diff --git a/test/simulation/CMakeLists.txt b/test/simulation/CMakeLists.txt index df90082..cc96ab5 100644 --- a/test/simulation/CMakeLists.txt +++ b/test/simulation/CMakeLists.txt @@ -14,6 +14,7 @@ add_executable(${PROJECT_NAME} target_include_directories(${PROJECT_NAME} PRIVATE ${TAWASHI_SOURCE_ROOT}/lib/Catch/single_include PRIVATE ${TAWASHI_GEN_INCLUDE_DIR} + PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/include ) target_link_libraries(${PROJECT_NAME} PRIVATE tawashi @@ -25,3 +26,8 @@ add_test( WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_NAME} ) + +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/simulation_config.h.in + ${CMAKE_CURRENT_BINARY_DIR}/include/simulation_config.h +) diff --git a/test/simulation/simulation_config.h.in b/test/simulation/simulation_config.h.in new file mode 100644 index 0000000..e0af88d --- /dev/null +++ b/test/simulation/simulation_config.h.in @@ -0,0 +1,20 @@ +/* Copyright 2017, Michele Santullo + * This file is part of "kamokan". + * + * "kamokan" is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * "kamokan" is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with "kamokan". If not, see . + */ + +#pragma once + +#define KAMOKAN_HTML_PATH "@CMAKE_CURRENT_SOURCE_DIR@/html/website" diff --git a/test/simulation/test_index_response.cpp b/test/simulation/test_index_response.cpp index 248fde4..db290ff 100644 --- a/test/simulation/test_index_response.cpp +++ b/test/simulation/test_index_response.cpp @@ -21,6 +21,7 @@ #include "ini_file.hpp" #include "settings_bag.hpp" #include "safe_stack_object.hpp" +#include "simulation_config.h" #include #include #include @@ -102,7 +103,7 @@ TEST_CASE ("Index response", "[index][response]") { std::string kamokan_settings( "[kamokan]\n" " host_name = 127.0.0.1\n" - " website_root = /home/michele/dev/code/cpp/kamokan/html\n" + " website_root = " KAMOKAN_HTML_PATH "\n" " logging_level = debug\n" " langmap_dir = /usr/share/source-highlight\n" " host_path = /\n"