-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from szmyd/master
More github.com related changes.
- Loading branch information
Showing
5 changed files
with
88 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
cmake_minimum_required(VERSION 3.11) | ||
project(test_package LANGUAGES CXX) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup(TARGETS) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
find_package (Threads REQUIRED) | ||
find_package (iomgr REQUIRED) | ||
|
||
link_directories(${spdk_LIB_DIRS} ${dpdk_LIB_DIRS}) | ||
|
||
add_executable(test_package) | ||
target_sources(test_package PRIVATE test_package.cpp) | ||
target_link_libraries(test_package | ||
iomgr::iomgr | ||
${spdk_LIBRARY_LIST} | ||
${dpdk_LIBRARY_LIST} | ||
) |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import os | ||
from conan import ConanFile | ||
from conans import CMake | ||
from conan.tools.build import cross_building | ||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "compiler", "build_type", "arch" | ||
generators = "cmake", "cmake_find_package" | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def test(self): | ||
if not cross_building(self): | ||
bin_path = os.path.join("bin", "test_package") | ||
self.run(f"{bin_path} -c -h", 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include <boost/uuid/random_generator.hpp> | ||
#include <boost/uuid/uuid_io.hpp> | ||
#include <condition_variable> | ||
#include <mutex> | ||
|
||
/* Facility headers */ | ||
#include <sisl/logging/logging.h> | ||
#include <sisl/options/options.h> | ||
|
||
/* IOPath */ | ||
#include <iomgr/io_environment.hpp> | ||
|
||
SISL_OPTION_GROUP(test_hs_vol, | ||
(io_threads, "", "io_threads", "Number of IO threads", | ||
cxxopts::value<uint32_t>()->default_value("1"), "count")) | ||
|
||
#define ENABLED_OPTIONS logging, iomgr, test_hs_vol, config | ||
#define SPDK_LOG_MODS IOMGR_LOG_MODS, flip | ||
|
||
SISL_OPTIONS_ENABLE(ENABLED_OPTIONS) | ||
SISL_LOGGING_INIT(SPDK_LOG_MODS) | ||
|
||
constexpr size_t Ki = 1024; | ||
constexpr size_t Mi = Ki * Ki; | ||
constexpr size_t Gi = Ki * Mi; | ||
|
||
int main(int argc, char* argv[]) { | ||
SISL_OPTIONS_LOAD(argc, argv, ENABLED_OPTIONS) | ||
sisl::logging::SetLogger("spdk_volume"); | ||
sisl::logging::install_crash_handler(); | ||
spdlog::set_pattern("[%D %T.%e] [%^%l%$] [%t] %v"); | ||
|
||
// Start the IOManager | ||
ioenvironment.with_iomgr(SISL_OPTIONS["io_threads"].as<uint32_t>(), true); | ||
|
||
iomanager.stop(); | ||
LOGINFO("Done."); | ||
return 0; | ||
} |