Skip to content

Commit

Permalink
Add SdeventQueue to ServicesTests and update it to latest coding stan…
Browse files Browse the repository at this point in the history
…dards
  • Loading branch information
Oipo committed Sep 27, 2024
1 parent b9413ae commit 48a91dc
Show file tree
Hide file tree
Showing 12 changed files with 252 additions and 58 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG CONTAINER_OWNER_GID=1000
ARG CONTAINER_OWNER_ID=1000

RUN apt update
RUN apt install -y g++-12 gcc-12 build-essential cmake pkg-config git wget ninja-build nano libzip-dev
RUN apt install -y g++-12 gcc-12 build-essential cmake pkg-config git wget ninja-build nano libzip-dev libsystemd-dev

RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 60
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 60
Expand Down Expand Up @@ -57,4 +57,4 @@ WORKDIR /opt/ichor/build

ENTRYPOINT ["/bin/bash", "-c"]

CMD ["unset CFLAGS CXXFLAGS LDFLAGS && cd /opt/ichor/build && cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DICHOR_USE_SANITIZERS=0 -DICHOR_USE_HIREDIS=1 -DICHOR_USE_BOOST_BEAST=1 -DICHOR_USE_SPDLOG=1 -DICHOR_SKIP_EXTERNAL_TESTS=1 /opt/ichor/src && ninja && /opt/ichor/src/bin/AsyncFileIOTests && ninja test"]
CMD ["unset CFLAGS CXXFLAGS LDFLAGS && cd /opt/ichor/build && cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DICHOR_USE_SANITIZERS=0 -DICHOR_USE_HIREDIS=1 -DICHOR_USE_BOOST_BEAST=1 -DICHOR_USE_SPDLOG=1 -DICHOR_USE_SDEVENT=1 -DICHOR_SKIP_EXTERNAL_TESTS=1 /opt/ichor/src && ninja && /opt/ichor/src/bin/AsyncFileIOTests && ninja test"]
4 changes: 2 additions & 2 deletions Dockerfile-asan
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG CONTAINER_OWNER_GID=1000
ARG CONTAINER_OWNER_ID=1000

RUN apt update
RUN apt install -y g++-12 gcc-12 build-essential cmake pkg-config git wget ninja-build nano libzip-dev
RUN apt install -y g++-12 gcc-12 build-essential cmake pkg-config git wget ninja-build nano libzip-dev libsystemd-dev

RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 60
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 60
Expand Down Expand Up @@ -57,4 +57,4 @@ WORKDIR /opt/ichor/build

ENTRYPOINT ["/bin/bash", "-c"]

CMD ["unset CFLAGS CXXFLAGS && cd /opt/ichor/build && cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DICHOR_USE_SANITIZERS=1 -DICHOR_USE_HIREDIS=1 -DICHOR_USE_BOOST_BEAST=1 -DICHOR_USE_SPDLOG=1 -DICHOR_SKIP_EXTERNAL_TESTS=1 /opt/ichor/src && ninja && ninja test"]
CMD ["unset CFLAGS CXXFLAGS && cd /opt/ichor/build && cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DICHOR_USE_SANITIZERS=1 -DICHOR_USE_HIREDIS=1 -DICHOR_USE_BOOST_BEAST=1 -DICHOR_USE_SPDLOG=1 -DICHOR_USE_SDEVENT=1 -DICHOR_SKIP_EXTERNAL_TESTS=1 /opt/ichor/src && ninja && ninja test"]
4 changes: 2 additions & 2 deletions Dockerfile-asan-clang
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG CONTAINER_OWNER_ID=1000

RUN apt update && apt-get install -y wget lsb-release software-properties-common gnupg
RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 18 all
RUN apt install -y cmake pkg-config git ninja-build nano libzip-dev clang-18 libc++-18-dev libc++abi-18-dev libclang-rt-18-dev
RUN apt install -y cmake pkg-config git ninja-build nano libzip-dev clang-18 libc++-18-dev libc++abi-18-dev libclang-rt-18-dev libsystemd-dev

# Run all downloads first to be able to use Docker's layers as cache and prevent excessive redownloads

Expand Down Expand Up @@ -61,4 +61,4 @@ WORKDIR /opt/ichor/build

ENTRYPOINT ["/bin/bash", "-c"]

CMD ["unset CFLAGS CXXFLAGS && cd /opt/ichor/build && cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DICHOR_USE_SANITIZERS=1 -DICHOR_USE_HIREDIS=1 -DICHOR_USE_BOOST_BEAST=1 -DICHOR_USE_SPDLOG=1 -DICHOR_SKIP_EXTERNAL_TESTS=1 /opt/ichor/src && ninja && ninja test"]
CMD ["unset CFLAGS CXXFLAGS && cd /opt/ichor/build && cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DICHOR_USE_SANITIZERS=1 -DICHOR_USE_HIREDIS=1 -DICHOR_USE_BOOST_BEAST=1 -DICHOR_USE_SPDLOG=1 -DICHOR_USE_SDEVENT=1 -DICHOR_SKIP_EXTERNAL_TESTS=1 /opt/ichor/src && ninja && ninja test"]
4 changes: 2 additions & 2 deletions Dockerfile-clang
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG CONTAINER_OWNER_ID=1000

RUN apt update && apt-get install -y wget lsb-release software-properties-common gnupg
RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 18 all
RUN apt install -y cmake libssl-dev pkg-config git ninja-build nano libzip-dev clang-18
RUN apt install -y cmake libssl-dev pkg-config git ninja-build nano libzip-dev clang-18 libsystemd-dev

# Run all downloads first to be able to use Docker's layers as cache and prevent excessive redownloads

Expand Down Expand Up @@ -51,4 +51,4 @@ WORKDIR /opt/ichor/build

ENTRYPOINT ["/bin/bash", "-c"]

CMD ["unset CFLAGS CXXFLAGS LDFLAGS && cd /opt/ichor/build && cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DICHOR_USE_SANITIZERS=0 -DICHOR_USE_HIREDIS=1 -DICHOR_USE_BOOST_BEAST=1 -DICHOR_USE_SPDLOG=1 -DICHOR_SKIP_EXTERNAL_TESTS=1 /opt/ichor/src && ninja && ninja test"]
CMD ["unset CFLAGS CXXFLAGS LDFLAGS && cd /opt/ichor/build && cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DICHOR_USE_SANITIZERS=0 -DICHOR_USE_HIREDIS=1 -DICHOR_USE_BOOST_BEAST=1 -DICHOR_USE_SPDLOG=1 -DICHOR_USE_SDEVENT=1 -DICHOR_SKIP_EXTERNAL_TESTS=1 /opt/ichor/src && ninja && ninja test"]
4 changes: 2 additions & 2 deletions Dockerfile-tsan
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG CONTAINER_OWNER_GID=1000
ARG CONTAINER_OWNER_ID=1000

RUN apt update
RUN apt install -y g++-12 gcc-12 build-essential cmake pkg-config git wget ninja-build nano libzip-dev
RUN apt install -y g++-12 gcc-12 build-essential cmake pkg-config git wget ninja-build nano libzip-dev libsystemd-dev

RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 60
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 60
Expand Down Expand Up @@ -86,4 +86,4 @@ WORKDIR /opt/ichor/build

ENTRYPOINT ["/bin/bash", "-c"]

CMD ["unset CFLAGS CXXFLAGS && cd /opt/ichor/build && cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DICHOR_USE_SANITIZERS=0 -DICHOR_USE_MIMALLOC=0 -DICHOR_USE_THREAD_SANITIZER=1 -DICHOR_USE_HIREDIS=1 -DICHOR_USE_BOOST_BEAST=1 -DICHOR_USE_SPDLOG=1 -DICHOR_USE_BACKWARD=0 -DICHOR_SKIP_EXTERNAL_TESTS=1 /opt/ichor/src && ninja && ninja test"]
CMD ["unset CFLAGS CXXFLAGS && cd /opt/ichor/build && cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DICHOR_USE_SANITIZERS=0 -DICHOR_USE_MIMALLOC=0 -DICHOR_USE_THREAD_SANITIZER=1 -DICHOR_USE_HIREDIS=1 -DICHOR_USE_BOOST_BEAST=1 -DICHOR_USE_SPDLOG=1 -DICHOR_USE_BACKWARD=0 -DICHOR_USE_SDEVENT=1 -DICHOR_SKIP_EXTERNAL_TESTS=1 /opt/ichor/src && ninja && ninja test"]
12 changes: 6 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,43 +115,43 @@ fi

# Quick libcpp compile check
rm -rf ./* ../bin/*
CC=clang-19 CXX=clang++-19 cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DICHOR_USE_SANITIZERS=0 -DICHOR_ENABLE_INTERNAL_DEBUGGING=0 -DICHOR_USE_MOLD=1 -DICHOR_USE_BOOST_BEAST=1 -DICHOR_USE_SPDLOG=1 -DICHOR_USE_HIREDIS=1 -DICHOR_USE_LIBURING=1 .. || exit 1
CC=clang-19 CXX=clang++-19 cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DICHOR_USE_SANITIZERS=0 -DICHOR_ENABLE_INTERNAL_DEBUGGING=0 -DICHOR_USE_MOLD=1 -DICHOR_USE_BOOST_BEAST=1 -DICHOR_USE_SPDLOG=1 -DICHOR_USE_HIREDIS=1 -DICHOR_USE_LIBURING=1 -DICHOR_USE_SDEVENT=1 .. || exit 1
ninja || exit 1
ninja test || exit 1
run_examples 1 1

rm -rf ./* ../bin/*
CC=gcc-12 CXX=g++-12 cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DICHOR_FORCE_32_BIT=1 -DICHOR_USE_SANITIZERS=0 -DICHOR_ENABLE_INTERNAL_DEBUGGING=0 -DICHOR_USE_MOLD=1 -DICHOR_USE_BOOST_BEAST=0 -DICHOR_USE_SPDLOG=1 -DICHOR_USE_HIREDIS=0 -DICHOR_USE_LIBURING=1 .. || exit 1
CC=gcc-12 CXX=g++-12 cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DICHOR_FORCE_32_BIT=1 -DICHOR_USE_SANITIZERS=0 -DICHOR_ENABLE_INTERNAL_DEBUGGING=0 -DICHOR_USE_MOLD=1 -DICHOR_USE_BOOST_BEAST=0 -DICHOR_USE_SPDLOG=1 -DICHOR_USE_HIREDIS=0 -DICHOR_USE_LIBURING=1 -DICHOR_USE_SDEVENT=1 .. || exit 1
ninja || exit 1
ninja test || exit 1
run_examples 0 1

for i in ${!ccompilers[@]}; do
export LD_LIBRARY_PATH=${ldlibpath[i]}
rm -rf ./* ../bin/*
CC=${ccompilers[i]} CXX=${cppcompilers[i]} cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DICHOR_USE_SANITIZERS=1 -DICHOR_ENABLE_INTERNAL_DEBUGGING=1 -DICHOR_USE_MOLD=1 -DICHOR_USE_BOOST_BEAST=1 -DICHOR_USE_LIBCPP=0 -DICHOR_USE_HIREDIS=1 .. || exit 1
CC=${ccompilers[i]} CXX=${cppcompilers[i]} cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DICHOR_USE_SANITIZERS=1 -DICHOR_ENABLE_INTERNAL_DEBUGGING=1 -DICHOR_USE_MOLD=1 -DICHOR_USE_BOOST_BEAST=1 -DICHOR_USE_LIBCPP=0 -DICHOR_USE_HIREDIS=1 -DICHOR_USE_SDEVENT=1 .. || exit 1
ninja || exit 1
ninja test || exit 1
run_examples 1 1
run_benchmarks

rm -rf ./* ../bin/*
CC=${ccompilers[i]} CXX=${cppcompilers[i]} cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DICHOR_USE_SANITIZERS=1 -DICHOR_ENABLE_INTERNAL_DEBUGGING=1 -DICHOR_DISABLE_RTTI=0 -DICHOR_USE_MOLD=1 -DICHOR_USE_BOOST_BEAST=0 -DICHOR_USE_LIBCPP=0 -DICHOR_USE_SPDLOG=1 -DICHOR_USE_HIREDIS=1 .. || exit 1
CC=${ccompilers[i]} CXX=${cppcompilers[i]} cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DICHOR_USE_SANITIZERS=1 -DICHOR_ENABLE_INTERNAL_DEBUGGING=1 -DICHOR_DISABLE_RTTI=0 -DICHOR_USE_MOLD=1 -DICHOR_USE_BOOST_BEAST=0 -DICHOR_USE_LIBCPP=0 -DICHOR_USE_SPDLOG=1 -DICHOR_USE_HIREDIS=1 -DICHOR_USE_SDEVENT=1 .. || exit 1
ninja || exit 1
ninja test || exit 1
run_examples 0 1
run_benchmarks

rm -rf ./* ../bin/*
CC=${ccompilers[i]} CXX=${cppcompilers[i]} cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DICHOR_REMOVE_SOURCE_NAMES=0 -DICHOR_USE_SANITIZERS=0 -DICHOR_ENABLE_INTERNAL_DEBUGGING=1 -DICHOR_USE_MOLD=1 -DICHOR_USE_BOOST_BEAST=1 -DICHOR_USE_LIBCPP=0 -DICHOR_USE_HIREDIS=1 .. || exit 1
CC=${ccompilers[i]} CXX=${cppcompilers[i]} cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DICHOR_REMOVE_SOURCE_NAMES=0 -DICHOR_USE_SANITIZERS=0 -DICHOR_ENABLE_INTERNAL_DEBUGGING=1 -DICHOR_USE_MOLD=1 -DICHOR_USE_BOOST_BEAST=1 -DICHOR_USE_LIBCPP=0 -DICHOR_USE_HIREDIS=1 -DICHOR_USE_SDEVENT=1 .. || exit 1
ninja || exit 1
ninja test || exit 1
run_examples 1 1
run_benchmarks
done

rm -rf ./* ../bin/*
CC=clang-19 CXX=clang++-19 cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DICHOR_USE_SANITIZERS=0 -DICHOR_USE_MOLD=1 -DICHOR_USE_BOOST_BEAST=1 -DICHOR_USE_HIREDIS=1 .. || exit 1
CC=clang-19 CXX=clang++-19 cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DICHOR_USE_SANITIZERS=0 -DICHOR_USE_MOLD=1 -DICHOR_USE_BOOST_BEAST=1 -DICHOR_USE_HIREDIS=1 -DICHOR_USE_SDEVENT=1 .. || exit 1
ninja || exit 1
ninja test || exit 1
run_examples 1 1
Expand Down
22 changes: 16 additions & 6 deletions include/ichor/event_queues/ISdeventQueue.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
//
// Created by oipo on 27-9-24.
//
#pragma once

#ifndef ICHOR_ISDEVENTQUEUE_H
#define ICHOR_ISDEVENTQUEUE_H
#ifndef ICHOR_USE_SDEVENT
#error "Ichor has not been compiled with io_uring support"
#endif

#endif //ICHOR_ISDEVENTQUEUE_H
#include <ichor/stl/NeverAlwaysNull.h>
#include <ichor/event_queues/IEventQueue.h>

struct sd_event;

namespace Ichor {
class ISdeventQueue : public IEventQueue {
public:
~ISdeventQueue() override = default;
[[nodiscard]] virtual NeverNull<sd_event*> getLoop() noexcept = 0;
};
}
7 changes: 5 additions & 2 deletions include/ichor/event_queues/SdeventQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@

#include <ichor/stl/RealtimeReadWriteMutex.h>
#include <ichor/stl/ConditionVariableAny.h>
#include <ichor/event_queues/IEventQueue.h>
#include <ichor/event_queues/ISdeventQueue.h>
#include <systemd/sd-event.h>
#include <atomic>
#include <thread>

#include <map>

namespace Ichor {
class SdeventQueue final : public IEventQueue {
class SdeventQueue final : public ISdeventQueue {
public:
SdeventQueue();
explicit SdeventQueue(uint64_t unused);
~SdeventQueue() final;

void pushEventInternal(uint64_t priority, std::unique_ptr<Event> &&event) final;
Expand All @@ -32,6 +33,8 @@ namespace Ichor {
[[nodiscard]] bool shouldQuit() final;
void quit() final;

[[nodiscard]] NeverNull<sd_event*> getLoop() noexcept final;

private:
void registerEventFd();
void registerTimer();
Expand Down
2 changes: 1 addition & 1 deletion quickbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters
rm -rf ./*
rm -rf ../bin/*

CC=${CCOMP} CXX=${CXXCOMP} cmake -DCMAKE_BUILD_TYPE=${BUILDTYPE} -DICHOR_REMOVE_SOURCE_NAMES=0 -DICHOR_ENABLE_INTERNAL_DEBUGGING=${DEBUG} -DICHOR_ENABLE_INTERNAL_IO_DEBUGGING=${IODEBUG} -DICHOR_ARCH_OPTIMIZATION=X86_64_AVX2 -DICHOR_USE_BACKWARD=0 -DICHOR_USE_BOOST_BEAST=${BOOST} -DICHOR_USE_HIREDIS=1 -DICHOR_USE_LIBCPP=0 -DICHOR_USE_SANITIZERS=${ASAN} -DICHOR_USE_THREAD_SANITIZER=${TSAN} -DICHOR_USE_MOLD=1 -DICHOR_USE_SPDLOG=0 -GNinja .. || exit 1
CC=${CCOMP} CXX=${CXXCOMP} cmake -DCMAKE_BUILD_TYPE=${BUILDTYPE} -DICHOR_REMOVE_SOURCE_NAMES=0 -DICHOR_ENABLE_INTERNAL_DEBUGGING=${DEBUG} -DICHOR_ENABLE_INTERNAL_IO_DEBUGGING=${IODEBUG} -DICHOR_ARCH_OPTIMIZATION=X86_64_AVX2 -DICHOR_USE_BACKWARD=0 -DICHOR_USE_BOOST_BEAST=${BOOST} -DICHOR_USE_HIREDIS=1 -DICHOR_USE_LIBCPP=0 -DICHOR_USE_SANITIZERS=${ASAN} -DICHOR_USE_THREAD_SANITIZER=${TSAN} -DICHOR_USE_MOLD=1 -DICHOR_USE_SDEVENT=1 -DICHOR_USE_SPDLOG=0 -GNinja .. || exit 1

ninja || exit 1
ninja test || exit 1
Expand Down
25 changes: 23 additions & 2 deletions src/ichor/event_queues/SdeventQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <ichor/event_queues/SdeventQueue.h>
#include <ichor/DependencyManager.h>
#include <ichor/dependency_management/InternalServiceLifecycleManager.h>
#include <sys/eventfd.h>

namespace Ichor::Detail {
Expand All @@ -18,7 +19,12 @@ namespace Ichor {

SdeventQueue::SdeventQueue() {
_eventfd = eventfd(0, EFD_NONBLOCK | EFD_SEMAPHORE);
_threadId = std::this_thread::get_id();
_threadId = std::this_thread::get_id(); // re-set in functions below, because adding events when the queue isn't running yet cannot be done from another thread.
}

SdeventQueue::SdeventQueue(uint64_t unused) {
_eventfd = eventfd(0, EFD_NONBLOCK | EFD_SEMAPHORE);
_threadId = std::this_thread::get_id(); // re-set in functions below, because adding events when the queue isn't running yet cannot be done from another thread.
}

SdeventQueue::~SdeventQueue() {
Expand Down Expand Up @@ -140,6 +146,7 @@ namespace Ichor {

registerEventFd();
registerTimer();
_threadId = std::this_thread::get_id();

_initializedSdevent.store(true, std::memory_order_release);
return _eventQueue;
Expand All @@ -150,12 +157,13 @@ namespace Ichor {
_eventQueue = event;
registerEventFd();
registerTimer();
_threadId = std::this_thread::get_id();
_initializedSdevent.store(true, std::memory_order_release);
}

bool SdeventQueue::start(bool captureSigInt) {
if(!_initializedSdevent.load(std::memory_order_acquire)) [[unlikely]] {
fmt::println("IOUringQueue not initialized. Call createEventLoop or useEventLoop first.");
fmt::println("SdeventQueue not initialized. Call createEventLoop or useEventLoop first.");
return false;
}

Expand All @@ -164,6 +172,11 @@ namespace Ichor {
return false;
}

if(std::this_thread::get_id() != _threadId) [[unlikely]] {
fmt::println("Creation of ring and start() have to be on the same thread.");
std::terminate();
}

// this capture currently has no way to wake all queues. Multimap f.e. polls sigintQuit, but with sdevent the
if(captureSigInt && !Ichor::Detail::registeredSignalHandler.exchange(true)) {
if (::signal(SIGINT, Ichor::Detail::on_sigint) == SIG_ERR) {
Expand All @@ -172,6 +185,8 @@ namespace Ichor {
}
}

addInternalServiceManager(std::make_unique<Detail::InternalServiceLifecycleManager<ISdeventQueue>>(this));

startDm();

return true;
Expand Down Expand Up @@ -202,6 +217,8 @@ namespace Ichor {
sd_event_exit(q->_eventQueue, 0);
sd_event_source_unref(source);

q->stopDm();

return 0;
}, this);

Expand Down Expand Up @@ -267,6 +284,10 @@ namespace Ichor {
throw std::system_error(-ret, std::generic_category(), "sd_event_add_io() failed");
}
}

NeverNull<sd_event *> SdeventQueue::getLoop() noexcept {
return _eventQueue;
}
}

#endif
12 changes: 11 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ foreach(filename ${PROJECT_TEST_SOURCES})
if(ICHOR_SKIP_EXTERNAL_TESTS)
target_compile_definitions(${testname} PUBLIC ICHOR_SKIP_EXTERNAL_TESTS)
endif()
if(ICHOR_USE_LIBURING AND NOT WIN32 AND NOT APPLE AND NOT (ICHOR_SKIP_EXTERNAL_TESTS AND ICHOR_AARCH64))
if(ICHOR_USE_LIBURING AND NOT (ICHOR_SKIP_EXTERNAL_TESTS AND ICHOR_AARCH64))
if(${testname} STREQUAL "TcpTests" OR ${testname} STREQUAL "AsyncFileIOTests" OR ${testname} STREQUAL "ServicesTests")
add_executable(${testname}_uring ${filename})
target_link_libraries(${testname}_uring ${CMAKE_THREAD_LIBS_INIT})
Expand All @@ -38,6 +38,16 @@ foreach(filename ${PROJECT_TEST_SOURCES})
catch_discover_tests(${testname}_uring)
endif()
endif()
if(ICHOR_USE_SDEVENT AND NOT (ICHOR_SKIP_EXTERNAL_TESTS AND ICHOR_AARCH64))
if(${testname} STREQUAL "ServicesTests")
add_executable(${testname}_sdevent ${filename})
target_link_libraries(${testname}_sdevent ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(${testname}_sdevent ichor)
target_link_libraries(${testname}_sdevent Catch2::Catch2WithMain)
target_compile_definitions(${testname}_sdevent PUBLIC CATCH_CONFIG_FAST_COMPILE TEST_SDEVENT)
catch_discover_tests(${testname}_sdevent)
endif()
endif()
if(${testname} STREQUAL "ServicesTests")
add_executable(${testname}_ordered ${filename})
target_link_libraries(${testname}_ordered ${CMAKE_THREAD_LIBS_INIT})
Expand Down
Loading

0 comments on commit 48a91dc

Please sign in to comment.