Skip to content

Commit

Permalink
Homework completed
Browse files Browse the repository at this point in the history
  • Loading branch information
BaqWin committed Apr 27, 2024
1 parent 911bd2e commit 4efd4cf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
6 changes: 3 additions & 3 deletions homework/schedule/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)

include_directories(.)

add_executable(${PROJECT_NAME} main.cpp)
add_executable(${PROJECT_NAME}-ut tests/catch/catch_amalgamated.cpp tests/catch/catch_main.cpp tests/tests.cpp)
add_executable(${PROJECT_NAME}-ut-bonus tests/catch/catch_amalgamated.cpp tests/catch/catch_main.cpp tests/tests-bonus.cpp)
add_executable(${PROJECT_NAME} main.cpp schedule.hpp)
add_executable(${PROJECT_NAME}-ut schedule.hpp tests/catch/catch_amalgamated.cpp tests/catch/catch_main.cpp tests/tests.cpp)
add_executable(${PROJECT_NAME}-ut-bonus schedule.hpp tests/catch/catch_amalgamated.cpp tests/catch/catch_main.cpp tests/tests-bonus.cpp)

target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Werror -Wpedantic)
target_compile_options(${PROJECT_NAME}-ut PRIVATE -Wall -Wextra -Werror -Wpedantic)
Expand Down
9 changes: 9 additions & 0 deletions homework/schedule/schedule.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#pragma once
#include <functional>
#include <thread>

template<typename Func, typename Sec, typename... Data>
void schedule(Func func, Sec sec, Data... d) {
std::this_thread::sleep_for(sec);
func(std::forward<Data>(d)...);
}
2 changes: 1 addition & 1 deletion homework/schedule/tests/catch/catch_amalgamated.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ namespace Catch {
multi->addListener(listener->create(config));
}

std::size_t reporterIdx = 0;
[[maybe_unused]] std::size_t reporterIdx = 0;
for ( auto const& reporterSpec : config->getProcessedReporterSpecs() ) {
multi->addReporter( createReporter(
reporterSpec.name,
Expand Down

0 comments on commit 4efd4cf

Please sign in to comment.