Skip to content

Commit 1693823

Browse files
authored
Merge pull request #1428 from PowerGridModel/pgm/feature/reorganize-tests
Compilation times: reorder cpp unit-tests
2 parents 3588a3d + cead06c commit 1693823

63 files changed

Lines changed: 166 additions & 137 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/advanced_documentation/build-guide.md

Lines changed: 3 additions & 3 deletions

tests/cpp_unit_tests/CMakeLists.txt

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

5-
add_executable(
6-
power_grid_model_unit_tests_common
7-
"test_entry_point.cpp"
8-
"test_common.cpp"
9-
"test_exceptions.cpp"
10-
"test_component_list.cpp"
11-
"test_grouped_index_vector.cpp"
12-
"test_counting_iterator.cpp"
13-
"test_statistics.cpp"
14-
"test_three_phase_tensor.cpp"
15-
"test_typing.cpp"
16-
"test_iterator_facade.cpp"
17-
)
18-
19-
target_link_libraries(
20-
power_grid_model_unit_tests_common
21-
PRIVATE power_grid_model doctest::doctest
22-
)
23-
24-
doctest_discover_tests(power_grid_model_unit_tests_common)
25-
26-
add_executable(
27-
power_grid_model_unit_tests_auxiliary
28-
"test_entry_point.cpp"
29-
"test_component_input.cpp"
30-
"test_component_output.cpp"
31-
"test_component_update.cpp"
32-
"test_meta_data_generation.cpp"
33-
"test_dataset.cpp"
34-
"test_deserializer.cpp"
35-
"test_serializer.cpp"
36-
)
37-
38-
target_link_libraries(
39-
power_grid_model_unit_tests_auxiliary
40-
PRIVATE power_grid_model doctest::doctest
41-
)
42-
43-
doctest_discover_tests(power_grid_model_unit_tests_auxiliary)
44-
45-
add_executable(
46-
power_grid_model_unit_tests_component
47-
"test_entry_point.cpp"
48-
"test_all_components.cpp"
49-
"test_node.cpp"
50-
"test_asym_line.cpp"
51-
"test_line.cpp"
52-
"test_generic_branch.cpp"
53-
"test_link.cpp"
54-
"test_load_gen.cpp"
55-
"test_source.cpp"
56-
"test_shunt.cpp"
57-
"test_transformer.cpp"
58-
"test_voltage_sensor.cpp"
59-
"test_power_sensor.cpp"
60-
"test_three_winding_transformer.cpp"
61-
"test_fault.cpp"
62-
"test_transformer_tap_regulator.cpp"
63-
"test_current_sensor.cpp"
64-
"test_voltage_regulator.cpp"
65-
)
66-
67-
target_link_libraries(
68-
power_grid_model_unit_tests_component
69-
PRIVATE power_grid_model doctest::doctest
70-
)
71-
72-
doctest_discover_tests(power_grid_model_unit_tests_component)
73-
74-
add_executable(
75-
power_grid_model_unit_tests_main_core
76-
"test_entry_point.cpp"
77-
"test_main_core_output.cpp"
78-
"test_main_model_type.cpp"
79-
)
80-
81-
target_link_libraries(
82-
power_grid_model_unit_tests_main_core
83-
PRIVATE power_grid_model doctest::doctest
84-
)
85-
86-
doctest_discover_tests(power_grid_model_unit_tests_main_core)
87-
88-
add_executable(
89-
power_grid_model_unit_tests_math_solver
90-
"test_entry_point.cpp"
91-
"test_sparse_lu_solver.cpp"
92-
"test_y_bus.cpp"
93-
"test_measured_values.cpp"
94-
"test_observability.cpp"
95-
"test_math_solver_pf_linear.cpp"
96-
"test_math_solver_pf_newton_raphson.cpp"
97-
"test_math_solver_pf_iterative_current.cpp"
98-
"test_math_solver_se_newton_raphson.cpp"
99-
"test_math_solver_se_iterative_linear.cpp"
100-
"test_math_solver_sc.cpp"
101-
)
102-
103-
target_link_libraries(
104-
power_grid_model_unit_tests_math_solver
105-
PRIVATE power_grid_model doctest::doctest
106-
)
107-
108-
doctest_discover_tests(power_grid_model_unit_tests_math_solver)
109-
110-
add_executable(
111-
power_grid_model_unit_tests_optimizer
112-
"test_entry_point.cpp"
113-
"test_optimizer.cpp"
114-
"test_tap_position_optimizer.cpp"
115-
)
116-
117-
target_link_libraries(
118-
power_grid_model_unit_tests_optimizer
119-
PRIVATE power_grid_model doctest::doctest
120-
)
121-
122-
doctest_discover_tests(power_grid_model_unit_tests_optimizer)
5+
add_subdirectory(common)
6+
add_subdirectory(auxiliary)
7+
add_subdirectory(component)
8+
add_subdirectory(main_core)
9+
add_subdirectory(math_solver)
10+
add_subdirectory(optimizer)
11+
add_subdirectory(logging)
12312

12413
add_executable(
12514
power_grid_model_unit_tests
12615
"test_entry_point.cpp"
16+
"test_calculation_preparation.cpp"
12717
"test_topology.cpp"
12818
"test_sparse_ordering.cpp"
12919
"test_container.cpp"
13020
"test_index_mapping.cpp"
13121
"test_job_dispatch.cpp"
132-
"test_calculation_preparation.cpp"
13322
"test_link_solver.cpp"
13423
"test_supernodes.cpp"
13524
)
@@ -140,18 +29,3 @@ target_link_libraries(
14029
)
14130

14231
doctest_discover_tests(power_grid_model_unit_tests)
143-
144-
add_executable(
145-
power_grid_model_unit_tests_logging
146-
"test_entry_point.cpp"
147-
"test_calculation_info.cpp"
148-
"test_timer.cpp"
149-
"test_text_logger.cpp"
150-
)
151-
152-
target_link_libraries(
153-
power_grid_model_unit_tests_logging
154-
PRIVATE power_grid_model doctest::doctest
155-
)
156-
157-
doctest_discover_tests(power_grid_model_unit_tests_logging)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
2+
#
3+
# SPDX-License-Identifier: MPL-2.0
4+
5+
add_executable(
6+
power_grid_model_unit_tests_auxiliary
7+
"../test_entry_point.cpp"
8+
"test_component_input.cpp"
9+
"test_component_output.cpp"
10+
"test_component_update.cpp"
11+
"test_deserializer.cpp"
12+
"test_serializer.cpp"
13+
"test_dataset.cpp"
14+
"test_meta_data_generation.cpp"
15+
)
16+
17+
target_link_libraries(
18+
power_grid_model_unit_tests_auxiliary
19+
PRIVATE power_grid_model doctest::doctest
20+
)
21+
22+
doctest_discover_tests(power_grid_model_unit_tests_auxiliary)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

tests/cpp_unit_tests/test_meta_data_generation.cpp renamed to tests/cpp_unit_tests/auxiliary/test_meta_data_generation.cpp

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)