diff --git a/source/module_cell/test/CMakeLists.txt b/source/module_cell/test/CMakeLists.txt index 0361cb3072..14ec14d0b0 100644 --- a/source/module_cell/test/CMakeLists.txt +++ b/source/module_cell/test/CMakeLists.txt @@ -9,16 +9,15 @@ AddTest( 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 ) -install(DIRECTORY support DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) - AddTest( TARGET klist_test LIBS ${math_libs} base device SOURCES klist_test.cpp ../klist.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 ../../module_cell/module_symmetry/symm_other.cpp - ../../module_cell/module_symmetry/symmetry_basic.cpp ../../module_cell/module_symmetry/symmetry.cpp + ../../module_io/output.cpp ../module_symmetry/symm_other.cpp + ../module_symmetry/symmetry_basic.cpp ../module_symmetry/symmetry.cpp ) -install(FILES KPT KPT1 KPT2 KPT4 KPT5 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +install(DIRECTORY support DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) + diff --git a/source/module_cell/test/klist_test.cpp b/source/module_cell/test/klist_test.cpp index 1ac49d37d3..069cb75382 100644 --- a/source/module_cell/test/klist_test.cpp +++ b/source/module_cell/test/klist_test.cpp @@ -115,21 +115,21 @@ TEST_F(KlistTest, MP) TEST_F(KlistTest, ReadMesh) { - std::string k_file = "KPT"; + std::string k_file = "./support/KPT"; kv.nspin = 1; kv.read_kpoints(k_file); EXPECT_EQ(kv.nkstot,512); - remove("KPT"); + //remove("KPT"); } TEST_F(KlistTest, ReadMP) { K_Vectors kv; - std::string k_file = "KPT1"; + std::string k_file = "./support/KPT1"; kv.nspin = 1; kv.read_kpoints(k_file); EXPECT_EQ(kv.nkstot,512); - remove("KPT1"); + //remove("KPT1"); } TEST_F(KlistTest, ReadList) @@ -137,11 +137,11 @@ TEST_F(KlistTest, ReadList) ModuleSymmetry::Symmetry::symm_flag=0; // symm_flag is required in read_kpoints for a k list K_Vectors kv; - std::string k_file = "KPT2"; + std::string k_file = "./support/KPT2"; kv.nspin = 1; kv.read_kpoints(k_file); EXPECT_EQ(kv.nkstot,122); - remove("KPT2"); + //remove("KPT2"); } TEST_F(KlistTest, Kspacing) @@ -154,10 +154,10 @@ TEST_F(KlistTest, Kspacing) GlobalC::ucell.G = GlobalC::ucell.GT.Transpose(); GlobalC::ucell.lat0 = 1.8897261254578281; GlobalV::KSPACING = 0.052918; // 0.52918/Bohr = 1/A - std::string k_file = "KPT3"; + std::string k_file = "./support/KPT3"; kv.read_kpoints(k_file); EXPECT_EQ(kv.nkstot,343); - remove("KPT3"); + //remove("KPT3"); GlobalV::KSPACING=0.0; } @@ -165,7 +165,7 @@ TEST_F(KlistTest, Kspacing) TEST_F(KlistTest, Renew) { K_Vectors kv; - std::string k_file = "KPT4"; + std::string k_file = "./support/KPT4"; //Cartesian: non-spin case nspin=1 kv.nspin = 1; kv.read_kpoints(k_file); @@ -182,7 +182,7 @@ TEST_F(KlistTest, Renew) TEST_F(KlistTest, LineCartesian) { K_Vectors kv; - std::string k_file = "KPT5"; + std::string k_file = "./support/KPT5"; //Line Cartesian: non-spin case nspin=1 kv.nspin = 1; kv.set_kup_and_kdw_after_vc(); @@ -196,7 +196,7 @@ TEST_F(KlistTest, LineCartesian) kv.read_kpoints(k_file); EXPECT_EQ(kv.nkstot,51); EXPECT_EQ(kv.kvec_c.size(),102); - remove("KPT5"); + //remove("KPT5"); } @@ -204,7 +204,7 @@ TEST_F(KlistTest, LineCartesian) TEST_F(KlistTest, SetKupKdownAfterXC) { K_Vectors kv; - std::string k_file = "KPT4"; + std::string k_file = "./support/KPT4"; //Cartesian: non-spin case nspin=1 kv.nspin = 1; kv.read_kpoints(k_file); @@ -238,7 +238,7 @@ TEST_F(KlistTest, SetKupKdownAfterXC) EXPECT_EQ(kv.isk[ik+5],1); } - remove("KPT4"); + //remove("KPT4"); } diff --git a/source/module_cell/test/KPT b/source/module_cell/test/support/KPT similarity index 100% rename from source/module_cell/test/KPT rename to source/module_cell/test/support/KPT diff --git a/source/module_cell/test/KPT1 b/source/module_cell/test/support/KPT1 similarity index 100% rename from source/module_cell/test/KPT1 rename to source/module_cell/test/support/KPT1 diff --git a/source/module_cell/test/KPT2 b/source/module_cell/test/support/KPT2 similarity index 100% rename from source/module_cell/test/KPT2 rename to source/module_cell/test/support/KPT2 diff --git a/source/module_cell/test/KPT4 b/source/module_cell/test/support/KPT4 similarity index 100% rename from source/module_cell/test/KPT4 rename to source/module_cell/test/support/KPT4 diff --git a/source/module_cell/test/KPT5 b/source/module_cell/test/support/KPT5 similarity index 100% rename from source/module_cell/test/KPT5 rename to source/module_cell/test/support/KPT5