Skip to content

Commit

Permalink
Merge pull request #792 from streeve/test_naming
Browse files Browse the repository at this point in the history
Test naming
  • Loading branch information
streeve authored Oct 10, 2024
2 parents e1bd563 + c249325 commit 7c8a622
Show file tree
Hide file tree
Showing 94 changed files with 300 additions and 352 deletions.
10 changes: 5 additions & 5 deletions benchmark/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ target_link_libraries(CommPerformance Cabana::Core)
endif()

if(Cabana_ENABLE_TESTING)
add_test(NAME Cabana_Performance_BinSort COMMAND ${NONMPI_PRECOMMAND} $<TARGET_FILE:BinSortPerformance> sort_output.txt)
add_test(NAME Cabana_Core_Performance_BinSort COMMAND ${NONMPI_PRECOMMAND} $<TARGET_FILE:BinSortPerformance> sort_output.txt)

add_test(NAME Cabana_Performance_NeighborVerlet COMMAND ${NONMPI_PRECOMMAND} $<TARGET_FILE:NeighborVerletPerformance> verlet_output.txt)
add_test(NAME Cabana_Core_Performance_NeighborVerlet COMMAND ${NONMPI_PRECOMMAND} $<TARGET_FILE:NeighborVerletPerformance> verlet_output.txt)

if(Cabana_ENABLE_ARBORX)
add_test(NAME Cabana_Performance_NeighborArborX COMMAND ${NONMPI_PRECOMMAND} $<TARGET_FILE:NeighborArborXPerformance> arborx_output.txt)
add_test(NAME Cabana_Core_Performance_NeighborArborX COMMAND ${NONMPI_PRECOMMAND} $<TARGET_FILE:NeighborArborXPerformance> arborx_output.txt)
endif()

add_test(NAME Cabana_Performance_LinkedCell COMMAND ${NONMPI_PRECOMMAND} $<TARGET_FILE:LinkedCellPerformance> lcl_output.txt)
add_test(NAME Cabana_Core_Performance_LinkedCell COMMAND ${NONMPI_PRECOMMAND} $<TARGET_FILE:LinkedCellPerformance> lcl_output.txt)

if(Cabana_ENABLE_MPI)
add_test(NAME Cabana_Performance_Comm COMMAND ${NONMPI_PRECOMMAND} $<TARGET_FILE:CommPerformance> comm_output.txt)
add_test(NAME Cabana_Core_Performance_Comm COMMAND ${NONMPI_PRECOMMAND} $<TARGET_FILE:CommPerformance> comm_output.txt)
endif()
endif()
12 changes: 4 additions & 8 deletions cmake/test_harness/test_harness.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ endif()
macro(Cabana_add_tests_nobackend)
cmake_parse_arguments(CABANA_UNIT_TEST "" "PACKAGE" "NAMES" ${ARGN})
foreach(_test ${CABANA_UNIT_TEST_NAMES})
set(_target Cabana_${_test}_test)
set(_target Cabana_${CABANA_UNIT_TEST_PACKAGE}_${_test}_test)
add_executable(${_target} tst${_test}.cpp ${TEST_HARNESS_DIR}/unit_test_main.cpp)
target_link_libraries(${_target} PRIVATE ${CABANA_UNIT_TEST_PACKAGE} ${gtest_target})
add_test(NAME ${_target} COMMAND ${NONMPI_PRECOMMAND} $<TARGET_FILE:${_target}> ${gtest_args})
Expand Down Expand Up @@ -78,14 +78,10 @@ macro(Cabana_add_tests)
"#include <Test${_device}_Category.hpp>\n"
"#include <tst${_test}.hpp>\n"
)
if(${CABANA_UNIT_TEST_PACKAGE} STREQUAL Core)
if(CABANA_UNIT_TEST_MPI)
set(_target Cabana_${_test}_MPI_test_${_device})
else()
set(_target Cabana_${_test}_test_${_device})
endif()
if(CABANA_UNIT_TEST_MPI)
set(_target Cabana_${CABANA_UNIT_TEST_PACKAGE}_Test_${_test}_MPI_${_device})
else()
set(_target ${CABANA_UNIT_TEST_PACKAGE}_${_test}_MPI_test_${_device})
set(_target Cabana_${CABANA_UNIT_TEST_PACKAGE}_Test_${_test}_${_device})
endif()
add_executable(${_target} ${_file} ${CABANA_UNIT_TEST_MAIN})
target_include_directories(${_target} PRIVATE ${_dir}
Expand Down
10 changes: 5 additions & 5 deletions core/unit_test/tstAoSoA.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,19 +606,19 @@ void testUnmanaged()
//---------------------------------------------------------------------------//
// RUN TESTS
//---------------------------------------------------------------------------//
TEST( TEST_CATEGORY, aosoa_test ) { testAoSoA(); }
TEST( AoSoA, Test ) { testAoSoA(); }

//---------------------------------------------------------------------------//
TEST( TEST_CATEGORY, aosoa_raw_data_test ) { testRawData(); }
TEST( AoSoA, RawData ) { testRawData(); }

//---------------------------------------------------------------------------//
TEST( TEST_CATEGORY, aosoa_tuple_test ) { testTuple(); }
TEST( AoSoA, Tuple ) { testTuple(); }

//---------------------------------------------------------------------------//
TEST( TEST_CATEGORY, aosoa_access_test ) { testAccess(); }
TEST( AoSoA, Access ) { testAccess(); }

//---------------------------------------------------------------------------//
TEST( TEST_CATEGORY, aosoa_unmanaged_test ) { testUnmanaged(); }
TEST( AoSoA, Unmanaged ) { testUnmanaged(); }

//---------------------------------------------------------------------------//

Expand Down
2 changes: 1 addition & 1 deletion core/unit_test/tstCartesianGrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
namespace Test
{

TEST( cabana_cartesian_grid, grid_test )
TEST( CartesianGrid, Test )
{
double min[3] = { -1.0, -0.5, -0.6 };
double max[3] = { 2.5, 1.5, 1.9 };
Expand Down
30 changes: 15 additions & 15 deletions core/unit_test/tstCommunicationPlan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,35 +595,35 @@ void testTopology()
//---------------------------------------------------------------------------//
// RUN TESTS
//---------------------------------------------------------------------------//
TEST( TEST_CATEGORY, comm_plan_test_1 ) { test1( true ); }
TEST( CommPlan, Test1 ) { test1( true ); }

TEST( TEST_CATEGORY, comm_plan_test_2 ) { test2( true ); }
TEST( CommPlan, Test2 ) { test2( true ); }

TEST( TEST_CATEGORY, comm_plan_test_3 ) { test3( true ); }
TEST( CommPlan, Test3 ) { test3( true ); }

TEST( TEST_CATEGORY, comm_plan_test_4 ) { test4( true ); }
TEST( CommPlan, Test4 ) { test4( true ); }

TEST( TEST_CATEGORY, comm_plan_test_5 ) { test5( true ); }
TEST( CommPlan, Test5 ) { test5( true ); }

TEST( TEST_CATEGORY, comm_plan_test_6 ) { test6( true ); }
TEST( CommPlan, Test6 ) { test6( true ); }

TEST( TEST_CATEGORY, comm_plan_test_7 ) { test7( true ); }
TEST( CommPlan, Test7 ) { test7( true ); }

TEST( TEST_CATEGORY, comm_plan_test_1_no_topo ) { test1( false ); }
TEST( CommPlan, Test1NoTopo ) { test1( false ); }

TEST( TEST_CATEGORY, comm_plan_test_2_no_topo ) { test2( false ); }
TEST( CommPlan, Test2NoTopo ) { test2( false ); }

TEST( TEST_CATEGORY, comm_plan_test_3_no_topo ) { test3( false ); }
TEST( CommPlan, Test3NoTopo ) { test3( false ); }

TEST( TEST_CATEGORY, comm_plan_test_4_no_topo ) { test4( false ); }
TEST( CommPlan, Test4NoTopo ) { test4( false ); }

TEST( TEST_CATEGORY, comm_plan_test_5_no_topo ) { test5( false ); }
TEST( CommPlan, Test5NoTopo ) { test5( false ); }

TEST( TEST_CATEGORY, comm_plan_test_6_no_topo ) { test6( false ); }
TEST( CommPlan, Test6NoTopo ) { test6( false ); }

TEST( TEST_CATEGORY, comm_plan_test_7_no_topo ) { test7( false ); }
TEST( CommPlan, Test7NoTopo ) { test7( false ); }

TEST( TEST_CATEGORY, comm_plan_test_topology ) { testTopology(); }
TEST( CommPlan, TestTopology ) { testTopology(); }

//---------------------------------------------------------------------------//

Expand Down
12 changes: 6 additions & 6 deletions core/unit_test/tstDeepCopy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,21 +443,21 @@ void testAssign()
//---------------------------------------------------------------------------//
// TESTS
//---------------------------------------------------------------------------//
TEST( TEST_CATEGORY, deep_copy_to_host_same_layout_test )
TEST( DeepCopy, ToHostSameLayout )
{
testAoSoADeepCopy<Kokkos::HostSpace, TEST_MEMSPACE, 16, 16>();
testParticleListDeepCopy<Kokkos::HostSpace, TEST_MEMSPACE, 16, 16>();
}

//---------------------------------------------------------------------------//
TEST( TEST_CATEGORY, deep_copy_from_host_same_layout_test )
TEST( DeepCopy, FromHostSameLayout )
{
testAoSoADeepCopy<TEST_MEMSPACE, Kokkos::HostSpace, 16, 16>();
testParticleListDeepCopy<TEST_MEMSPACE, Kokkos::HostSpace, 16, 16>();
}

//---------------------------------------------------------------------------//
TEST( TEST_CATEGORY, deep_copy_to_host_different_layout_test )
TEST( DeepCopy, ToHostDifferentLayout )
{
testAoSoADeepCopy<Kokkos::HostSpace, TEST_MEMSPACE, 16, 32>();
testAoSoADeepCopy<Kokkos::HostSpace, TEST_MEMSPACE, 64, 8>();
Expand All @@ -466,7 +466,7 @@ TEST( TEST_CATEGORY, deep_copy_to_host_different_layout_test )
}

//---------------------------------------------------------------------------//
TEST( TEST_CATEGORY, deep_copy_from_host_different_layout_test )
TEST( DeepCopy, FromHostDifferentLayout )
{
testAoSoADeepCopy<TEST_MEMSPACE, Kokkos::HostSpace, 64, 8>();
testAoSoADeepCopy<TEST_MEMSPACE, Kokkos::HostSpace, 16, 32>();
Expand All @@ -475,10 +475,10 @@ TEST( TEST_CATEGORY, deep_copy_from_host_different_layout_test )
}

//---------------------------------------------------------------------------//
TEST( TEST_CATEGORY, mirror_test ) { testMirror(); }
TEST( DeepCopy, Mirror ) { testMirror(); }

//---------------------------------------------------------------------------//
TEST( TEST_CATEGORY, assign_test ) { testAssign(); }
TEST( DeepCopy, Assign ) { testAssign(); }

//---------------------------------------------------------------------------//

Expand Down
36 changes: 18 additions & 18 deletions core/unit_test/tstDistributor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -756,41 +756,41 @@ void test9( const bool use_topology )
//---------------------------------------------------------------------------//
// RUN TESTS
//---------------------------------------------------------------------------//
TEST( TEST_CATEGORY, distributor_test_1 ) { test1( true ); }
TEST( Distributor, Test1 ) { test1( true ); }

TEST( TEST_CATEGORY, distributor_test_2 ) { test2( true ); }
TEST( Distributor, Test2 ) { test2( true ); }

TEST( TEST_CATEGORY, distributor_test_3 ) { test3( true ); }
TEST( Distributor, Test3 ) { test3( true ); }

TEST( TEST_CATEGORY, distributor_test_4 ) { test4( true ); }
TEST( Distributor, Test4 ) { test4( true ); }

TEST( TEST_CATEGORY, distributor_test_5 ) { test5( true ); }
TEST( Distributor, Test5 ) { test5( true ); }

TEST( TEST_CATEGORY, distributor_test_6 ) { test6( true ); }
TEST( Distributor, Test6 ) { test6( true ); }

TEST( TEST_CATEGORY, distributor_test_7 ) { test7( true ); }
TEST( Distributor, Test7 ) { test7( true ); }

TEST( TEST_CATEGORY, distributor_test_8 ) { test8( true ); }
TEST( Distributor, Test8 ) { test8( true ); }

TEST( TEST_CATEGORY, distributor_test_9 ) { test9( true ); }
TEST( Distributor, Test9 ) { test9( true ); }

TEST( TEST_CATEGORY, distributor_test_1_no_topo ) { test1( false ); }
TEST( Distributor, Test1NoTopo ) { test1( false ); }

TEST( TEST_CATEGORY, distributor_test_2_no_topo ) { test2( false ); }
TEST( Distributor, Test2NoTopo ) { test2( false ); }

TEST( TEST_CATEGORY, distributor_test_3_no_topo ) { test3( false ); }
TEST( Distributor, Test3NoTopo ) { test3( false ); }

TEST( TEST_CATEGORY, distributor_test_4_no_topo ) { test4( false ); }
TEST( Distributor, Test4NoTopo ) { test4( false ); }

TEST( TEST_CATEGORY, distributor_test_5_no_topo ) { test5( false ); }
TEST( Distributor, Test5NoTopo ) { test5( false ); }

TEST( TEST_CATEGORY, distributor_test_6_no_topo ) { test6( false ); }
TEST( Distributor, Test6NoTopo ) { test6( false ); }

TEST( TEST_CATEGORY, distributor_test_7_no_topo ) { test7( false ); }
TEST( Distributor, Test7NoTopo ) { test7( false ); }

TEST( TEST_CATEGORY, distributor_test_8_no_topo ) { test8( false ); }
TEST( Distributor, Test8NoTopo ) { test8( false ); }

TEST( TEST_CATEGORY, distributor_test_9_no_topo ) { test9( false ); }
TEST( Distributor, Test9NoTopo ) { test9( false ); }

//---------------------------------------------------------------------------//

Expand Down
2 changes: 1 addition & 1 deletion core/unit_test/tstHDF5ParticleOutput.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ void writeReadTest()
//---------------------------------------------------------------------------//
// RUN TESTS
//---------------------------------------------------------------------------//
TEST( TEST_CATEGORY, write_read_test ) { writeReadTest(); }
TEST( HDF5, WriteRead ) { writeReadTest(); }

//---------------------------------------------------------------------------//

Expand Down
8 changes: 4 additions & 4 deletions core/unit_test/tstHalo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,26 +586,26 @@ void testHaloBuffers( TestTag tag, const bool use_topology )
// RUN TESTS
//---------------------------------------------------------------------------//
// test without collisions (each ghost is unique)
TEST( TEST_CATEGORY, halo_test_unique )
TEST( Halo, Unique )
{
testHalo( UniqueTestTag{}, true );
testHaloBuffers( UniqueTestTag{}, true );
}

TEST( TEST_CATEGORY, halo_test_unique_no_topo )
TEST( Halo, UniqueNoTopo )
{
testHalo( UniqueTestTag{}, false );
testHaloBuffers( UniqueTestTag{}, false );
}

// tests with collisions (each ghost is duplicated on all ranks)
TEST( TEST_CATEGORY, halo_test_all )
TEST( Halo, All )
{
testHalo( AllTestTag{}, true );
testHaloBuffers( AllTestTag{}, false );
}

TEST( TEST_CATEGORY, halo_test_all_no_topo )
TEST( Halo, AllNoTopo )
{
testHalo( AllTestTag{}, false );
testHaloBuffers( AllTestTag{}, false );
Expand Down
2 changes: 1 addition & 1 deletion core/unit_test/tstIndex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
namespace Test
{

TEST( cabana_index, index_test )
TEST( Index, Test )
{
auto aosoa_idx_s = Cabana::Impl::Index<16>::s( 40 );
auto aosoa_idx_i = Cabana::Impl::Index<16>::a( 40 );
Expand Down
18 changes: 8 additions & 10 deletions core/unit_test/tstLinkedCellList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -770,23 +770,21 @@ void testLinkedListView()
//---------------------------------------------------------------------------//
// RUN TESTS
//---------------------------------------------------------------------------//
TEST( TEST_CATEGORY, linked_cell_stencil_test ) { testLinkedCellStencil(); }
//---------------------------------------------------------------------------//
TEST( LinkedCellList, Stencil ) { testLinkedCellStencil(); }

TEST( TEST_CATEGORY, linked_list_test ) { testLinkedList(); }
TEST( LinkedCellList, AoSoA ) { testLinkedList(); }

TEST( TEST_CATEGORY, linked_list_slice_test ) { testLinkedListSlice(); }
TEST( LinkedCellList, Slice ) { testLinkedListSlice(); }

TEST( TEST_CATEGORY, linked_list_neighbor_test )
{
testLinkedCellNeighborInterface();
}
TEST( LinkedCellList, Neighbor ) { testLinkedCellNeighborInterface(); }

TEST( TEST_CATEGORY, linked_list_parallel_test ) { testLinkedCellParallel(); }
TEST( LinkedCellList, ParallelFor ) { testLinkedCellParallel(); }

TEST( TEST_CATEGORY, linked_list_reduce_test ) { testLinkedCellReduce(); }
TEST( LinkedCellList, ParallelReduce ) { testLinkedCellReduce(); }

//---------------------------------------------------------------------------//
TEST( TEST_CATEGORY, linked_list_view_test ) { testLinkedListView(); }
TEST( LinkedCellList, linked_list_view_test ) { testLinkedListView(); }

//---------------------------------------------------------------------------//

Expand Down
15 changes: 7 additions & 8 deletions core/unit_test/tstNeighborList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,7 @@ void testNeighborHistogram()
//---------------------------------------------------------------------------//
// TESTS
//---------------------------------------------------------------------------//

TEST( TEST_CATEGORY, verlet_list_full_test )
TEST( VerletList, Full )
{
#ifndef KOKKOS_ENABLE_OPENMPTARGET // FIXME_OPENMPTARGET
testVerletListFull<Cabana::VerletLayoutCSR, Cabana::TeamOpTag>();
Expand All @@ -350,7 +349,7 @@ TEST( TEST_CATEGORY, verlet_list_full_test )
}

//---------------------------------------------------------------------------//
TEST( TEST_CATEGORY, verlet_list_half_test )
TEST( VerletList, Half )
{
#ifndef KOKKOS_ENABLE_OPENMPTARGET // FIXME_OPENMPTARGET
testVerletListHalf<Cabana::VerletLayoutCSR, Cabana::TeamOpTag>();
Expand All @@ -364,7 +363,7 @@ TEST( TEST_CATEGORY, verlet_list_half_test )
}

//---------------------------------------------------------------------------//
TEST( TEST_CATEGORY, verlet_list_full_range_test )
TEST( VerletList, FullRange )
{
#ifndef KOKKOS_ENABLE_OPENMPTARGET // FIXME_OPENMPTARGET
testVerletListFullPartialRange<Cabana::VerletLayoutCSR,
Expand All @@ -381,7 +380,7 @@ TEST( TEST_CATEGORY, verlet_list_full_range_test )
}

//---------------------------------------------------------------------------//
TEST( TEST_CATEGORY, parallel_for_test )
TEST( VerletList, ParallelFor )
{
#ifndef KOKKOS_ENABLE_OPENMPTARGET // FIXME_OPENMPTARGET
testNeighborParallelFor<Cabana::VerletLayoutCSR>();
Expand All @@ -390,7 +389,7 @@ TEST( TEST_CATEGORY, parallel_for_test )
}

//---------------------------------------------------------------------------//
TEST( TEST_CATEGORY, parallel_reduce_test )
TEST( VerletList, ParallelReduce )
{
#ifndef KOKKOS_ENABLE_OPENMPTARGET // FIXME_OPENMPTARGET
testNeighborParallelReduce<Cabana::VerletLayoutCSR>();
Expand All @@ -399,7 +398,7 @@ TEST( TEST_CATEGORY, parallel_reduce_test )
}

//---------------------------------------------------------------------------//
TEST( TEST_CATEGORY, modify_list_test )
TEST( VerletList, ModifyList )
{
#ifndef KOKKOS_ENABLE_OPENMPTARGET // FIXME_OPENMPTARGET
testModifyNeighbors<Cabana::VerletLayoutCSR>();
Expand All @@ -408,7 +407,7 @@ TEST( TEST_CATEGORY, modify_list_test )
}

//---------------------------------------------------------------------------//
TEST( TEST_CATEGORY, neighbor_histogram_test )
TEST( VerletList, NeighborHistogram )
{
#ifndef KOKKOS_ENABLE_OPENMPTARGET
testNeighborHistogram<Cabana::VerletLayoutCSR>();
Expand Down
Loading

0 comments on commit 7c8a622

Please sign in to comment.