diff --git a/cmake/Modules/FindCATCH.cmake b/cmake/Modules/FindCATCH.cmake deleted file mode 100644 index 4f6181c38..000000000 --- a/cmake/Modules/FindCATCH.cmake +++ /dev/null @@ -1,29 +0,0 @@ -#[[ -MIT License - -Copyright (c) 2013 NUClear Contributors - -This file is part of the NUClear codebase. -See https://github.com/Fastcode/NUClear for further info. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the -Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -]] - -include(HeaderLibrary) - -HeaderLibrary( - NAME CATCH - HEADER catch.hpp - URL "https://raw.githubusercontent.com/catchorg/Catch2/v2.x/single_include/catch2/catch.hpp" -) diff --git a/cmake/Modules/HeaderLibrary.cmake b/cmake/Modules/HeaderLibrary.cmake deleted file mode 100644 index 6fd31852e..000000000 --- a/cmake/Modules/HeaderLibrary.cmake +++ /dev/null @@ -1,93 +0,0 @@ -#[[ -MIT License - -Copyright (c) 2013 NUClear Contributors - -This file is part of the NUClear codebase. -See https://github.com/Fastcode/NUClear for further info. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the -Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -]] - -include(CMakeParseArguments) -function(HeaderLibrary) - # Extract the arguments from our function call - set(options, "") - set(oneValueArgs "NAME") - set(multiValueArgs "HEADER" "PATH_SUFFIX" "URL") - cmake_parse_arguments(PACKAGE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - - # Clear our required_vars variable - unset(required_vars) - set(OUTPUT_DIR "${CMAKE_BINARY_DIR}/include") - - # Find our include path - find_path( - "${PACKAGE_NAME}_INCLUDE_DIR" - NAMES ${PACKAGE_HEADER} - DOC "The ${PACKAGE_NAME} include directory" - PATHS "${OUTPUT_DIR}" - PATH_SUFFIXES ${PACKAGE_PATH_SUFFIX} - ) - - # File doesn't exist in standard search paths, download it - if(NOT ${PACKAGE_NAME}_INCLUDE_DIR) - - # Create the output folder if it doesn't already exist - if(NOT EXISTS "${OUTPUT_DIR}") - file(MAKE_DIRECTORY "${OUTPUT_DIR}") - endif() - - # Download file. - file(DOWNLOAD "${PACKAGE_URL}" "${OUTPUT_DIR}/${PACKAGE_HEADER}" STATUS ${PACKAGE_NAME}_STATUS) - - list(GET ${PACKAGE_NAME}_STATUS 0 ${PACKAGE_NAME}_STATUS_CODE) - list(GET ${PACKAGE_NAME}_STATUS 1 ${PACKAGE_NAME}_ERROR_STRING) - - # Parse download status - if(${PACKAGE_NAME}_STATUS_CODE EQUAL 0) - message(STATUS "Successfully downloaded ${PACKAGE_NAME} library.") - - set(${PACKAGE_NAME}_INCLUDE_DIR "${OUTPUT_DIR}") - - else() - message(ERROR "Failed to download ${PACKAGE_NAME} library. Error: ${${PACKAGE_NAME}_ERROR_STRING}") - file(REMOVE "${OUTPUT_DIR}/${PACKAGE_HEADER}") - endif() - endif() - - # Setup and export our variables - set(required_vars ${required_vars} "${PACKAGE_NAME}_INCLUDE_DIR") - set(${PACKAGE_NAME}_INCLUDE_DIRS - ${${PACKAGE_NAME}_INCLUDE_DIR} - PARENT_SCOPE - ) - mark_as_advanced(${PACKAGE_NAME}_INCLUDE_DIR ${PACKAGE_NAME}_INCLUDE_DIRS) - - # Find the package - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args( - ${PACKAGE_NAME} - FOUND_VAR ${PACKAGE_NAME}_FOUND - REQUIRED_VARS ${required_vars} - VERSION_VAR ${PACKAGE_NAME}_VERSION - ) - - # Export our found variable to parent scope - set(${PACKAGE_NAME}_FOUND - ${PACKAGE_NAME}_FOUND - PARENT_SCOPE - ) - -endfunction(HeaderLibrary) diff --git a/src/dsl/store/TypeCallbackStore.hpp b/src/dsl/store/TypeCallbackStore.hpp index 979b9ac82..bb1e085a7 100644 --- a/src/dsl/store/TypeCallbackStore.hpp +++ b/src/dsl/store/TypeCallbackStore.hpp @@ -33,13 +33,13 @@ namespace dsl { namespace store { /** - * @biref The main callback store for reactions that are executed when a paticular type is emitted. + * @brief The main callback store for reactions that are executed when a particular type is emitted. * * @details This store is the main location that callbacks that are executed on type are stored. * This method of storing is how the system realises compile time message dispatch. By storing each - * differnt type of message user in its own location the system knows exactly which reactions to - * execuing without having to do an expensive lookup. This reduces the latency and computational - * power invovled in spawning a new reaction when a type is emitted. + * different type of message user in its own location the system knows exactly which reactions to + * executing without having to do an expensive lookup. This reduces the latency and computational + * power involved in spawning a new reaction when a type is emitted. * * @tparam TriggeringType the type that when emitted will start this function */ diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2a1158efc..e77944aba 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -20,61 +20,65 @@ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER I OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ]] -find_package(CATCH) - -if(CATCH_FOUND) - # Supported options: - option(BUILD_TESTS "Builds all of the NUClear unit tests." TRUE) - - if(BUILD_TESTS) - enable_testing() - - add_compile_definitions(CATCH_CONFIG_CONSOLE_WIDTH=120) - - file( - GLOB - test_src - test.cpp - "api/*.cpp" - "dsl/*.cpp" - "dsl/emit/*.cpp" - "log/*.cpp" - "util/*.cpp" - "util/network/*.cpp" - "util/serialise/*.cpp" - ) - - file(GLOB test_util_src "test_util/*.cpp") - add_library(test_util STATIC ${test_util_src}) - target_link_libraries(test_util PUBLIC NUClear::nuclear) - target_include_directories( - test_util SYSTEM PUBLIC ${CATCH_INCLUDE_DIRS} ${PROJECT_BINARY_DIR}/include "${PROJECT_SOURCE_DIR}/src" - ) - - # Some tests must be executed as individual binaries - file(GLOB individual_tests "${CMAKE_CURRENT_SOURCE_DIR}/individual/*.cpp") - - foreach(test_src ${individual_tests}) - get_filename_component(test_name ${test_src} NAME_WE) - - add_executable(${test_name} ${test_src}) - target_link_libraries(${test_name} NUClear::nuclear test_util) - set_target_properties(${test_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/individual") - target_include_directories(${test_name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - # Enable warnings, and all warnings are errors - - add_test(${test_name} test_nuclear) - - endforeach(test_src) - - add_executable(test_nuclear ${test_src}) - target_include_directories(test_nuclear PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(test_nuclear NUClear::nuclear test_util) - add_test(test_nuclear test_nuclear) - - add_executable(test_network networktest.cpp) - target_link_libraries(test_network NUClear::nuclear test_util) - target_include_directories(test_network PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - - endif(BUILD_TESTS) -endif(CATCH_FOUND) +option(BUILD_TESTS "Builds all of the NUClear unit tests." TRUE) + +if(BUILD_TESTS) + # Get catch2 using FetchContent + include(FetchContent) + FetchContent_Declare( + Catch2 + GIT_SHALLOW TRUE + GIT_REPOSITORY https://github.com/catchorg/Catch2.git + GIT_TAG v3.6.0 + ) + FetchContent_MakeAvailable(Catch2) + + enable_testing() + + file( + GLOB + test_src + test.cpp + "api/*.cpp" + "dsl/*.cpp" + "dsl/emit/*.cpp" + "log/*.cpp" + "util/*.cpp" + "util/network/*.cpp" + "util/serialise/*.cpp" + ) + + # Create a test_util library that is used by all tests + file(GLOB test_util_src "test_util/*.cpp") + add_library(test_util STATIC ${test_util_src}) + target_link_libraries(test_util PUBLIC NUClear::nuclear) + target_include_directories( + test_util SYSTEM PUBLIC ${CATCH_INCLUDE_DIRS} ${PROJECT_BINARY_DIR}/include "${PROJECT_SOURCE_DIR}/src" + ) + + # Some tests must be executed as individual binaries + file(GLOB individual_tests "${CMAKE_CURRENT_SOURCE_DIR}/individual/*.cpp") + + foreach(test_src ${individual_tests}) + get_filename_component(test_name ${test_src} NAME_WE) + + add_executable(${test_name} ${test_src}) + target_link_libraries(${test_name} PRIVATE test_util) + target_link_libraries(${test_name} PRIVATE Catch2::Catch2WithMain) + set_target_properties(${test_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/individual") + target_include_directories(${test_name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + add_test(${test_name} test_nuclear) + endforeach(test_src) + + add_executable(test_nuclear ${test_src}) + target_include_directories(test_nuclear PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + target_link_libraries(test_nuclear test_util) + target_link_libraries(test_nuclear Catch2::Catch2WithMain) + add_test(test_nuclear test_nuclear) + + # Special test binary for testing NUClearNet + add_executable(test_network networktest.cpp) + target_link_libraries(test_network test_util) + target_include_directories(test_network PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + +endif(BUILD_TESTS) diff --git a/tests/api/ReactionHandle.cpp b/tests/api/ReactionHandle.cpp index e39ac071b..fe474cd5d 100644 --- a/tests/api/ReactionHandle.cpp +++ b/tests/api/ReactionHandle.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/api/ReactionStatistics.cpp b/tests/api/ReactionStatistics.cpp index b7ac15d7f..35e0d2138 100644 --- a/tests/api/ReactionStatistics.cpp +++ b/tests/api/ReactionStatistics.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/api/ReactorArgs.cpp b/tests/api/ReactorArgs.cpp index 07ba1ffd5..533e2bc77 100644 --- a/tests/api/ReactorArgs.cpp +++ b/tests/api/ReactorArgs.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include // Anonymous namespace to keep everything file local diff --git a/tests/dsl/Always.cpp b/tests/dsl/Always.cpp index a639e3ddb..dc0c668de 100644 --- a/tests/dsl/Always.cpp +++ b/tests/dsl/Always.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/dsl/ArgumentFission.cpp b/tests/dsl/ArgumentFission.cpp index 114455c8d..8f8ef98d1 100644 --- a/tests/dsl/ArgumentFission.cpp +++ b/tests/dsl/ArgumentFission.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include diff --git a/tests/dsl/BlockNoData.cpp b/tests/dsl/BlockNoData.cpp index 90f1005b7..005afb40e 100644 --- a/tests/dsl/BlockNoData.cpp +++ b/tests/dsl/BlockNoData.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/dsl/Buffer.cpp b/tests/dsl/Buffer.cpp index eccdcd7ed..30b7a9658 100644 --- a/tests/dsl/Buffer.cpp +++ b/tests/dsl/Buffer.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/dsl/CommandLineArguments.cpp b/tests/dsl/CommandLineArguments.cpp index 555ade400..80ecb51ef 100644 --- a/tests/dsl/CommandLineArguments.cpp +++ b/tests/dsl/CommandLineArguments.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include diff --git a/tests/dsl/CustomGet.cpp b/tests/dsl/CustomGet.cpp index 4fe966dbd..b785f0852 100644 --- a/tests/dsl/CustomGet.cpp +++ b/tests/dsl/CustomGet.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/dsl/DSLOrdering.cpp b/tests/dsl/DSLOrdering.cpp index 4631860e6..8629632d5 100644 --- a/tests/dsl/DSLOrdering.cpp +++ b/tests/dsl/DSLOrdering.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/dsl/DSLProxy.cpp b/tests/dsl/DSLProxy.cpp index e9a5c763e..4677f474c 100644 --- a/tests/dsl/DSLProxy.cpp +++ b/tests/dsl/DSLProxy.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/dsl/Every.cpp b/tests/dsl/Every.cpp index 58fbf7d16..54baf339b 100644 --- a/tests/dsl/Every.cpp +++ b/tests/dsl/Every.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include diff --git a/tests/dsl/FlagMessage.cpp b/tests/dsl/FlagMessage.cpp index 3da36807c..5fa24868e 100644 --- a/tests/dsl/FlagMessage.cpp +++ b/tests/dsl/FlagMessage.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/dsl/FusionInOrder.cpp b/tests/dsl/FusionInOrder.cpp index c1953b567..6136f2554 100644 --- a/tests/dsl/FusionInOrder.cpp +++ b/tests/dsl/FusionInOrder.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include namespace { diff --git a/tests/dsl/IO.cpp b/tests/dsl/IO.cpp index bbc48a192..2573f5947 100644 --- a/tests/dsl/IO.cpp +++ b/tests/dsl/IO.cpp @@ -21,7 +21,7 @@ */ #include -#include +#include #include "test_util/TestBase.hpp" diff --git a/tests/dsl/Idle.cpp b/tests/dsl/Idle.cpp index 3b5620d06..f75974e9e 100644 --- a/tests/dsl/Idle.cpp +++ b/tests/dsl/Idle.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/dsl/IdleSync.cpp b/tests/dsl/IdleSync.cpp index 9cfe8f1fc..f6008b661 100644 --- a/tests/dsl/IdleSync.cpp +++ b/tests/dsl/IdleSync.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/dsl/Last.cpp b/tests/dsl/Last.cpp index 2b2c26031..6a214913d 100644 --- a/tests/dsl/Last.cpp +++ b/tests/dsl/Last.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" @@ -31,7 +31,7 @@ namespace { std::vector events; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) struct TestMessage { - TestMessage(int v) : value(v){}; + TestMessage(int v) : value(v) {}; int value; }; diff --git a/tests/dsl/MainThread.cpp b/tests/dsl/MainThread.cpp index 05aa84000..87ac4e1be 100644 --- a/tests/dsl/MainThread.cpp +++ b/tests/dsl/MainThread.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/dsl/MissingArguments.cpp b/tests/dsl/MissingArguments.cpp index 12d5df159..9d6c43608 100644 --- a/tests/dsl/MissingArguments.cpp +++ b/tests/dsl/MissingArguments.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" @@ -33,7 +33,7 @@ std::vector events; // NOLINT(cppcoreguidelines-avoid-non-const-gl template struct Message { int val; - Message(int val) : val(val){}; + Message(int val) : val(val) {}; }; class TestReactor : public test_util::TestBase { diff --git a/tests/dsl/Once.cpp b/tests/dsl/Once.cpp index 476bcb988..4a9b460e7 100644 --- a/tests/dsl/Once.cpp +++ b/tests/dsl/Once.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/dsl/Optional.cpp b/tests/dsl/Optional.cpp index 9a56176c1..ac2000b45 100644 --- a/tests/dsl/Optional.cpp +++ b/tests/dsl/Optional.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/dsl/Priority.cpp b/tests/dsl/Priority.cpp index 7ea837866..5343f49e3 100644 --- a/tests/dsl/Priority.cpp +++ b/tests/dsl/Priority.cpp @@ -20,8 +20,9 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include +#include #include "test_util/TestBase.hpp" diff --git a/tests/dsl/Raw.cpp b/tests/dsl/Raw.cpp index 6300a2ce7..371763c1b 100644 --- a/tests/dsl/Raw.cpp +++ b/tests/dsl/Raw.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include namespace { diff --git a/tests/dsl/RawFunction.cpp b/tests/dsl/RawFunction.cpp index e485995b5..e27a4ec1c 100644 --- a/tests/dsl/RawFunction.cpp +++ b/tests/dsl/RawFunction.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/dsl/Shutdown.cpp b/tests/dsl/Shutdown.cpp index 0a7016e4a..c3a64e800 100644 --- a/tests/dsl/Shutdown.cpp +++ b/tests/dsl/Shutdown.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/dsl/Startup.cpp b/tests/dsl/Startup.cpp index 099e4d9a4..9d4b66690 100644 --- a/tests/dsl/Startup.cpp +++ b/tests/dsl/Startup.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/dsl/Sync.cpp b/tests/dsl/Sync.cpp index c2658d743..dde12865b 100644 --- a/tests/dsl/Sync.cpp +++ b/tests/dsl/Sync.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" @@ -32,7 +32,7 @@ std::vector events; // NOLINT(cppcoreguidelines-avoid-non-const-gl template struct Message { - Message(std::string data) : data(std::move(data)){}; + Message(std::string data) : data(std::move(data)) {}; std::string data; }; diff --git a/tests/dsl/SyncOrder.cpp b/tests/dsl/SyncOrder.cpp index 2eac5873a..f17cec16f 100644 --- a/tests/dsl/SyncOrder.cpp +++ b/tests/dsl/SyncOrder.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include #include @@ -34,7 +34,7 @@ constexpr int N_EVENTS = 1000; struct Message { int val; - Message(int val) : val(val){}; + Message(int val) : val(val) {}; }; struct ShutdownOnIdle {}; diff --git a/tests/dsl/TCP.cpp b/tests/dsl/TCP.cpp index a8571f276..99eae482a 100644 --- a/tests/dsl/TCP.cpp +++ b/tests/dsl/TCP.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/dsl/Transient.cpp b/tests/dsl/Transient.cpp index 9c2ecdb9e..069d6684f 100644 --- a/tests/dsl/Transient.cpp +++ b/tests/dsl/Transient.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/dsl/Trigger.cpp b/tests/dsl/Trigger.cpp index b38b30454..be7e79530 100644 --- a/tests/dsl/Trigger.cpp +++ b/tests/dsl/Trigger.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/dsl/UDP.cpp b/tests/dsl/UDP.cpp index 863fd5eb0..035738a51 100644 --- a/tests/dsl/UDP.cpp +++ b/tests/dsl/UDP.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/dsl/Watchdog.cpp b/tests/dsl/Watchdog.cpp index 9023f7b0d..f99d9c133 100644 --- a/tests/dsl/Watchdog.cpp +++ b/tests/dsl/Watchdog.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include #include diff --git a/tests/dsl/With.cpp b/tests/dsl/With.cpp index 567785537..7646ae272 100644 --- a/tests/dsl/With.cpp +++ b/tests/dsl/With.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/dsl/emit/Delay.cpp b/tests/dsl/emit/Delay.cpp index 60fadc96b..1b568b201 100644 --- a/tests/dsl/emit/Delay.cpp +++ b/tests/dsl/emit/Delay.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/dsl/emit/EmitFusion.cpp b/tests/dsl/emit/EmitFusion.cpp index 5eca9aea6..62f9bcc95 100644 --- a/tests/dsl/emit/EmitFusion.cpp +++ b/tests/dsl/emit/EmitFusion.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include diff --git a/tests/dsl/emit/Initialise.cpp b/tests/dsl/emit/Initialise.cpp index 0af41a4c4..3d9b7850a 100644 --- a/tests/dsl/emit/Initialise.cpp +++ b/tests/dsl/emit/Initialise.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include "../../test_util/TestBase.hpp" diff --git a/tests/individual/BaseClock.cpp b/tests/individual/BaseClock.cpp index 788cdd2c6..932e52b3b 100644 --- a/tests/individual/BaseClock.cpp +++ b/tests/individual/BaseClock.cpp @@ -20,8 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#define CATCH_CONFIG_MAIN -#include +#include #include // for localtime_r/s // This define declares that we are using steady_clock as the base clock for NUClear diff --git a/tests/individual/TimeTravel.cpp b/tests/individual/TimeTravel.cpp index 5921fa34c..b44bbc8cf 100644 --- a/tests/individual/TimeTravel.cpp +++ b/tests/individual/TimeTravel.cpp @@ -1,5 +1,5 @@ -#define CATCH_CONFIG_MAIN -#include +#include +#include #include #include "test_util/TestBase.hpp" diff --git a/tests/individual/TimeTravelFrozen.cpp b/tests/individual/TimeTravelFrozen.cpp index 5773a5f7f..423376390 100644 --- a/tests/individual/TimeTravelFrozen.cpp +++ b/tests/individual/TimeTravelFrozen.cpp @@ -1,5 +1,5 @@ -#define CATCH_CONFIG_MAIN -#include +#include +#include #include #include diff --git a/tests/log/Log.cpp b/tests/log/Log.cpp index 64c3f1af4..f1f7619c7 100644 --- a/tests/log/Log.cpp +++ b/tests/log/Log.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include // Anonymous namespace to keep everything file local diff --git a/tests/test.cpp b/tests/test.cpp deleted file mode 100644 index 963f66aa0..000000000 --- a/tests/test.cpp +++ /dev/null @@ -1,24 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2013 NUClear Contributors - * - * This file is part of the NUClear codebase. - * See https://github.com/Fastcode/NUClear for further info. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#define CATCH_CONFIG_MAIN -#include diff --git a/tests/test_util/TestBase.hpp b/tests/test_util/TestBase.hpp index ffadda856..e9e368cc4 100644 --- a/tests/test_util/TestBase.hpp +++ b/tests/test_util/TestBase.hpp @@ -23,7 +23,7 @@ #ifndef TEST_UTIL_TESTBASE_HPP #define TEST_UTIL_TESTBASE_HPP -#include +#include #include #include diff --git a/tests/util/demangle.cpp b/tests/util/demangle.cpp index 2b1cde9cd..7c920b81c 100644 --- a/tests/util/demangle.cpp +++ b/tests/util/demangle.cpp @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include diff --git a/tests/util/network/resolve.cpp b/tests/util/network/resolve.cpp index b9f6e7f7e..d5335f6d4 100644 --- a/tests/util/network/resolve.cpp +++ b/tests/util/network/resolve.cpp @@ -22,7 +22,7 @@ #include "util/network/resolve.hpp" -#include +#include TEST_CASE("resolve function returns expected socket address", "[util][network][resolve]") { diff --git a/tests/util/serialise/serialise.cpp b/tests/util/serialise/serialise.cpp index 57afa8360..e5f28fe23 100644 --- a/tests/util/serialise/serialise.cpp +++ b/tests/util/serialise/serialise.cpp @@ -23,7 +23,8 @@ #include "util/serialise/Serialise.hpp" #include -#include +#include +#include #include #include #include diff --git a/tests/util/serialise/xxhash.cpp b/tests/util/serialise/xxhash.cpp index 2f186aa40..3f052f7c5 100644 --- a/tests/util/serialise/xxhash.cpp +++ b/tests/util/serialise/xxhash.cpp @@ -22,7 +22,8 @@ #include "util/serialise/xxhash.hpp" -#include +#include +#include #include // The seed used for the tests (the same one that NUClear uses)