summaryrefslogtreecommitdiffstats
path: root/src/seastar/tests/dist/consumer
diff options
context:
space:
mode:
Diffstat (limited to 'src/seastar/tests/dist/consumer')
-rw-r--r--src/seastar/tests/dist/consumer/CMakeLists.txt51
-rw-r--r--src/seastar/tests/dist/consumer/Makefile38
-rw-r--r--src/seastar/tests/dist/consumer/cmake_consumer.cc15
-rw-r--r--src/seastar/tests/dist/consumer/cmake_testing_consumer.cc13
-rw-r--r--src/seastar/tests/dist/consumer/pkgconfig_consumer.cc15
-rw-r--r--src/seastar/tests/dist/consumer/pkgconfig_testing_consumer.cc15
-rw-r--r--src/seastar/tests/dist/consumer/recipe/test_dist.cmake43
7 files changed, 190 insertions, 0 deletions
diff --git a/src/seastar/tests/dist/consumer/CMakeLists.txt b/src/seastar/tests/dist/consumer/CMakeLists.txt
new file mode 100644
index 00000000..4130239a
--- /dev/null
+++ b/src/seastar/tests/dist/consumer/CMakeLists.txt
@@ -0,0 +1,51 @@
+#
+# This file is open source software, licensed to you under the terms
+# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
+# distributed with this work for additional information regarding copyright
+# ownership. You may not use this file except in compliance with the License.
+#
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+#
+# Copyright (C) 2018 Scylladb, Ltd.
+#
+
+cmake_minimum_required (VERSION 3.5)
+
+list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+include (Cooking OPTIONAL)
+
+project (SeastarConsumer)
+
+find_package (Boost 1.64.0 REQUIRED
+ COMPONENTS unit_test_framework)
+
+find_package (Seastar 1.0 REQUIRED)
+
+add_executable (cmake_consumer
+ cmake_consumer.cc)
+
+target_link_libraries (cmake_consumer
+ PRIVATE Seastar::seastar)
+
+add_executable (cmake_testing_consumer
+ cmake_testing_consumer.cc)
+
+target_compile_definitions (cmake_testing_consumer
+ PRIVATE SEASTAR_TESTING_MAIN)
+
+target_link_libraries (cmake_testing_consumer
+ PRIVATE
+ Boost::unit_test_framework
+ Seastar::seastar
+ Seastar::seastar_testing)
diff --git a/src/seastar/tests/dist/consumer/Makefile b/src/seastar/tests/dist/consumer/Makefile
new file mode 100644
index 00000000..d84aa1e7
--- /dev/null
+++ b/src/seastar/tests/dist/consumer/Makefile
@@ -0,0 +1,38 @@
+#
+# This file is open source software, licensed to you under the terms
+# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
+# distributed with this work for additional information regarding copyright
+# ownership. You may not use this file except in compliance with the License.
+#
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+#
+# Copyright (C) 2018 Scylladb, Ltd.
+#
+
+# Required environmental variables:
+#
+# BUILD_DIR
+
+.PHONY: prepare
+
+all: pkgconfig_consumer pkgconfig_testing_consumer
+
+pkgconfig_consumer: pkgconfig_consumer.cc prepare
+ $(CXX) $< `pkg-config seastar --cflags --libs --static` -o $(BUILD_DIR)/$@
+
+pkgconfig_testing_consumer: pkgconfig_testing_consumer.cc prepare
+ $(CXX) $< `pkg-config seastar seastar-testing --cflags --libs --static` -o $(BUILD_DIR)/$@
+
+prepare:
+ mkdir -p $(BUILD_DIR)
diff --git a/src/seastar/tests/dist/consumer/cmake_consumer.cc b/src/seastar/tests/dist/consumer/cmake_consumer.cc
new file mode 100644
index 00000000..ebdc060d
--- /dev/null
+++ b/src/seastar/tests/dist/consumer/cmake_consumer.cc
@@ -0,0 +1,15 @@
+#include <iostream>
+
+#include <seastar/core/app-template.hh>
+#include <seastar/core/future.hh>
+
+namespace sr = seastar;
+
+int main(int argc, char** argv) {
+ sr::app_template app;
+
+ return app.run(argc, argv, [] {
+ std::cout << "\"Hello\" from the Seastar CMake consumer!\n";
+ return sr::make_ready_future<>();
+ });
+}
diff --git a/src/seastar/tests/dist/consumer/cmake_testing_consumer.cc b/src/seastar/tests/dist/consumer/cmake_testing_consumer.cc
new file mode 100644
index 00000000..a2dc6656
--- /dev/null
+++ b/src/seastar/tests/dist/consumer/cmake_testing_consumer.cc
@@ -0,0 +1,13 @@
+#include <iostream>
+
+#include <seastar/core/future.hh>
+#include <seastar/testing/test_case.hh>
+
+namespace sr = seastar;
+
+SEASTAR_TEST_CASE(greeting) {
+ return sr::make_ready_future<>().then([] {
+ BOOST_REQUIRE(true);
+ std::cout << "\"Hello\" from the Seastar CMake testing consumer!\n";
+ });
+}
diff --git a/src/seastar/tests/dist/consumer/pkgconfig_consumer.cc b/src/seastar/tests/dist/consumer/pkgconfig_consumer.cc
new file mode 100644
index 00000000..a0cce755
--- /dev/null
+++ b/src/seastar/tests/dist/consumer/pkgconfig_consumer.cc
@@ -0,0 +1,15 @@
+#include <iostream>
+
+#include <seastar/core/app-template.hh>
+#include <seastar/core/future.hh>
+
+namespace sr = seastar;
+
+int main(int argc, char** argv) {
+ sr::app_template app;
+
+ return app.run(argc, argv, [] {
+ std::cout << "\"Hello\" from the Seastar pkg-config consumer!\n";
+ return sr::make_ready_future<>();
+ });
+}
diff --git a/src/seastar/tests/dist/consumer/pkgconfig_testing_consumer.cc b/src/seastar/tests/dist/consumer/pkgconfig_testing_consumer.cc
new file mode 100644
index 00000000..f3948a31
--- /dev/null
+++ b/src/seastar/tests/dist/consumer/pkgconfig_testing_consumer.cc
@@ -0,0 +1,15 @@
+#define SEASTAR_TESTING_MAIN
+
+#include <iostream>
+
+#include <seastar/core/future.hh>
+#include <seastar/testing/test_case.hh>
+
+namespace sr = seastar;
+
+SEASTAR_TEST_CASE(greeting) {
+ return sr::make_ready_future<>().then([] {
+ BOOST_REQUIRE(true);
+ std::cout << "\"Hello\" from the Seastar pkg-config testing consumer!\n";
+ });
+}
diff --git a/src/seastar/tests/dist/consumer/recipe/test_dist.cmake b/src/seastar/tests/dist/consumer/recipe/test_dist.cmake
new file mode 100644
index 00000000..9ebf5967
--- /dev/null
+++ b/src/seastar/tests/dist/consumer/recipe/test_dist.cmake
@@ -0,0 +1,43 @@
+cmake_host_system_information (
+ RESULT build_concurrency_factor
+ QUERY NUMBER_OF_LOGICAL_CORES)
+
+set (make_command make -j ${build_concurrency_factor})
+
+cooking_ingredient (Boost
+ EXTERNAL_PROJECT_ARGS
+ # The 1.67.0 release has a bug in Boost Lockfree around a missing header.
+ URL https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.gz
+ URL_MD5 319c6ffbbeccc366f14bb68767a6db79
+ PATCH_COMMAND
+ ./bootstrap.sh
+ --prefix=<INSTALL_DIR>
+ --with-libraries=atomic,chrono,date_time,filesystem,program_options,system,test,thread
+ CONFIGURE_COMMAND <DISABLE>
+ BUILD_COMMAND <DISABLE>
+ INSTALL_COMMAND
+ ${CMAKE_COMMAND} -E chdir <SOURCE_DIR>
+ ./b2
+ -j ${build_concurrency_factor}
+ --layout=system
+ --build-dir=<BINARY_DIR>
+ install
+ variant=debug
+ link=shared
+ threading=multi
+ hardcode-dll-paths=true
+ dll-path=<INSTALL_DIR>/lib)
+
+cooking_ingredient (Seastar
+ REQUIRES Boost
+ COOKING_RECIPE dev
+ COOKING_CMAKE_ARGS
+ # Not `lib64`.
+ -DCMAKE_INSTALL_LIBDIR=lib
+ -DSeastar_APPS=OFF
+ -DSeastar_DOCS=OFF
+ -DSeastar_DEMOS=OFF
+ -DSeastar_DPDK=ON
+ -DSeastar_TESTING=OFF
+ EXTERNAL_PROJECT_ARGS
+ SOURCE_DIR $ENV{SEASTAR_SOURCE_DIR})