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

[GeoMechanicsApplication] gtests #11896

wants to merge 53 commits into from

Conversation

markelov208
Copy link
Contributor

📝 Description
A brief description of the PR.

Please mark the PR with appropriate tags:

  • The PR has been created to check the differences

🆕 Changelog
Please summarize the changes in one list to generate the changelog:
E.g.

  • Added feature X to Y
  • Added Foo Application
  • Fixed X (#XXXX Reference to issue if apply)
  • etc...

roigcarlo and others added 30 commits July 25, 2023 11:05
# Conflicts:
#	CMakeLists.txt
#	kratos/CMakeLists.txt
#	kratos/includes/global_pointer.h
#	kratos/mpi/CMakeLists.txt
#	kratos/mpi/tests/cpp_tests/utilities/test_search_utilities.cpp
#	kratos/testing/testing.h
#	kratos/tests/cpp_tests/processes/test_set_initial_state_process.cpp
#	kratos/tests/test_utilities/test_constitutive_law.cpp
#	scripts/wheels/linux/configure.sh
#	scripts/wheels/linux/configure_mpi.sh
#	scripts/wheels/windows/configure.bat
@markelov208 markelov208 changed the title Draft [GeoMechanicsAppliation] gtests [GeoMechanicsApplication] gtests Dec 18, 2023
@markelov208
Copy link
Contributor Author

markelov208 commented Dec 18, 2023 via email

Gennady Markelov added 12 commits December 20, 2023 16:19
# Conflicts:
#	CMakeLists.txt
#	applications/PfemSolidMechanicsApplication/custom_problemtype/Kratos_Pfem_Solid_Mechanics_Application.gid/002_Kratos_Pfem_Solid_Mechanics_Application_aux.win.bas
#	docs/pages/Kratos/For_Developers/General/How-to-make-Git-ignore-the-files-resulting-from-a-compilation-without-conflicts-in-.gitignore.md
#	kratos/python_scripts/testing/run_tests.py
#	kratos/run_kratos/CMakeLists.txt
- added gtest to CMakeLists.txt
- added KRATOS_API(GE_MECHANICS_APPLICATION)
- added KRATOS_API(STRUCTURAL_MECHNAICS_APPLICATION)
- added KRATOS_API(KRATOS_CORE)
- removed KRATOS_API(KRATOS_CORE)
- moved scoped_file.* to
- added Kratos*FastSuite classes in testing.h
- moved  test_element.* and test_constitutive_law.* to tests/cpp_tests/utilities
- replaced KRATOS_SKIP_TEST_IF_NOT with KRATOS_ERROR_IF_NOT in test_integration_values_extrapolation_to_nodes_process.cpp
- removed running gtest automatically
- added TestBarElement manually to KratosCoreTest.exe
- changed libs to lib because libs is deleted
- changed KratosStructuralMechanicsTests to KratosStructuralMechanicsTest to be consistent with other executables
CMakeLists.txt Outdated
@@ -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

Gennady Markelov added 5 commits January 15, 2024 15:31
- added geo_testing.h
- added structural_testing.h
- changed const std::vector<double> to Vector
- added KRATOS_ERROR_IN_NOT in test_total_lagrangian_mixed_volumetric_strain_element.cpp
- changed KRATOS_ERROR_IF to EXPECT_THAT in expect.h
- removed KratosStructural* and KratosGeo* from testing.h
Comment on lines 38 to 39
KRATOS_EXPECT_EQ("Test", "Test");
KRATOS_EXPECT_NE("Test ", "Test");
Copy link
Member

Choose a reason for hiding this comment

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

this change does not seem right, should work either way. Can you elaborate please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this branch KRATOS_EXPECT_EQ is replaced with EXPECT_EQ which tests memory allocations for C strings. I guess these two lines were used to check KRATOS_EXPECT_* functionality for C strings. Perhaps, it is better to remove them now.

Comment on lines 29 to 33
std::string WorkingDirectorySellmeijer()
{
auto projectDirectory = "./applications/GeoMechanicsApplication/tests/test_compare_sellmeijer/HeightAquiferD10L30.gid";
auto kratos_source_directory = std::getenv("KRATOS_SOURCE");
return (std::string)kratos_source_directory + "/" + (std::string)projectDirectory;
Copy link
Member

Choose a reason for hiding this comment

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

I strongly recommend to use std::filesystem::path for anything related to file paths

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for pointing. string is replaced with path.

@roigcarlo roigcarlo mentioned this pull request Apr 2, 2024
6 tasks
@markelov208 markelov208 deleted the geo/gtests branch May 17, 2024 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GeoMechanics Issues related to the GeoMechanicsApplication
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants