Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GeoMechanicsApplication] gtests #11896

Closed
wants to merge 53 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
cfdbe49
Prepare to build gtests
roigcarlo Jul 25, 2023
0c6e1ee
Removing references to runkratos
roigcarlo Jul 25, 2023
0eec903
Enable gtesting
roigcarlo Jul 25, 2023
622723b
Add target for the core
roigcarlo Jul 25, 2023
a48cce7
Moving mpi related test utilities out of the core
roigcarlo Jul 25, 2023
6caf59a
Fixing mpi dependant tests
roigcarlo Jul 25, 2023
88d416b
Refactor core and mpicore tests
roigcarlo Jul 25, 2023
9042bd9
Updating tests
roigcarlo Jul 27, 2023
da0b2a5
Adding gtest
roigcarlo Jul 27, 2023
b47ee25
Patch for cmake 3.27
roigcarlo Jul 27, 2023
95ab5f4
Mpi tests
roigcarlo Jul 28, 2023
b45c82a
Adding kernel destructor and fixing mpi test with individual kernel i…
roigcarlo Jul 28, 2023
14186bf
Restoring internal macros checks
roigcarlo Jul 31, 2023
8c34e88
Fixing problem comparing array_1d with ZeroVector(x) from boost
roigcarlo Jul 31, 2023
d5550bc
Fixing cstr cmp in text excpetion
roigcarlo Jul 31, 2023
35020c4
Fixing cstr cmp in code location
roigcarlo Jul 31, 2023
c0c3240
Test_checks now checks the checks class. Checkmate
roigcarlo Jul 31, 2023
956125b
Fixing logger test (bad copy paste)
roigcarlo Jul 31, 2023
b064b3c
Merge branch 'master' into ci/gtests
roigcarlo Aug 3, 2023
d48fa49
Min cmake version
roigcarlo Aug 22, 2023
74f10ef
Missing include
roigcarlo Aug 22, 2023
dcc5bfb
Using distributed expects
roigcarlo Aug 22, 2023
28de457
Merge branch 'master' into ci/gtests
roigcarlo Aug 25, 2023
e455d15
Removing testing_ folder
roigcarlo Aug 25, 2023
d12daff
Merge branch 'master' into ci/gtests
roigcarlo Aug 31, 2023
ea4aba4
Merge conflicts
roigcarlo Aug 31, 2023
40002cc
declared size_t
Dec 1, 2023
6a4aefa
compilable version without MPI
Dec 6, 2023
d51f66b
added testing folder
Dec 13, 2023
40283f5
Merge branch 'master' into ci/gtests
Dec 15, 2023
72aefb5
added file(GLOB_RECURSE KRATOS_TEST_SOURCES
Dec 18, 2023
600be3c
changed MPISynchronousPointSynchronization
Dec 20, 2023
ceaa848
made comparison of pointers before calling the macros
Dec 20, 2023
1d36556
moved cpp_tests_utilities.* from utilities to tests/cpp_tests/utilities
Dec 20, 2023
44a9a1c
added USE_MPI OFF to test Deltares TC
Dec 20, 2023
d00247f
corrected include for test_suite.h
Dec 20, 2023
e8c1a31
added tests/cpp_tests/*.cpp to KRATOS_TEST_UTILITIES_SOURCES to compi…
Dec 20, 2023
b687b5e
Merge branch 'master' into geo/gtests
Dec 20, 2023
9c63731
added include of test_suite.h
Dec 20, 2023
ae8570c
- moved cpp_tests_utilities.* to tests/test_utilities
Jan 9, 2024
6632c22
commented Factory, it seems it is not used in Kratos yet.
Jan 11, 2024
32cc295
modifications in CMakeLists.txt files
Jan 11, 2024
361f77b
CMake files
Jan 12, 2024
9a3911a
reverted libs
Jan 15, 2024
397c1af
modifications
Jan 17, 2024
5cab920
added KRATOS_SOURCE to working directories
Jan 19, 2024
5dd3345
removed second definition of KRATOS_TEST_CASE
Jan 28, 2024
ef3d3e7
changed comparison of strings
Jan 28, 2024
7650717
removed USE_MPI set
Jan 29, 2024
39fccb8
changed size_t to unsigned long to compile on Windows
Jan 31, 2024
76b1b5a
added/removed KRATOS_API(KRATOS_CORE)
Jan 31, 2024
2857cf8
commented KRATOS_TEST_CASE_IN_SUITE to avoid the macro redefinition w…
Jan 31, 2024
d06607d
used std::filesystem::path instead of std::string
Jan 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -651,8 +651,8 @@ kratos_python_install(${INSTALL_PYTHON_USING_LINKS} "${KRATOS_SOURCE_DIR}/kratos
kratos_python_install(${INSTALL_PYTHON_USING_LINKS} "${KRATOS_SOURCE_DIR}/kratos/python_interface/python_registry_utilities.py" "KratosMultiphysics/python_registry_utilities.py" )

# Install the libraries in the libs folder
install(FILES ${Boost_LIBRARIES} DESTINATION libs)
install(FILES ${EXTRA_INSTALL_LIBS} DESTINATION libs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markelov208 Please do not change this.

Libs needs to be deleted and repopulated at every compilation to avoid mismatching versions of the same library. This change is intentional.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roigcarlo , thank you for letting me know. Currently, the libs folder is populated and then deleted.
[39/40] Install the project...
-- Install configuration: "Debug"
-- Deleting: D:/Checkouts2/KratosProjects/alpha/bin/Debug/KratosMultiphysics
-- Deleting: D:/Checkouts2/KratosProjects/alpha/bin/Debug/libs

Build finished

Please could you let me know how to change the order in cmake file? Thank you.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The log its a little bit misleading, its the other way around, libs folders gets deleted and then populated if the compilation goes well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, this is exactly what I have on my laptop: files are copied into libs folder, then libs is deleted. ;) I have reverted libs and put REMOVE_INSTALL_DIRECTORIES OFF.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmm that's quite odd. In any case, its important to maintain the name libs, so if it fails as last resource we can comment the lines that remove the contents of the folder, but changing the name will effectively break the release and RPATH so that cannot be changed

install(FILES ${Boost_LIBRARIES} DESTINATION lib)
install(FILES ${EXTRA_INSTALL_LIBS} DESTINATION lib)

# Perform post-install tasks (add_subdirectory commands are guaranteed to be executed in order)
add_subdirectory("scripts/post_install")
4 changes: 2 additions & 2 deletions applications/GeoMechanicsApplication/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ if(${INSTALL_TESTING_FILES} MATCHES ON )
endif(${INSTALL_TESTING_FILES} MATCHES ON)

# Install targets
install(TARGETS KratosGeoMechanicsCore DESTINATION libs )
install(TARGETS KratosGeoMechanicsApplication DESTINATION libs )
install(TARGETS KratosGeoMechanicsCore DESTINATION lib )
install(TARGETS KratosGeoMechanicsApplication DESTINATION lib )

# Define custom targets
set(KRATOS_KERNEL "${KRATOS_KERNEL};KratosGeoMechanicsCore" PARENT_SCOPE)
Expand Down
4 changes: 2 additions & 2 deletions applications/LinearSolversApplication/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ if(${INSTALL_TESTING_FILES} MATCHES ON )
endif(${INSTALL_TESTING_FILES} MATCHES ON)

# Install targets
install( TARGETS KratosLinearSolversCore DESTINATION libs )
install( TARGETS KratosLinearSolversApplication DESTINATION libs )
install( TARGETS KratosLinearSolversCore DESTINATION lib )
install( TARGETS KratosLinearSolversApplication DESTINATION lib )

# Define custom targets
set(KRATOS_KERNEL "${KRATOS_KERNEL};KratosLinearSolversCore" PARENT_SCOPE)
Expand Down
12 changes: 6 additions & 6 deletions applications/StructuralMechanicsApplication/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ set_target_properties(KratosStructuralMechanicsCore PROPERTIES COMPILE_DEFINITIO
if (${KRATOS_BUILD_TESTING} MATCHES ON)
file(GLOB_RECURSE KRATOS_STRUCTURAL_MECHANICS_APPLICATION_TESTING_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/tests/cpp_tests/*.cpp)

add_executable(KratosStructuralMechanicsTests ${KRATOS_STRUCTURAL_MECHANICS_APPLICATION_TESTING_SOURCES})
add_executable(KratosStructuralMechanicsTest ${KRATOS_STRUCTURAL_MECHANICS_APPLICATION_TESTING_SOURCES})

target_link_libraries(KratosStructuralMechanicsTests PUBLIC KratosStructuralMechanicsCore KratosCoreTestUtilities GTest::gtest_main)
target_link_libraries(KratosStructuralMechanicsTest PUBLIC KratosStructuralMechanicsCore KratosCoreTestUtilities GTest::gtest_main)

install(TARGETS KratosStructuralMechanicsTests)
install(TARGETS KratosStructuralMechanicsTest)

include(GoogleTest)
# gtest_discover_tests(KratosStructuralMechanicsTests)
# gtest_discover_tests(KratosStructuralMechanicsTest)

endif (${KRATOS_BUILD_TESTING} MATCHES ON)

Expand Down Expand Up @@ -79,8 +79,8 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests DESTINATION applications/${C
)

# Install targets
install(TARGETS KratosStructuralMechanicsCore DESTINATION libs )
install(TARGETS KratosStructuralMechanicsApplication DESTINATION libs )
install(TARGETS KratosStructuralMechanicsCore DESTINATION lib)
install(TARGETS KratosStructuralMechanicsApplication DESTINATION lib)

# Define custom targets
set(KRATOS_KERNEL "${KRATOS_KERNEL};KratosStructuralMechanicsCore" PARENT_SCOPE)
Expand Down
6 changes: 3 additions & 3 deletions kratos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ if(${KRATOS_BUILD_TESTING} MATCHES ON)
${CMAKE_BINARY_DIR}/kratos/CMakeFiles/KratosCoreTestUtilities.dir/tests/test_utilities/test_bar_element.cpp.obj
)

install(TARGETS KratosCoreTestUtilities DESTINATION libs)
install(TARGETS KratosCoreTestUtilities DESTINATION lib)
install(TARGETS KratosCoreTest)

gtest_discover_tests(KratosCoreTest)
Expand Down Expand Up @@ -206,8 +206,8 @@ if(${INSTALL_TESTING_FILES} MATCHES ON )
endif(${INSTALL_TESTING_FILES} MATCHES ON)

# Install targets
install(TARGETS Kratos DESTINATION libs )
install(TARGETS KratosCore DESTINATION libs)
install(TARGETS Kratos DESTINATION lib)
install(TARGETS KratosCore DESTINATION lib)

# Mpi
if(${USE_MPI} MATCHES ON )
Expand Down
Loading