Skip to content

Commit 728ca21

Browse files
authored
Test: update cmake files in module_cell (#1849)
1 parent e70ea45 commit 728ca21

File tree

7 files changed

+17
-18
lines changed

7 files changed

+17
-18
lines changed

source/module_cell/test/CMakeLists.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@ AddTest(
99
SOURCES read_pp_upf_test.cpp ../read_pp.cpp ../read_pp_upf201.cpp ../read_pp_upf100.cpp ../read_pp_vwr.cpp ../read_pp_blps.cpp ../../src_parallel/parallel_reduce.cpp ../../src_parallel/parallel_kpoints.cpp ../../src_parallel/parallel_global.cpp ../../src_parallel/parallel_common.cpp ../../module_io/output.cpp
1010
)
1111

12-
install(DIRECTORY support DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
13-
1412
AddTest(
1513
TARGET klist_test
1614
LIBS ${math_libs} base device
1715
SOURCES klist_test.cpp ../klist.cpp
1816
../../src_parallel/parallel_reduce.cpp ../../src_parallel/parallel_kpoints.cpp
1917
../../src_parallel/parallel_global.cpp ../../src_parallel/parallel_common.cpp
20-
../../module_io/output.cpp ../../module_cell/module_symmetry/symm_other.cpp
21-
../../module_cell/module_symmetry/symmetry_basic.cpp ../../module_cell/module_symmetry/symmetry.cpp
18+
../../module_io/output.cpp ../module_symmetry/symm_other.cpp
19+
../module_symmetry/symmetry_basic.cpp ../module_symmetry/symmetry.cpp
2220
)
2321

24-
install(FILES KPT KPT1 KPT2 KPT4 KPT5 DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
22+
install(DIRECTORY support DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
23+

source/module_cell/test/klist_test.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -115,33 +115,33 @@ TEST_F(KlistTest, MP)
115115

116116
TEST_F(KlistTest, ReadMesh)
117117
{
118-
std::string k_file = "KPT";
118+
std::string k_file = "./support/KPT";
119119
kv.nspin = 1;
120120
kv.read_kpoints(k_file);
121121
EXPECT_EQ(kv.nkstot,512);
122-
remove("KPT");
122+
//remove("KPT");
123123
}
124124

125125
TEST_F(KlistTest, ReadMP)
126126
{
127127
K_Vectors kv;
128-
std::string k_file = "KPT1";
128+
std::string k_file = "./support/KPT1";
129129
kv.nspin = 1;
130130
kv.read_kpoints(k_file);
131131
EXPECT_EQ(kv.nkstot,512);
132-
remove("KPT1");
132+
//remove("KPT1");
133133
}
134134

135135
TEST_F(KlistTest, ReadList)
136136
{
137137
ModuleSymmetry::Symmetry::symm_flag=0;
138138
// symm_flag is required in read_kpoints for a k list
139139
K_Vectors kv;
140-
std::string k_file = "KPT2";
140+
std::string k_file = "./support/KPT2";
141141
kv.nspin = 1;
142142
kv.read_kpoints(k_file);
143143
EXPECT_EQ(kv.nkstot,122);
144-
remove("KPT2");
144+
//remove("KPT2");
145145
}
146146

147147
TEST_F(KlistTest, Kspacing)
@@ -154,18 +154,18 @@ TEST_F(KlistTest, Kspacing)
154154
GlobalC::ucell.G = GlobalC::ucell.GT.Transpose();
155155
GlobalC::ucell.lat0 = 1.8897261254578281;
156156
GlobalV::KSPACING = 0.052918; // 0.52918/Bohr = 1/A
157-
std::string k_file = "KPT3";
157+
std::string k_file = "./support/KPT3";
158158
kv.read_kpoints(k_file);
159159
EXPECT_EQ(kv.nkstot,343);
160-
remove("KPT3");
160+
//remove("KPT3");
161161
GlobalV::KSPACING=0.0;
162162

163163
}
164164

165165
TEST_F(KlistTest, Renew)
166166
{
167167
K_Vectors kv;
168-
std::string k_file = "KPT4";
168+
std::string k_file = "./support/KPT4";
169169
//Cartesian: non-spin case nspin=1
170170
kv.nspin = 1;
171171
kv.read_kpoints(k_file);
@@ -182,7 +182,7 @@ TEST_F(KlistTest, Renew)
182182
TEST_F(KlistTest, LineCartesian)
183183
{
184184
K_Vectors kv;
185-
std::string k_file = "KPT5";
185+
std::string k_file = "./support/KPT5";
186186
//Line Cartesian: non-spin case nspin=1
187187
kv.nspin = 1;
188188
kv.set_kup_and_kdw_after_vc();
@@ -196,15 +196,15 @@ TEST_F(KlistTest, LineCartesian)
196196
kv.read_kpoints(k_file);
197197
EXPECT_EQ(kv.nkstot,51);
198198
EXPECT_EQ(kv.kvec_c.size(),102);
199-
remove("KPT5");
199+
//remove("KPT5");
200200

201201

202202
}
203203

204204
TEST_F(KlistTest, SetKupKdownAfterXC)
205205
{
206206
K_Vectors kv;
207-
std::string k_file = "KPT4";
207+
std::string k_file = "./support/KPT4";
208208
//Cartesian: non-spin case nspin=1
209209
kv.nspin = 1;
210210
kv.read_kpoints(k_file);
@@ -238,7 +238,7 @@ TEST_F(KlistTest, SetKupKdownAfterXC)
238238
EXPECT_EQ(kv.isk[ik+5],1);
239239
}
240240

241-
remove("KPT4");
241+
//remove("KPT4");
242242

243243

244244
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)