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

Gtest print eclass #964

Merged
merged 6 commits into from
Mar 5, 2024
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
2 changes: 1 addition & 1 deletion test/t8_cmesh/t8_gtest_bcast.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ TEST_P (cmesh_hypercube, bcast_equal_no_bcast)
EXPECT_TRUE (t8_cmesh_is_equal (cmesh_bcast, cmesh_check));
}

INSTANTIATE_TEST_SUITE_P (t8_gtest_bcast, cmesh_hypercube, AllEclasses);
INSTANTIATE_TEST_SUITE_P (t8_gtest_bcast, cmesh_hypercube, AllEclasses, print_eclass);
2 changes: 1 addition & 1 deletion test/t8_cmesh/t8_gtest_cmesh_face_is_boundary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ TEST_P (cmesh_face_boundary_one_tree, check_face_is_boundary_one_tree)
}
}

INSTANTIATE_TEST_SUITE_P (t8_gtest_cmesh_face_boundary, cmesh_face_boundary_one_tree, AllEclasses);
INSTANTIATE_TEST_SUITE_P (t8_gtest_cmesh_face_boundary, cmesh_face_boundary_one_tree, AllEclasses, print_eclass);

/* For a two tree cmesh, compute a parallel distribution of the trees.
* If we have more than 1 process, the first half of process (rank < size/2)
Expand Down
2 changes: 1 addition & 1 deletion test/t8_forest/t8_gtest_find_owner.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,4 @@ TEST_P (forest_find_owner, find_multiple_owners)
sc_array_reset (&owners);
}

INSTANTIATE_TEST_SUITE_P (t8_gtest_find_owner, forest_find_owner, AllEclasses);
INSTANTIATE_TEST_SUITE_P (t8_gtest_find_owner, forest_find_owner, AllEclasses, print_eclass);
4 changes: 3 additions & 1 deletion test/t8_forest_incomplete/t8_gtest_empty_local_tree.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <t8_forest/t8_forest.h>
#include <t8_forest/t8_forest_types.h>
#include <t8_schemes/t8_default/t8_default_cxx.hxx>
#include <test/t8_gtest_macros.hxx>
#include <bitset>

#define MAX_NUM_RANKS 8
Expand Down Expand Up @@ -156,4 +157,5 @@ TEST_P (local_tree, test_empty_local_tree)
}
}

INSTANTIATE_TEST_SUITE_P (t8_gtest_empty_local_tree, local_tree, testing::Range (T8_ECLASS_LINE, T8_ECLASS_COUNT));
INSTANTIATE_TEST_SUITE_P (t8_gtest_empty_local_tree, local_tree, testing::Range (T8_ECLASS_LINE, T8_ECLASS_COUNT),
print_eclass);
2 changes: 1 addition & 1 deletion test/t8_forest_incomplete/t8_gtest_permute_hole.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,4 @@ TEST_P (forest_permute, test_permute_hole)
}
}

INSTANTIATE_TEST_SUITE_P (t8_gtest_permute_hole, forest_permute, AllEclasses);
INSTANTIATE_TEST_SUITE_P (t8_gtest_permute_hole, forest_permute, AllEclasses, print_eclass);
4 changes: 3 additions & 1 deletion test/t8_forest_incomplete/t8_gtest_recursive.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <t8_cmesh/t8_cmesh_examples.h>
#include <t8_forest/t8_forest.h>
#include <t8_schemes/t8_default/t8_default_cxx.hxx>
#include <test/t8_gtest_macros.hxx>

/* In this test, we recursively constructs a mesh containing only the first
* and last elements of a family. Furthermore, for every two elements
Expand Down Expand Up @@ -141,4 +142,5 @@ TEST_P (recursive_tree, test_recursive)
ASSERT_TRUE (t8_forest_is_equal (forest, forest_base));
}

INSTANTIATE_TEST_SUITE_P (t8_gtest_recursive, recursive_tree, testing::Range (T8_ECLASS_LINE, T8_ECLASS_COUNT));
INSTANTIATE_TEST_SUITE_P (t8_gtest_recursive, recursive_tree, testing::Range (T8_ECLASS_LINE, T8_ECLASS_COUNT),
print_eclass);
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,6 @@ TEST_P (class_2d_element_linear_cad_surface, t8_check_2d_element_linear_cad_surf
}

INSTANTIATE_TEST_SUITE_P (t8_gtest_check_2d_element_linear_cad_surface, class_2d_element_linear_cad_surface,
AllEclasses2D);
AllEclasses2D, print_eclass);

#endif /* T8_WITH_OCC */
1 change: 1 addition & 0 deletions test/t8_geometry/t8_gtest_geometry.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <t8_geometry/t8_geometry.h>
#include <t8_geometry/t8_geometry_implementations/t8_geometry_linear.hxx>
#include <t8_geometry/t8_geometry_implementations/t8_geometry_zero.hxx>
#include <test/t8_gtest_macros.hxx>

/* In this file we collect tests for t8code's cmesh geometry module.
* These tests are
Expand Down
2 changes: 1 addition & 1 deletion test/t8_gtest_eclass.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,4 @@ TEST (gtest_eclass, eclass_order)
EXPECT_EQ (t8_eclass_compare (T8_ECLASS_HEX, T8_ECLASS_TET), 1);
}

INSTANTIATE_TEST_SUITE_P (t8_gtest_eclass, gtest_eclass, AllEclasses);
INSTANTIATE_TEST_SUITE_P (t8_gtest_eclass, gtest_eclass, AllEclasses, print_eclass);
6 changes: 6 additions & 0 deletions test/t8_gtest_macros.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ along with t8code; if not, write to the Free Software Foundation, Inc.,
#include <t8_eclass.h>
#include <t8_cmesh/t8_cmesh_testcases.h>

/**
* lambda to pass to an INSTANTIATE_TEST_SUITE_P to print the current cmesh_example_base
*
*/
auto print_eclass = [] (const testing::TestParamInfo<t8_eclass> &info) { return t8_eclass_to_string[info.param]; };

#define AllEclasses testing::Range (T8_ECLASS_ZERO, T8_ECLASS_COUNT)
#define AllEclasses2D testing::Values (T8_ECLASS_QUAD, T8_ECLASS_TRIANGLE)
#define AllCmeshs testing::Range (0, t8_get_number_of_all_testcases ())
Expand Down
3 changes: 2 additions & 1 deletion test/t8_schemes/t8_gtest_ancestor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ along with t8code; if not, write to the Free Software Foundation, Inc.,

#include <gtest/gtest.h>
#include <test/t8_gtest_custom_assertion.hxx>
#include <test/t8_gtest_macros.hxx>
#include <t8_eclass.h>
#include <t8_schemes/t8_default/t8_default_pyramid/t8_dpyramid_bits.h>
#include <t8_schemes/t8_default/t8_default_cxx.hxx>
Expand Down Expand Up @@ -118,4 +119,4 @@ TEST_P (ancestor, multi_level_recursive_check)
ts->t8_element_destroy (1, &correct_anc_high_level);
}

INSTANTIATE_TEST_SUITE_P (t8_gtest_ancestor, ancestor, testing::Values (T8_ECLASS_PYRAMID));
INSTANTIATE_TEST_SUITE_P (t8_gtest_ancestor, ancestor, testing::Values (T8_ECLASS_PYRAMID), print_eclass);
3 changes: 2 additions & 1 deletion test/t8_schemes/t8_gtest_boundary_extrude.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <t8_eclass.h>
#include <t8_schemes/t8_default/t8_default_cxx.hxx>
#include <test/t8_gtest_custom_assertion.hxx>
#include <test/t8_gtest_macros.hxx>
#include "t8_gtest_dfs_base.hxx"
#include <test/t8_gtest_macros.hxx>

Expand Down Expand Up @@ -87,4 +88,4 @@ TEST_P (class_test_boundary_extrude, test_boundary_extrude_dfs)
check_recursive_dfs_to_max_lvl (maxlvl);
}

INSTANTIATE_TEST_SUITE_P (t8_gtest_test_all_imps, class_test_boundary_extrude, AllEclasses);
INSTANTIATE_TEST_SUITE_P (t8_gtest_test_all_imps, class_test_boundary_extrude, AllEclasses, print_eclass);
2 changes: 1 addition & 1 deletion test/t8_schemes/t8_gtest_child_parent_face.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ TEST_P (class_child_parent_face, t8_recursive_dfs_child_parent_face)
check_recursive_dfs_to_max_lvl (maxlvl);
}

INSTANTIATE_TEST_SUITE_P (t8_gtest_child_parent_face, class_child_parent_face, AllEclasses);
INSTANTIATE_TEST_SUITE_P (t8_gtest_child_parent_face, class_child_parent_face, AllEclasses, print_eclass);
2 changes: 1 addition & 1 deletion test/t8_schemes/t8_gtest_default.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ TEST_P (gtest_default_scheme, is_default)
EXPECT_TRUE (t8_eclass_scheme_is_default (eclass_scheme));
}

INSTANTIATE_TEST_SUITE_P (t8_gtest_default_scheme, gtest_default_scheme, AllEclasses);
INSTANTIATE_TEST_SUITE_P (t8_gtest_default_scheme, gtest_default_scheme, AllEclasses, print_eclass);
2 changes: 1 addition & 1 deletion test/t8_schemes/t8_gtest_descendant.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,4 @@ TEST_P (class_schemes_descendant, test_recursive_descendant)
t8_large_step_descendant (elem, desc, test, ts, maxlvl);
}

INSTANTIATE_TEST_SUITE_P (t8_gtest_descendant, class_schemes_descendant, AllEclasses);
INSTANTIATE_TEST_SUITE_P (t8_gtest_descendant, class_schemes_descendant, AllEclasses, print_eclass);
2 changes: 1 addition & 1 deletion test/t8_schemes/t8_gtest_element_count_leaves.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,4 @@ TEST_P (class_element_leaves, test_element_count_leaves_one_level)
class_scheme->t8_element_destroy (1, &element);
}

INSTANTIATE_TEST_SUITE_P (t8_gtest_element_count_leaves, class_element_leaves, AllEclasses);
INSTANTIATE_TEST_SUITE_P (t8_gtest_element_count_leaves, class_element_leaves, AllEclasses, print_eclass);
2 changes: 1 addition & 1 deletion test/t8_schemes/t8_gtest_equal.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ TEST_P (class_test_equal, test_equal_dfs)
check_recursive_dfs_to_max_lvl (maxlvl);
}

INSTANTIATE_TEST_SUITE_P (t8_gtest_test_all_imps, class_test_equal, AllEclasses);
INSTANTIATE_TEST_SUITE_P (t8_gtest_test_all_imps, class_test_equal, AllEclasses, print_eclass);
2 changes: 1 addition & 1 deletion test/t8_schemes/t8_gtest_face_descendant.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ TEST_P (class_descendant, t8_check_face_desc)
check_recursive_dfs_to_max_lvl (maxlvl);
}

INSTANTIATE_TEST_SUITE_P (t8_gtest_element_face_descendant, class_descendant, AllEclasses);
INSTANTIATE_TEST_SUITE_P (t8_gtest_element_face_descendant, class_descendant, AllEclasses, print_eclass);
4 changes: 1 addition & 3 deletions test/t8_schemes/t8_gtest_face_neigh.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,4 @@ TEST_P (face_neigh, recursive_check_diff)
t8_recursive_check_diff (child, element, neigh, ts, maxlvl, level);
}

/* *INDENT-OFF* */
INSTANTIATE_TEST_SUITE_P (t8_gtest_face_neigh, face_neigh, AllEclasses);
/* *INDENT-ON* */
INSTANTIATE_TEST_SUITE_P (t8_gtest_face_neigh, face_neigh, AllEclasses, print_eclass);
2 changes: 1 addition & 1 deletion test/t8_schemes/t8_gtest_find_parent.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ TEST_P (class_find_parent, t8_compute_child_find_parent)
check_recursive_dfs_to_max_lvl (maxlvl);
}

INSTANTIATE_TEST_SUITE_P (t8_gtest_find_parent, class_find_parent, AllEclasses);
INSTANTIATE_TEST_SUITE_P (t8_gtest_find_parent, class_find_parent, AllEclasses, print_eclass);
2 changes: 1 addition & 1 deletion test/t8_schemes/t8_gtest_init_linear_id.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,4 @@ TEST_P (linear_id, id_at_other_level)
}
}

INSTANTIATE_TEST_SUITE_P (t8_test_init_linear_id, linear_id, AllEclasses);
INSTANTIATE_TEST_SUITE_P (t8_test_init_linear_id, linear_id, AllEclasses, print_eclass);
2 changes: 1 addition & 1 deletion test/t8_schemes/t8_gtest_nca.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -309,4 +309,4 @@ TEST_P (nca, recursive_check_higher_level)
ts->t8_element_destroy (1, &correct_nca_high_level);
}

INSTANTIATE_TEST_SUITE_P (t8_gtest_nca, nca, AllEclasses);
INSTANTIATE_TEST_SUITE_P (t8_gtest_nca, nca, AllEclasses, print_eclass);
2 changes: 1 addition & 1 deletion test/t8_schemes/t8_gtest_root.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ TEST_P (root, equals_linear_id_0_0)
ts->t8_element_destroy (1, &root_compare);
}

INSTANTIATE_TEST_SUITE_P (t8_gtest_root, root, AllEclasses);
INSTANTIATE_TEST_SUITE_P (t8_gtest_root, root, AllEclasses, print_eclass);
5 changes: 4 additions & 1 deletion test/t8_schemes/t8_gtest_successor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <t8_eclass.h>
#include <t8_schemes/t8_default/t8_default_cxx.hxx>
#include <test/t8_gtest_custom_assertion.hxx>
#include <test/t8_gtest_macros.hxx>

class class_successor: public testing::TestWithParam<t8_eclass_t> {
protected:
Expand All @@ -42,6 +43,8 @@ class class_successor: public testing::TestWithParam<t8_eclass_t> {
ts->t8_element_new (1, &last);

ts->t8_element_root (element);
if (eclass == T8_ECLASS_VERTEX)
GTEST_SKIP ();
}
void
TearDown () override
Expand Down Expand Up @@ -149,4 +152,4 @@ TEST_P (class_successor, test_recursive_and_deep_successor)
t8_deep_successor (element, successor, last, ts);
}

INSTANTIATE_TEST_SUITE_P (t8_gtest_successor, class_successor, testing::Range (T8_ECLASS_LINE, T8_ECLASS_COUNT));
INSTANTIATE_TEST_SUITE_P (t8_gtest_successor, class_successor, AllEclasses, print_eclass);