Skip to content

Commit

Permalink
Test: Add unit tests for the project
Browse files Browse the repository at this point in the history
  • Loading branch information
ysyecust committed Feb 19, 2024
1 parent 9ad06c4 commit 4003840
Show file tree
Hide file tree
Showing 6 changed files with 15,453 additions and 4 deletions.
14 changes: 13 additions & 1 deletion unidock/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,29 @@ find_package(OpenMP REQUIRED) # OpenMP only required in main.cpp
find_package(Boost 1.72 REQUIRED
COMPONENTS system thread serialization filesystem program_options timer)
include_directories(${Boost_INCLUDE_DIRS})
include_directories(src/lib src/cuda)
include_directories(src/lib src/cuda )
add_executable(${VINA_BIN_NAME} src/main/main.cpp)
add_executable(split src/split/split.cpp)

# add_executable(unitest unitest/test.cpp unitest/catch_amalgamated.cpp)
# target_include_directories(unitest PUBLIC unitest)
include_directories(${CMAKE_SOURCE_DIR}/unitest)
file(GLOB_RECURSE TEST_SOURCES "${CMAKE_SOURCE_DIR}/unitest/*.cpp")
add_executable(unit_tests ${TEST_SOURCES})



target_link_libraries(${VINA_BIN_NAME} Boost::system Boost::thread Boost::serialization Boost::filesystem Boost::program_options Boost::timer)
target_link_libraries(split Boost::system Boost::thread Boost::serialization Boost::filesystem Boost::program_options Boost::timer)
target_link_libraries(${VINA_BIN_NAME} OpenMP::OpenMP_CXX)

# set(CMAKE_CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/lib)
add_library(lib OBJECT
src/lib/ad4cache.cpp src/lib/cache.cpp src/lib/non_cache.cpp src/lib/conf_independent.cpp src/lib/coords.cpp src/lib/grid.cpp src/lib/szv_grid.cpp src/lib/model.cpp src/lib/mutate.cpp src/lib/parallel_mc.cpp src/lib/parse_pdbqt.cpp src/lib/quasi_newton.cpp src/lib/quaternion.cpp src/lib/random.cpp src/lib/utils.cpp src/lib/vina.cpp src/lib/precalculate.h)

target_link_libraries(unit_tests Boost::system Boost::thread Boost::serialization Boost::filesystem Boost::program_options Boost::timer)
target_link_libraries(unit_tests OpenMP::OpenMP_CXX)
target_link_libraries(unit_tests lib)
# src/lib/monte_carlo
# set(CMAKE_CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/cuda)
add_library(cuda OBJECT src/cuda/monte_carlo.cu src/cuda/precalculate.cu)
Expand Down
6 changes: 3 additions & 3 deletions unidock/src/lib/parse_pdbqt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ struct movable_atom : public atom {
}
};

struct rigid {
atomv atoms;
};
// struct rigid {
// atomv atoms;
// };

typedef std::vector<movable_atom> mav;

Expand Down
4 changes: 4 additions & 0 deletions unidock/src/lib/parse_pdbqt.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,8 @@ model parse_ligand_pdbqt_from_string(const std::string &string_name,
atom_type::t atype); // can exit with code EXIT_FAILURE
model parse_ligand_pdbqt_from_string_no_failure(
const std::string &string_name, atom_type::t atype); // can return empty model as failure
struct rigid {
atomv atoms;
};
void parse_pdbqt_rigid(const path& name, rigid& r);
#endif
Loading

0 comments on commit 4003840

Please sign in to comment.