Skip to content

Commit 5fc9b2b

Browse files
committed
Separate unit test for module_base
1 parent 5d0949c commit 5fc9b2b

File tree

3 files changed

+64
-58
lines changed

3 files changed

+64
-58
lines changed

.github/workflows/test.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,16 @@ jobs:
126126
run: |
127127
cmake --build build --target test ARGS="-V --timeout 1700 -R 10_others"
128128
129-
- name: Unit Test
129+
- name: Module Base Unit Test
130130
env:
131131
GTEST_COLOR: 'yes'
132132
OMP_NUM_THREADS: '2'
133133
run: |
134-
cmake --build build --target test ARGS="-V --timeout 1700 -E 'integrate_test|01_PW|02_NAO_Gamma|03_NAO_multik|04_LJ_DP|05_rtTDDFT|06_SDFT|07_OFDFT|08_EXX|09_DeePKS|10_others|11_PW_GPU|16_SDFT_GPU'"
134+
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_BASE"
135135
136+
- name: Unit Test
137+
env:
138+
GTEST_COLOR: 'yes'
139+
OMP_NUM_THREADS: '2'
140+
run: |
141+
cmake --build build --target test ARGS="-V --timeout 1700 -E 'integrate_test|01_PW|02_NAO_Gamma|03_NAO_multik|04_LJ_DP|05_rtTDDFT|06_SDFT|07_OFDFT|08_EXX|09_DeePKS|10_others|11_PW_GPU|16_SDFT_GPU'

source/module_base/test/CMakeLists.txt

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,239 +1,239 @@
11
remove_definitions(-D__MPI)
22
install(DIRECTORY data DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
33
AddTest(
4-
TARGET base_blas_connector
4+
TARGET MODULE_BASE_base_blas_connector
55
LIBS parameter ${math_libs} base device
66
SOURCES blas_connector_test.cpp
77
)
88
AddTest(
9-
TARGET base_atom_in
9+
TARGET MODULE_BASE_base_atom_in
1010
LIBS parameter
1111
SOURCES atom_in_test.cpp
1212
)
1313
AddTest(
14-
TARGET base_timer
14+
TARGET MODULE_BASE_base_timer
1515
LIBS parameter
1616
SOURCES timer_test.cpp ../timer.cpp ../global_variable.cpp
1717
)
1818
AddTest(
19-
TARGET base_tool_quit
19+
TARGET MODULE_BASE_base_tool_quit
2020
LIBS parameter
2121
SOURCES tool_quit_test.cpp ../tool_quit.cpp ../global_variable.cpp ../global_file.cpp ../global_function.cpp ../memory.cpp ../timer.cpp
2222
)
2323
AddTest(
24-
TARGET base_tool_check
24+
TARGET MODULE_BASE_base_tool_check
2525
LIBS parameter
2626
SOURCES tool_check_test.cpp ../tool_check.cpp ../tool_quit.cpp ../global_variable.cpp ../global_file.cpp ../global_function.cpp ../memory.cpp ../timer.cpp
2727
)
2828
AddTest(
29-
TARGET base_memory
29+
TARGET MODULE_BASE_base_memory
3030
SOURCES memory_test.cpp ../memory.cpp ../parallel_reduce.cpp
3131
)
3232
ADDTest(
33-
TARGET base_global_function
33+
TARGET MODULE_BASE_base_global_function
3434
LIBS parameter ${math_libs}
3535
SOURCES global_function_test.cpp ../global_function.cpp ../tool_quit.cpp ../global_variable.cpp ../global_file.cpp ../memory.cpp ../timer.cpp
3636
)
3737
AddTest(
38-
TARGET base_vector3
38+
TARGET MODULE_BASE_base_vector3
3939
LIBS parameter
4040
SOURCES vector3_test.cpp
4141
)
4242
AddTest(
43-
TARGET base_matrix3
43+
TARGET MODULE_BASE_base_matrix3
4444
LIBS parameter ${math_libs} base device
4545
SOURCES matrix3_test.cpp
4646
)
4747
AddTest(
48-
TARGET base_intarray
48+
TARGET MODULE_BASE_base_intarray
4949
LIBS parameter
5050
SOURCES intarray_test.cpp ../intarray.cpp
5151
)
5252
AddTest(
53-
TARGET base_realarray
53+
TARGET MODULE_BASE_base_realarray
5454
LIBS parameter
5555
SOURCES realarray_test.cpp ../realarray.cpp
5656
)
5757
AddTest(
58-
TARGET base_matrix
58+
TARGET MODULE_BASE_base_matrix
5959
LIBS parameter ${math_libs} base device
6060
SOURCES matrix_test.cpp
6161
)
6262
AddTest(
63-
TARGET base_complexarray
63+
TARGET MODULE_BASE_base_complexarray
6464
LIBS parameter
6565
SOURCES complexarray_test.cpp ../complexarray.cpp ../tool_quit.cpp ../global_variable.cpp ../global_file.cpp ../global_function.cpp ../memory.cpp ../timer.cpp
6666
)
6767
AddTest(
68-
TARGET base_complexmatrix
68+
TARGET MODULE_BASE_base_complexmatrix
6969
LIBS parameter ${math_libs} base device
7070
SOURCES complexmatrix_test.cpp
7171
)
7272
AddTest(
73-
TARGET base_integral
73+
TARGET MODULE_BASE_base_integral
7474
LIBS parameter
7575
SOURCES math_integral_test.cpp ../math_integral.cpp
7676
)
7777
AddTest(
78-
TARGET base_sph_bessel_recursive
78+
TARGET MODULE_BASE_base_sph_bessel_recursive
7979
LIBS parameter
8080
SOURCES sph_bessel_recursive_test.cpp ../sph_bessel_recursive-d1.cpp ../sph_bessel_recursive-d2.cpp
8181
)
8282
AddTest(
83-
TARGET base_ylmreal
83+
TARGET MODULE_BASE_base_ylmreal
8484
LIBS parameter ${math_libs} base device
8585
SOURCES math_ylmreal_test.cpp ../libm/branred.cpp ../libm/sincos.cpp
8686
)
8787
AddTest(
88-
TARGET base_math_sphbes
88+
TARGET MODULE_BASE_base_math_sphbes
8989
LIBS parameter
9090
SOURCES math_sphbes_test.cpp ../math_sphbes.cpp ../timer.cpp
9191
)
9292
AddTest(
93-
TARGET base_mathzone
93+
TARGET MODULE_BASE_base_mathzone
9494
LIBS parameter ${math_libs} base device
9595
SOURCES mathzone_test.cpp
9696
)
9797
AddTest(
98-
TARGET base_mathzone_add1
98+
TARGET MODULE_BASE_base_mathzone_add1
9999
LIBS parameter ${math_libs} base device
100100
SOURCES mathzone_add1_test.cpp
101101
)
102102
AddTest(
103-
TARGET base_math_polyint
103+
TARGET MODULE_BASE_base_math_polyint
104104
LIBS parameter
105105
SOURCES math_polyint_test.cpp ../math_polyint.cpp ../realarray.cpp ../timer.cpp
106106
)
107107
AddTest(
108-
TARGET base_gram_schmidt_orth
108+
TARGET MODULE_BASE_base_gram_schmidt_orth
109109
LIBS parameter ${math_libs} base device
110110
SOURCES gram_schmidt_orth_test.cpp
111111
)
112112
AddTest(
113-
TARGET base_math_bspline
113+
TARGET MODULE_BASE_base_math_bspline
114114
LIBS parameter
115115
SOURCES math_bspline_test.cpp ../math_bspline.cpp
116116
)
117117
AddTest(
118-
TARGET base_inverse_matrix
118+
TARGET MODULE_BASE_base_inverse_matrix
119119
LIBS parameter ${math_libs} base device
120120
SOURCES inverse_matrix_test.cpp
121121
)
122122
AddTest(
123-
TARGET base_mymath
123+
TARGET MODULE_BASE_base_mymath
124124
LIBS parameter
125125
SOURCES mymath_test.cpp ../mymath.cpp ../timer.cpp
126126
)
127127
AddTest(
128-
TARGET base_container
128+
TARGET MODULE_BASE_base_container
129129
LIBS parameter
130130
SOURCES container_operator_test.cpp ../container_operator.h
131131
)
132132

133133
AddTest(
134-
TARGET base_math_chebyshev
134+
TARGET MODULE_BASE_base_math_chebyshev
135135
LIBS parameter ${math_libs} base device container
136136
SOURCES math_chebyshev_test.cpp
137137
)
138138

139139
AddTest(
140-
TARGET base_lapack_connector
140+
TARGET MODULE_BASE_base_lapack_connector
141141
LIBS parameter ${math_libs} base device
142142
SOURCES lapack_connector_test.cpp
143143
)
144144

145145
AddTest(
146-
TARGET base_opt_CG
146+
TARGET MODULE_BASE_base_opt_CG
147147
LIBS parameter ${math_libs} base device
148148
SOURCES opt_CG_test.cpp opt_test_tools.cpp
149149
)
150150

151151
AddTest(
152-
TARGET base_opt_TN
152+
TARGET MODULE_BASE_base_opt_TN
153153
LIBS parameter ${math_libs} base device
154154
SOURCES opt_TN_test.cpp opt_test_tools.cpp
155155
)
156156

157157
AddTest(
158-
TARGET base_ylm
158+
TARGET MODULE_BASE_base_ylm
159159
LIBS parameter
160160
SOURCES ylm_test.cpp ../ylm.cpp ../timer.cpp ../tool_quit.cpp ../global_variable.cpp ../global_file.cpp ../global_function.cpp ../memory.cpp
161161
)
162162

163163
AddTest(
164-
TARGET base_abfs-vector3_order
164+
TARGET MODULE_BASE_base_abfs-vector3_order
165165
LIBS parameter
166166
SOURCES abfs-vector3_order_test.cpp ../abfs-vector3_order.cpp
167167
)
168168

169169
AddTest(
170-
TARGET base_global_file
170+
TARGET MODULE_BASE_base_global_file
171171
LIBS parameter
172172
SOURCES global_file_test.cpp ../global_file.cpp ../global_function.cpp ../tool_quit.cpp ../global_variable.cpp ../memory.cpp ../timer.cpp
173173
)
174174

175175
AddTest(
176-
TARGET base_tool_title
176+
TARGET MODULE_BASE_base_tool_title
177177
LIBS parameter
178178
SOURCES tool_title_test.cpp ../tool_title.cpp ../global_variable.cpp ../global_function.cpp ../timer.cpp ../tool_quit.cpp ../global_file.cpp ../memory.cpp
179179
)
180180

181181
AddTest(
182-
TARGET base_element_basis_index
182+
TARGET MODULE_BASE_base_element_basis_index
183183
LIBS parameter
184184
SOURCES element_basis_index_test.cpp ../element_basis_index.cpp
185185
)
186186

187187
AddTest(
188-
TARGET base_tool_threading
188+
TARGET MODULE_BASE_base_tool_threading
189189
LIBS parameter
190190
SOURCES tool_threading_test.cpp ../tool_threading.h
191191
)
192192

193193
AddTest(
194-
TARGET spherical_bessel_transformer
194+
TARGET MODULE_BASE_spherical_bessel_transformer
195195
SOURCES spherical_bessel_transformer_test.cpp
196196
LIBS parameter ${math_libs} base device
197197
)
198198

199199
AddTest(
200-
TARGET cubic_spline
200+
TARGET MODULE_BASE_cubic_spline
201201
SOURCES cubic_spline_test.cpp
202202
LIBS parameter ${math_libs} base device
203203
)
204204

205205
AddTest(
206-
TARGET clebsch_gordan_coeff_test
206+
TARGET MODULE_BASE_clebsch_gordan_coeff_test
207207
SOURCES clebsch_gordan_coeff_test.cpp
208208
LIBS parameter ${math_libs} base device
209209
)
210210

211211
AddTest(
212-
TARGET assoc_laguerre_test
212+
TARGET MODULE_BASE_assoc_laguerre_test
213213
SOURCES assoc_laguerre_test.cpp
214214
LIBS parameter ${math_libs} base device
215215
)
216216

217217
AddTest(
218-
TARGET ndarray_test
218+
TARGET MODULE_BASE_ndarray_test
219219
LIBS parameter
220220
SOURCES ndarray_test.cpp
221221
)
222222

223223
AddTest(
224-
TARGET formatter_test
224+
TARGET MODULE_BASE_formatter_test
225225
LIBS parameter
226226
SOURCES formatter_test.cpp
227227
)
228228

229229
AddTest(
230-
TARGET lebedev_laikov
230+
TARGET MODULE_BASE_lebedev_laikov
231231
SOURCES test_lebedev_laikov.cpp ../ylm.cpp ../math_lebedev_laikov.cpp
232232
)
233233

234234
if(ENABLE_GOOGLEBENCH)
235235
AddTest(
236-
TARGET perf_sphbes
236+
TARGET MODULE_BASE_perf_sphbes
237237
LIBS parameter
238238
SOURCES perf_sphbes_test.cpp ../math_sphbes.cpp ../timer.cpp
239239
)

source/module_base/test_parallel/CMakeLists.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
AddTest(
2-
TARGET base_ParaCommon
2+
TARGET MODULE_BASE_base_ParaCommon
33
LIBS parameter MPI::MPI_CXX
44
SOURCES parallel_common_test.cpp ../global_variable.cpp ../parallel_common.cpp
55
)
66

77
AddTest(
8-
TARGET base_ParaGlobal
8+
TARGET MODULE_BASE_base_ParaGlobal
99
LIBS parameter MPI::MPI_CXX
1010
SOURCES parallel_global_test.cpp ../global_variable.cpp ../parallel_global.cpp ../parallel_comm.cpp
1111
)
1212

1313
AddTest(
14-
TARGET base_ParaReduce
14+
TARGET MODULE_BASE_base_ParaReduce
1515
LIBS parameter MPI::MPI_CXX
1616
SOURCES parallel_reduce_test.cpp ../global_variable.cpp ../parallel_global.cpp ../parallel_comm.cpp ../parallel_common.cpp ../parallel_reduce.cpp
1717
)
@@ -21,39 +21,39 @@ install(FILES parallel_global_test.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
2121
install(FILES parallel_reduce_test.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
2222

2323
find_program(BASH bash)
24-
add_test(NAME base_parallel_common_test
24+
add_test(NAME MODULE_BASE_base_parallel_common_test
2525
COMMAND ${BASH} parallel_common_test.sh
2626
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
2727
)
28-
add_test(NAME base_parallel_global_test
28+
add_test(NAME MODULE_BASE_base_parallel_global_test
2929
COMMAND ${BASH} parallel_global_test.sh
3030
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
3131
)
32-
add_test(NAME base_parallel_reduce_test
32+
add_test(NAME MODULE_BASE_base_parallel_reduce_test
3333
COMMAND ${BASH} parallel_reduce_test.sh
3434
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
3535
)
3636

3737
AddTest(
38-
TARGET base_para_gemm
38+
TARGET MODULE_BASE_base_para_gemm
3939
LIBS MPI::MPI_CXX ${math_libs} base device parameter
4040
SOURCES test_para_gemm.cpp
4141
)
4242

43-
add_test(NAME base_para_gemm_parallel
43+
add_test(NAME MODULE_BASE_base_para_gemm_parallel
4444
COMMAND mpirun -np 4 ./base_para_gemm
4545
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
4646
)
4747

4848
AddTest(
49-
TARGET parallel_2d_test
49+
TARGET MODULE_BASE_parallel_2d_test
5050
SOURCES parallel_2d_test.cpp ../parallel_2d.cpp
5151
LIBS parameter ${math_libs}
5252
)
5353

5454
install(FILES parallel_2d_test.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
5555
find_program(BASH bash)
56-
add_test(NAME parallel_2d_test_para
56+
add_test(NAME MODULE_BASE_parallel_2d_test_para
5757
COMMAND ${BASH} parallel_2d_test.sh
5858
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
5959
)
@@ -67,12 +67,12 @@ add_test(NAME parallel_2d_test_para
6767
endif()
6868

6969
AddTest(
70-
TARGET blacs_connector
70+
TARGET MODULE_BASE_blacs_connector
7171
LIBS parameter MPI::MPI_CXX ${BLACS_LIB}
7272
SOURCES blacs_connector_test.cpp
7373
)
7474
install(FILES blacs_connector_test.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
75-
add_test(NAME blacs_connector_test
75+
add_test(NAME MODULE_BASE_blacs_connector_test
7676
COMMAND ${BASH} blacs_connector_test.sh
7777
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
7878
)

0 commit comments

Comments
 (0)