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

1736: Fix tests defined in headers #1738

Merged
merged 4 commits into from
Apr 19, 2022
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
6 changes: 5 additions & 1 deletion tests/unit/collection/test_broadcast.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@

namespace vt { namespace tests { namespace unit { namespace bcast {

REGISTER_TYPED_TEST_SUITE_P(TestBroadcast, test_broadcast_1);
TYPED_TEST_P(TestBroadcast, test_broadcast_basic_1) {
test_broadcast_1<TypeParam>();
}

REGISTER_TYPED_TEST_SUITE_P(TestBroadcast, test_broadcast_basic_1);

using CollectionTestTypesBasic = testing::Types<
bcast_col_ ::TestCol<int32_t>
Expand Down
6 changes: 5 additions & 1 deletion tests/unit/collection/test_broadcast.extended.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@

namespace vt { namespace tests { namespace unit { namespace bcast {

REGISTER_TYPED_TEST_SUITE_P(TestBroadcast, test_broadcast_1);
TYPED_TEST_P(TestBroadcast, test_broadcast_extended_1) {
test_broadcast_1<TypeParam>();
}

REGISTER_TYPED_TEST_SUITE_P(TestBroadcast, test_broadcast_extended_1);

using CollectionTestTypesExtended = testing::Types<
bcast_col_ ::TestCol<int64_t>,
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/collection/test_broadcast.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ struct TestBroadcast : TestParallelHarness {};

TYPED_TEST_SUITE_P(TestBroadcast);

TYPED_TEST_P(TestBroadcast, test_broadcast_1) {
using ColType = TypeParam;
template<typename ColType>
void test_broadcast_1(){
using MsgType = typename ColType::MsgType;
using TestParamType = typename ColType::ParamType;

Expand Down
11 changes: 4 additions & 7 deletions tests/unit/collection/test_collection_construct_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ struct ConstructParams {
TYPED_TEST_SUITE_P(TestConstruct);
TYPED_TEST_SUITE_P(TestConstructDist);

TYPED_TEST_P(TestConstruct, test_construct_1) {
using ColType = TypeParam;
template<typename ColType>
void test_construct_1() {
using MsgType = typename ColType::MsgType;

auto const& this_node = theContext()->getNode();
Expand All @@ -121,8 +121,8 @@ TYPED_TEST_P(TestConstruct, test_construct_1) {
}
}

TYPED_TEST_P(TestConstructDist, test_construct_distributed_1) {
using ColType = TypeParam;
template<typename ColType>
void test_construct_distributed_1() {
using MsgType = typename ColType::MsgType;

auto const& col_size = 32;
Expand All @@ -134,9 +134,6 @@ TYPED_TEST_P(TestConstructDist, test_construct_distributed_1) {
>();
}

REGISTER_TYPED_TEST_SUITE_P(TestConstruct, test_construct_1);
REGISTER_TYPED_TEST_SUITE_P(TestConstructDist, test_construct_distributed_1);

}}} // end namespace vt::tests::unit

#endif /*INCLUDED_UNIT_COLLECTION_TEST_COLLECTION_CONSTRUCT_COMMON_H*/
11 changes: 11 additions & 0 deletions tests/unit/collection/test_construct.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ struct ColMsg : CollectionMessage<TestCol> { };
using CollectionTestTypes = testing::Types<default_::TestCol>;
using CollectionTestDistTypes = testing::Types<default_::TestCol>;

TYPED_TEST_P(TestConstruct, test_construct_basic_1) {
test_construct_1<TypeParam>();
}

TYPED_TEST_P(TestConstructDist, test_construct_distributed_basic_1) {
test_construct_distributed_1<TypeParam>();
}

REGISTER_TYPED_TEST_SUITE_P(TestConstruct, test_construct_basic_1);
REGISTER_TYPED_TEST_SUITE_P(TestConstructDist, test_construct_distributed_basic_1);

INSTANTIATE_TYPED_TEST_SUITE_P(
test_construct_simple, TestConstruct, CollectionTestTypes, DEFAULT_NAME_GEN
);
Expand Down
11 changes: 11 additions & 0 deletions tests/unit/collection/test_construct_no_idx.extended.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ struct ColMsg : CollectionMessage<TestCol> {};

using CollectionTestTypes = testing::Types<multi_param_no_idx_::TestCol>;

TYPED_TEST_P(TestConstruct, test_construct_no_idx_extended_1) {
test_construct_1<TypeParam>();
}

TYPED_TEST_P(TestConstructDist, test_construct_distributed_no_idx_extended_1) {
test_construct_distributed_1<TypeParam>();
}

REGISTER_TYPED_TEST_SUITE_P(TestConstruct, test_construct_no_idx_extended_1);
REGISTER_TYPED_TEST_SUITE_P(TestConstructDist, test_construct_distributed_no_idx_extended_1);

INSTANTIATE_TYPED_TEST_SUITE_P(
test_construct_no_idx, TestConstruct, CollectionTestTypes, DEFAULT_NAME_GEN
);
Expand Down
12 changes: 10 additions & 2 deletions tests/unit/collection/test_send.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,16 @@

namespace vt { namespace tests { namespace unit { namespace send {

REGISTER_TYPED_TEST_SUITE_P(TestCollectionSend, test_collection_send_1);
REGISTER_TYPED_TEST_SUITE_P(TestCollectionSendMem, test_collection_send_ptm_1);
TYPED_TEST_P(TestCollectionSend, test_collection_send_basic_1) {
test_collection_send_1<TypeParam>();
}

TYPED_TEST_P(TestCollectionSendMem, test_collection_send_ptm_basic_1) {
test_collection_send_ptm_1<TypeParam>();
}

REGISTER_TYPED_TEST_SUITE_P(TestCollectionSend, test_collection_send_basic_1);
REGISTER_TYPED_TEST_SUITE_P(TestCollectionSendMem, test_collection_send_ptm_basic_1);

using CollectionTestTypesBasic = testing::Types<
send_col_ ::TestCol<int32_t>
Expand Down
12 changes: 10 additions & 2 deletions tests/unit/collection/test_send.extended.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,16 @@

namespace vt { namespace tests { namespace unit { namespace send {

REGISTER_TYPED_TEST_SUITE_P(TestCollectionSend, test_collection_send_1);
REGISTER_TYPED_TEST_SUITE_P(TestCollectionSendMem, test_collection_send_ptm_1);
TYPED_TEST_P(TestCollectionSend, test_collection_send_extended_1) {
test_collection_send_1<TypeParam>();
}

TYPED_TEST_P(TestCollectionSendMem, test_collection_send_ptm_extended_1) {
test_collection_send_ptm_1<TypeParam>();
}

REGISTER_TYPED_TEST_SUITE_P(TestCollectionSend, test_collection_send_extended_1);
REGISTER_TYPED_TEST_SUITE_P(TestCollectionSendMem, test_collection_send_ptm_extended_1);

using CollectionTestTypesExtended = testing::Types<
send_col_ ::TestCol<int64_t>,
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/collection/test_send.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ struct TestCollectionSendMem : TestParallelHarness {};
TYPED_TEST_SUITE_P(TestCollectionSend);
TYPED_TEST_SUITE_P(TestCollectionSendMem);

TYPED_TEST_P(TestCollectionSend, test_collection_send_1) {
using ColType = TypeParam;
template<typename ColType>
void test_collection_send_1() {
using MsgType = typename ColType::MsgType;
using TestParamType = typename ColType::ParamType;

Expand All @@ -165,8 +165,8 @@ TYPED_TEST_P(TestCollectionSend, test_collection_send_1) {
}
}

TYPED_TEST_P(TestCollectionSendMem, test_collection_send_ptm_1) {
using ColType = TypeParam;
template<typename ColType>
void test_collection_send_ptm_1(){
using MsgType = typename ColType::MsgType;
using TestParamType = typename ColType::ParamType;

Expand Down
30 changes: 25 additions & 5 deletions tests/unit/rdma/test_rdma_handle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,33 @@ namespace vt { namespace tests { namespace unit {

using RDMATestTypesBasic = testing::Types<int>;

TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_basic_1) {
test_rdma_handle_1<TypeParam>();
}

TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_basic_2) {
test_rdma_handle_2<TypeParam>();
}

TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_basic_3) {
test_rdma_handle_3<TypeParam>();
}

TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_basic_4) {
test_rdma_handle_4<TypeParam>();
}

TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_basic_5) {
test_rdma_handle_5<TypeParam>();
}

REGISTER_TYPED_TEST_SUITE_P(
TestRDMAHandle,
test_rdma_handle_1,
test_rdma_handle_2,
test_rdma_handle_3,
test_rdma_handle_4,
test_rdma_handle_5
test_rdma_handle_basic_1,
test_rdma_handle_basic_2,
test_rdma_handle_basic_3,
test_rdma_handle_basic_4,
test_rdma_handle_basic_5
);

INSTANTIATE_TYPED_TEST_SUITE_P(
Expand Down
30 changes: 25 additions & 5 deletions tests/unit/rdma/test_rdma_handle.extended.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,33 @@ using RDMATestTypesExtended = testing::Types<
uint16_t
>;

TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_extended_1) {
test_rdma_handle_1<TypeParam>();
}

TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_extended_2) {
test_rdma_handle_2<TypeParam>();
}

TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_extended_3) {
test_rdma_handle_3<TypeParam>();
}

TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_extended_4) {
test_rdma_handle_4<TypeParam>();
}

TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_extended_5) {
test_rdma_handle_5<TypeParam>();
}

REGISTER_TYPED_TEST_SUITE_P(
TestRDMAHandle,
test_rdma_handle_1,
test_rdma_handle_2,
test_rdma_handle_3,
test_rdma_handle_4,
test_rdma_handle_5
test_rdma_handle_extended_1,
test_rdma_handle_extended_2,
test_rdma_handle_extended_3,
test_rdma_handle_extended_4,
test_rdma_handle_extended_5
);

INSTANTIATE_TYPED_TEST_SUITE_P(
Expand Down
15 changes: 10 additions & 5 deletions tests/unit/rdma/test_rdma_handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ struct TestRDMAHandle : TestParallelHarness { };

TYPED_TEST_SUITE_P(TestRDMAHandle);

TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_1) {
template<typename TypeParam>
void test_rdma_handle_1(){
std::size_t size = 10;

using T = TypeParam;
Expand Down Expand Up @@ -122,7 +123,8 @@ TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_1) {
proxy.destroyHandleRDMA(handle);
}

TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_2) {
template<typename TypeParam>
void test_rdma_handle_2(){
std::size_t size = 10;

using T = TypeParam;
Expand Down Expand Up @@ -176,7 +178,8 @@ TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_2) {
proxy.destroyHandleRDMA(handle);
}

TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_3) {
template<typename TypeParam>
void test_rdma_handle_3(){
std::size_t size = 10;

using T = TypeParam;
Expand Down Expand Up @@ -217,7 +220,8 @@ TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_3) {
proxy.destroyHandleRDMA(handle);
}

TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_4) {
template<typename TypeParam>
void test_rdma_handle_4(){
auto rank = vt::theContext()->getNode();
std::size_t per_size = 10;
std::size_t size = per_size * (rank + 1);
Expand All @@ -240,7 +244,8 @@ TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_4) {
proxy.destroyHandleRDMA(handle);
}

TYPED_TEST_P(TestRDMAHandle, test_rdma_handle_5) {
template<typename TypeParam>
void test_rdma_handle_5(){
std::size_t size = 10;

using T = TypeParam;
Expand Down