Skip to content

Commit

Permalink
added cavl, heap and googletest
Browse files Browse the repository at this point in the history
  • Loading branch information
serges147 committed Aug 22, 2024
1 parent beddcd5 commit b1e455e
Show file tree
Hide file tree
Showing 8 changed files with 852 additions and 72 deletions.
2 changes: 2 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Checks: >-
-readability-identifier-length,
-*-use-trailing-return-type,
-*-named-parameter,
-bugprone-suspicious-include,
-misc-include-cleaner,
CheckOptions:
- key: readability-function-cognitive-complexity.Threshold
value: '90'
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,5 @@ jobs:
- uses: DoozyX/[email protected]
with:
source: '.'
exclude: './unity'
extensions: 'c,h,cpp,hpp'
clangFormatVersion: 18
22 changes: 20 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) 2024 Zubax Robotics <[email protected]>

cmake_minimum_required(VERSION 3.12)
project(embedded_scheduler_tests CXX)
project(embedded_scheduler_tests C CXX)
enable_testing()

set(CTEST_OUTPUT_ON_FAILURE ON)
Expand All @@ -28,6 +28,16 @@ else ()
add_custom_target(format COMMAND ${clang_format} -i -fallback-style=none -style=file --verbose ${format_files})
endif ()

include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.15.2
)
FetchContent_MakeAvailable(googletest)
#add_library(GTest::GTest INTERFACE IMPORTED)
#target_link_libraries(GTest::GTest INTERFACE gtest_main)

set(CMAKE_C_STANDARD 11)
set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 20)
Expand All @@ -42,4 +52,12 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes")
add_executable(test_embedded_scheduler_cpp20 ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_embedded_scheduler.cpp)
set_target_properties(test_embedded_scheduler_cpp20 PROPERTIES CXX_STANDARD 20)
target_include_directories(test_embedded_scheduler_cpp20 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)
add_test("run_test_embedded_scheduler_cpp20" "test_embedded_scheduler_cpp20")
target_include_directories(test_embedded_scheduler_cpp20 SYSTEM PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib)
target_link_libraries(test_embedded_scheduler_cpp20
PRIVATE
GTest::gmock_main
)

#add_test("run_test_embedded_scheduler_cpp20" "test_embedded_scheduler_cpp20")
include(GoogleTest)
gtest_discover_tests(test_embedded_scheduler_cpp20)
5 changes: 5 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## TODOs:

- [ ] Search for...
- [ ] "dyshlo"
- [ ] "telega"
- [ ] "serge"

- [ ] Replace "serges147" with proper organization name when ready
3 changes: 1 addition & 2 deletions include/embedded_scheduler/scheduler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@

#pragma once

#include <platform/heap.hpp>

#include <cavl/cavl.hpp>
#include <platform/heap.hpp>

#include <cassert>
#include <chrono>
Expand Down
Loading

0 comments on commit b1e455e

Please sign in to comment.