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 2 commits
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
2 changes: 2 additions & 0 deletions kratos/testing/test_case.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,14 @@ KRATOS_TESTING_TEST_CASE_CLASS_BODY(TestCaseName,ParentName) \
// TestModelPartConstruction::mDummy;
// void TestModelPartConstruction::TestFunction()
//
/*
#define KRATOS_TEST_CASE(TestCaseName) \
KRATOS_TESTING_TEST_CASE_CLASS(TestCaseName, TestCase) \
const Kratos::Testing::Internals::RegisterThisTest< KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName) > \
KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::mDummy; \
\
void KRATOS_TESTING_CREATE_CLASS_NAME(TestCaseName)::TestFunction()
*/

#define KRATOS_DISABLED_TEST_CASE(TestCaseName) \
KRATOS_TESTING_TEST_CASE_CLASS(TestCaseName, TestCase) \
Expand Down
4 changes: 2 additions & 2 deletions kratos/tests/cpp_tests/sources/test_checks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ namespace Kratos {
KRATOS_EXPECT_EQ(1.0, 1.0);
KRATOS_EXPECT_NE(1.0, 2.0);

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.

KRATOS_EXPECT_EQ(strcmp("Test", "Test"), 0);
KRATOS_EXPECT_NE(strcmp("Test ", "Test"), 0);

KRATOS_EXPECT_LT(1., 2.);
KRATOS_EXPECT_LE(1., 1.);
Expand Down