-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
39 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,16 @@ | ||
cmake_minimum_required(VERSION 3.11) | ||
project(test_package) | ||
cmake_minimum_required(VERSION 2.8.11) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup() | ||
conan_basic_setup(TARGETS) | ||
|
||
if (${CMAKE_BUILD_TYPE} STREQUAL Debug) | ||
if (NOT ${CONAN_SETTINGS_COMPILER} STREQUAL "clang" AND NOT ${CONAN_SETTINGS_COMPILER} STREQUAL "apple-clang") | ||
include (../cmake/debug_flags.cmake) | ||
endif() | ||
endif() | ||
if (${MEMORY_SANITIZER_ON}) | ||
include (../cmake/mem_sanitizer.cmake) | ||
endif () | ||
find_package(nuraft_mesg QUIET REQUIRED) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD 20) | ||
set(CPP_WARNINGS "-Wall -Wextra -Werror") | ||
|
||
find_program(CCACHE_FOUND ccache) | ||
if (CCACHE_FOUND) | ||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) | ||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) | ||
endif () | ||
add_executable(example_server example_server.cpp example_state_manager.cpp in_memory_log_store.cpp) | ||
target_link_libraries(example_server nuraft_mesg::nuraft_mesg) | ||
|
||
add_executable(raft_server example_server.cpp example_state_manager.cpp in_memory_log_store.cpp) | ||
add_executable(raft_client example_client.cpp) | ||
|
||
conan_target_link_libraries(raft_server) | ||
conan_target_link_libraries(raft_client) | ||
add_executable(example_client example_client.cpp) | ||
target_link_libraries(example_client nuraft_mesg::nuraft_mesg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,20 @@ | ||
from conans import ConanFile, CMake, tools, RunEnvironment | ||
from conans import ConanFile | ||
from conan.tools.build import cross_building | ||
from conans import CMake | ||
import os | ||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "compiler", "build_type", "arch" | ||
generators = "cmake", "cmake_find_package" | ||
|
||
fail_timeout = '30s' | ||
abort_timeout = '35s' | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure(defs={'CONAN_CMAKE_SILENT_OUTPUT': 'ON'}) | ||
cmake.build() | ||
|
||
def test(self): | ||
with tools.environment_append(RunEnvironment(self).vars): | ||
# TODO: Temporarily restricting tests to run for one build_type only, since running multiple | ||
# at the same time cause the tests and builds to fail | ||
if self.settings.build_type == 'Debug': | ||
self.run("echo $(pwd)") | ||
bin_path = os.path.join("../../", "run_tests.sh") | ||
if self.settings.os == "Windows": | ||
self.run(bin_path) | ||
elif self.settings.os == "Macos": | ||
self.run("DYLD_LIBRARY_PATH=%s %s" % (os.environ.get('DYLD_LIBRARY_PATH', ''), bin_path)) | ||
else: | ||
bin_path = "timeout -k {} {} {}".format(self.abort_timeout, self.fail_timeout, bin_path) | ||
self.run("LD_LIBRARY_PATH=%s %s" % (os.environ.get('LD_LIBRARY_PATH', ''), bin_path)) | ||
if not cross_building(self): | ||
sbin_path = os.path.join("bin", "example_server") | ||
cbin_path = os.path.join("bin", "example_client") | ||
self.run(sbin_path, run_environment=True) | ||
self.run(cbin_path, run_environment=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters