Skip to content

Commit c50db72

Browse files
committed
add cmake stub for doctest
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
1 parent de769a5 commit c50db72

File tree

6 files changed

+23
-7
lines changed

6 files changed

+23
-7
lines changed

.gersemirc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
definitions: [./cmake/stubs/]
2+
disable_formatting: false
3+
extensions: []
4+
indent: 4
5+
line_length: 80
6+
list_expansion: favour-inlining
7+
unsafe: false
8+
warn_about_unknown_commands: true

.github/workflows/check-code-quality.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ jobs:
5252
sudo apt-get install -y clang-format-18
5353
find . -regex '.*\.\(h\|c\|cpp\|hpp\|cc\|cxx\)' -exec clang-format-18 -style=file -i {} \;
5454
55+
- name: Install and run cmake-linter
56+
run: |
57+
pip install gersemi
58+
gersemi -i --warnings-as-errors src/ tests/ cmake/
59+
5560
- name: Install and run markdownlint
5661
run: |
5762
npm install -g markdownlint-cli
@@ -95,4 +100,3 @@ jobs:
95100
else
96101
echo "The test-workflow.yml file matches main."
97102
fi
98-

cmake/stubs/doctest.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
2+
#
3+
# SPDX-License-Identifier: MPL-2.0
4+
5+
cmake_minimum_required(VERSION 3.23)
6+
7+
# stub for doctest_discover_tests
8+
function(doctest_discover_tests target)
9+
# no-op
10+
endfunction()

tests/cpp_unit_tests/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#
33
# SPDX-License-Identifier: MPL-2.0
44

5-
include("${doctest_DIR}/doctest.cmake")
6-
75
add_executable(
86
power_grid_model_unit_tests_common
97
"test_entry_point.cpp"

tests/cpp_validation_tests/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#
33
# SPDX-License-Identifier: MPL-2.0
44

5-
include("${doctest_DIR}/doctest.cmake")
6-
75
set(PROJECT_SOURCES "test_entry_point.cpp" "test_validation.cpp")
86

97
add_executable(power_grid_model_validation_tests ${PROJECT_SOURCES})

tests/native_api_tests/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#
33
# SPDX-License-Identifier: MPL-2.0
44

5-
include("${doctest_DIR}/doctest.cmake")
6-
75
set(PROJECT_SOURCES
86
"test_entry_point.cpp"
97
"test_api_meta_data.cpp"

0 commit comments

Comments
 (0)