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

[Core][MPI] Reorganize testing utilities #11553

Merged
merged 5 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "containers/model.h"
#include "contact_structural_mechanics_application_variables.h"
#include "custom_conditions/mesh_tying_mortar_condition.h"
#include "tests/cpp_tests/auxiliar_files_for_cpp_unnitest/test_laplacian_element.h"
#include "tests/test_utilities/test_laplacian_element.h"
// #include "input_output/vtk_output.h"

/* Geometries */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
#include "mpi/includes/mpi_data_communicator.h"
#include "mpi/utilities/parallel_fill_communicator.h"
#include "mpi/utilities/model_part_communicator_utilities.h"
#include "mpi/utilities/mpi_cpp_test_utilities.h"
#include "mpi/tests/test_utilities/mpi_cpp_test_utilities.h"

/* Element include */
#include "geometries/line_2d_2.h"
#include "tests/cpp_tests/auxiliar_files_for_cpp_unnitest/test_bar_element.h"
#include "tests/test_utilities/test_bar_element.h"

/* Linear solvers */
#include "linear_solvers/linear_solver.h"
Expand Down
5 changes: 4 additions & 1 deletion kratos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ file(GLOB KRATOS_EXPRESSION_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/expression/*.cpp

## Kratos tests sources. Enabled by default
if(${KRATOS_BUILD_TESTING} MATCHES ON)
file(GLOB_RECURSE KRATOS_TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cpp)
file(GLOB_RECURSE KRATOS_TEST_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/tests/test_utilities/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/tests/cpp_tests/*.cpp
)
endif(${KRATOS_BUILD_TESTING} MATCHES ON)

## Define KratosVersion object
Expand Down
5 changes: 4 additions & 1 deletion kratos/mpi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ file(GLOB_RECURSE KRATOS_MPI_PYTHON_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/python/*

## Kratos MPI test sources.
if(${KRATOS_BUILD_TESTING} MATCHES ON)
file(GLOB_RECURSE KRATOS_MPI_TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/tests/cpp_tests/*.cpp)
file(GLOB_RECURSE KRATOS_MPI_TEST_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/tests/test_utilities/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/tests/cpp_tests/*.cpp
)
endif(${KRATOS_BUILD_TESTING} MATCHES ON)

###############################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// Project includes
#include "testing/testing.h"
#include "containers/model.h"
#include "mpi/utilities/mpi_cpp_test_utilities.h"
#include "mpi/tests/test_utilities/mpi_cpp_test_utilities.h"
#include "mpi/utilities/parallel_fill_communicator.h"
#include "mpi/utilities/gather_modelpart_utility.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// Project includes
#include "testing/testing.h"
#include "containers/model.h"
#include "mpi/utilities/mpi_cpp_test_utilities.h"
#include "mpi/tests/test_utilities/mpi_cpp_test_utilities.h"
#include "mpi/utilities/parallel_fill_communicator.h"

namespace Kratos::Testing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
#include "geometries/line_2d_2.h"
#include "utilities/global_pointer_utilities.h"
#include "mpi/includes/mpi_data_communicator.h"
#include "mpi/utilities/mpi_cpp_test_utilities.h"
#include "mpi/tests/test_utilities/mpi_cpp_test_utilities.h"
#include "mpi/utilities/model_part_communicator_utilities.h"
#include "mpi/utilities/parallel_fill_communicator.h"
#include "tests/cpp_tests/auxiliar_files_for_cpp_unnitest/test_bar_element.h"
#include "tests/test_utilities/test_bar_element.h"

namespace Kratos
{
Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions kratos/tests/cpp_tests/includes/test_property_accessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#include "includes/properties.h"
#include "includes/table_accessor.h"
#include "geometries/quadrilateral_2d_4.h"
#include "tests/cpp_tests/auxiliar_files_for_cpp_unnitest/test_element.h"
#include "tests/cpp_tests/auxiliar_files_for_cpp_unnitest/test_constitutive_law.h"
#include "tests/test_utilities/test_element.h"
#include "tests/test_utilities/test_constitutive_law.h"
#include "includes/serializer.h"

namespace Kratos::Testing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
// Project includes
#include "containers/model.h"
#include "testing/testing.h"
#include"tests/cpp_tests/auxiliar_files_for_cpp_unnitest/test_constitutive_law.h"
#include"tests/cpp_tests/auxiliar_files_for_cpp_unnitest/test_element.h"
#include"tests/test_utilities/test_constitutive_law.h"
#include"tests/test_utilities/test_element.h"
#include "geometries/quadrilateral_2d_4.h"
#include "geometries/tetrahedra_3d_4.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

/* Element include */
#include "geometries/line_2d_2.h"
#include "tests/cpp_tests/auxiliar_files_for_cpp_unnitest/test_bar_element.h"
#include "tests/test_utilities/test_bar_element.h"

/* Linear solvers */
#include "linear_solvers/reorderer.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "includes/model_part.h"
#include "spaces/ublas_space.h"
#include "geometries/line_2d_2.h"
#include "tests/cpp_tests/auxiliar_files_for_cpp_unnitest/test_bar_element.h"
#include "tests/test_utilities/test_bar_element.h"
#include "solving_strategies/builder_and_solvers/explicit_builder.h"

namespace Kratos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "includes/define.h"
#include "includes/model_part.h"
#include "spaces/ublas_space.h"
#include "tests/cpp_tests/auxiliar_files_for_cpp_unnitest/test_element.h"
#include "tests/test_utilities/test_element.h"
#include "solving_strategies/builder_and_solvers/residualbased_block_builder_and_solver.h"
#include "solving_strategies/strategies/explicit_solving_strategy.h"
#include "utilities/math_utils.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#include "spaces/ublas_space.h"

/* Element include */
#include "tests/cpp_tests/auxiliar_files_for_cpp_unnitest/test_element.h"
#include "tests/cpp_tests/auxiliar_files_for_cpp_unnitest/test_constitutive_law.h"
#include "tests/test_utilities/test_element.h"
#include "tests/test_utilities/test_constitutive_law.h"

// Linear solvers
#include "linear_solvers/reorderer.h"
Expand Down
10 changes: 5 additions & 5 deletions kratos/tests/test_kratos_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
json_with_includes = """
{
"bool_value" : true, "double_value": 2.0, "int_value" : 10,
"@include_json" : "cpp_tests/auxiliar_files_for_cpp_unnitest/test_included_parameters.json"
"@include_json" : "test_utilities/test_included_parameters.json"
}
"""

Expand All @@ -243,7 +243,7 @@
"bool_value" : true, "double_value": 2.0, "int_value" : 10,
"level1":
{
"@include_json" : "cpp_tests/auxiliar_files_for_cpp_unnitest/more_levels_test_included_parameters.json"
"@include_json" : "test_utilities/more_levels_test_included_parameters.json"
},
"string_value" : "hello"
}
Expand All @@ -254,18 +254,18 @@
"bool_value" : true, "double_value": 2.0, "int_value" : 10,
"level1": [
{
"@include_json" : "cpp_tests/auxiliar_files_for_cpp_unnitest/more_levels_test_included_parameters.json",
"@include_json" : "test_utilities/more_levels_test_included_parameters.json",
"vector": [
{
"@include_json" : "cpp_tests/auxiliar_files_for_cpp_unnitest/more_levels_test_included_parameters.json"
"@include_json" : "test_utilities/more_levels_test_included_parameters.json"
}
]
},
{
"hello": 0
},
{
"@include_json" : "cpp_tests/auxiliar_files_for_cpp_unnitest/more_levels_test_included_parameters.json"
"@include_json" : "test_utilities/more_levels_test_included_parameters.json"
}
],
"string_value" : "hello"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "includes/define.h"
#include "includes/expect.h"
#include "includes/variables.h"
#include "tests/cpp_tests/auxiliar_files_for_cpp_unnitest/test_bar_element.h"
#include "tests/test_utilities/test_bar_element.h"

namespace Kratos::Testing
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// External includes

// Project includes
#include "tests/cpp_tests/auxiliar_files_for_cpp_unnitest/test_constitutive_law.h"
#include "tests/test_utilities/test_constitutive_law.h"
#include "includes/expect.h"


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "includes/define.h"
#include "includes/expect.h"
#include "includes/variables.h"
#include "tests/cpp_tests/auxiliar_files_for_cpp_unnitest/test_element.h"
#include "tests/test_utilities/test_element.h"

namespace Kratos::Testing
{
Expand Down
8 changes: 8 additions & 0 deletions kratos/tests/test_utilities/test_included_parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"level1":
{
"list_value":[ 3, "hi", false],
"tmp" : 5.0
},
"@include_json" : "test_utilities/test_included_parameters_level2.json"
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "includes/variables.h"
#include "utilities/math_utils.h"
#include "utilities/geometry_utilities.h"
#include "tests/cpp_tests/auxiliar_files_for_cpp_unnitest/test_laplacian_element.h"
#include "tests/test_utilities/test_laplacian_element.h"

namespace Kratos::Testing
{
Expand Down