diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f6e3ec9eef..bfdcbe7d85 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -14,39 +14,29 @@ set(PROJECT_TEST_UNIT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/unit) set(PROJECT_TEST_PERF_DIR ${CMAKE_CURRENT_SOURCE_DIR}/perf) set(PROJECT_GTEST_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/extern/googletest/googletest/include) -set( - PROJECT_PERF_TESTS - ping_pong - memory_checker - comm_cost_curve -) +function(subdirlist result curdir) + file( + GLOB children + LIST_DIRECTORIES true + RELATIVE ${curdir} ${curdir}/* + ) + set(dirlist "") + foreach(child ${children}) + if(IS_DIRECTORY ${curdir}/${child}) + list(APPEND dirlist ${child}) + endif() + endforeach() + set(${result} ${dirlist} PARENT_SCOPE) +endfunction() -set( +subdirlist( UNIT_TEST_SUBDIRS_LIST - index - active - collection - collectives - epoch - pool - location - sequencer - termination - mapping - group - serialization - pipe - tls - timetrigger - atomic - memory - objgroup - runtime - scheduler - lb - trace - rdma - utils + ${PROJECT_TEST_UNIT_DIR} +) + +subdirlist( + PROJECT_PERF_TESTS + ${PROJECT_TEST_PERF_DIR} ) # diff --git a/tests/unit/context/context_vrt_test.nompi.extended.cc b/tests/unit/context/context_vrt_test.nompi.extended.cc deleted file mode 100644 index d994fb733e..0000000000 --- a/tests/unit/context/context_vrt_test.nompi.extended.cc +++ /dev/null @@ -1,102 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// context_vrt_test.extended.cc -// DARMA Toolkit v. 1.0.0 -// DARMA/vt => Virtual Transport -// -// Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC -// (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. -// Government retains certain rights in this software. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact darma@sandia.gov -// -// ***************************************************************************** -//@HEADER -*/ - -#include - -#include "test_harness.h" - -#include "vt/vrt/context/context_vrt.h" - -namespace vt { namespace tests { namespace unit { - -class TestVrtContext : public TestHarness { - virtual void SetUp() { - TestHarness::SetUp(); - } - - virtual void TearDown() { - TestHarness::TearDown(); - } -}; - -// -//TEST_F(TestVrtContext, Construction) { -// using namespace vt; -// -// vrt::VrtContext vrtc1(10); -// EXPECT_EQ(vrtc1.isCollection(), false); -// EXPECT_EQ(vrtc1.isMigratable(), false); -// EXPECT_EQ(vrtc1.getVrtContextNode(), 10); -// -// vrt::VrtContext vrtc2(100, false, true); -// EXPECT_EQ(vrtc2.isCollection(), false); -// EXPECT_EQ(vrtc2.isMigratable(), true); -// EXPECT_EQ(vrtc2.getVrtContextNode(), 100); -//} -// -// -//TEST_F(TestVrtContext, public_API) { -// using namespace vt; -// -// vrt::VrtContext vrtc = vrt::VrtContext(); -// EXPECT_EQ(vrtc.isCollection(), false); -// EXPECT_EQ(vrtc.isMigratable(), false); -// -// vrtc.setVrtContextNode(100); -// EXPECT_EQ(vrtc.isCollection(), false); -// EXPECT_EQ(vrtc.isMigratable(), false); -// EXPECT_EQ(vrtc.getVrtContextNode(), 100); -// -// vrtc.setIsCollection(true); -// EXPECT_EQ(vrtc.isCollection(), true); -// EXPECT_EQ(vrtc.isMigratable(), false); -// EXPECT_EQ(vrtc.getVrtContextNode(), 100); -// -// vrtc.setIsMigratable(true); -// EXPECT_EQ(vrtc.isCollection(), true); -// EXPECT_EQ(vrtc.isMigratable(), true); -// EXPECT_EQ(vrtc.getVrtContextNode(), 100); -//} - -}}} // end namespace vt::tests::unit diff --git a/tests/unit/context/context_vrtmanager_test.extended.cc b/tests/unit/context/context_vrtmanager_test.extended.cc deleted file mode 100644 index b9ded0dded..0000000000 --- a/tests/unit/context/context_vrtmanager_test.extended.cc +++ /dev/null @@ -1,112 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// context_vrtmanager_test.extended.cc -// DARMA Toolkit v. 1.0.0 -// DARMA/vt => Virtual Transport -// -// Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC -// (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. -// Government retains certain rights in this software. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact darma@sandia.gov -// -// ***************************************************************************** -//@HEADER -*/ - -#include - -#include "test_parallel_harness.h" - -#include "vt/vrt/context/context_vrtmanager.h" - -namespace vt { namespace tests { namespace unit { - -class TestVirtualContextManager : public TestParallelHarness { - virtual void SetUp() { - TestParallelHarness::SetUp(); - } - - virtual void TearDown() { - TestParallelHarness::TearDown(); - } -}; - -struct HelloVirtualContext : vt::vrt::VirtualContext { - int from; - - explicit HelloVirtualContext(int const& in_from) - : from(in_from) {} -}; - -TEST_F(TestVirtualContextManager, Construction_and_API) { - using namespace vt; - using namespace vt::vrt; - - EXPECT_EQ(theVirtualManager()->getNode(), theContext()->getNode()); - EXPECT_EQ(theVirtualManager()->getCurrentIdent(), 0); - - auto proxy1 = theVirtualManager()->makeVirtual(10); - EXPECT_EQ(theVirtualManager()->getCurrentIdent(), 1); - - auto temp1 = theVirtualManager()->getVirtualContextByProxy(proxy1); - auto hello1 = static_cast(temp1); - EXPECT_EQ(hello1->from, 10); - EXPECT_EQ(theVirtualManager()->getVirtualContextByID(1), nullptr); - auto proxy3 = proxy1; - VirtualContextProxy::setVirtualContextId(proxy3, 5); - EXPECT_EQ(theVirtualManager()->getVirtualContextByProxy(proxy3), nullptr); - - auto temp2 = theVirtualManager()->getVirtualContextByProxy(proxy1); - auto hello2 = static_cast(temp2); - EXPECT_EQ(hello2->from, 10); - - EXPECT_EQ(VirtualContextProxy::getVirtualContextNode(proxy1), - theVirtualManager()->getNode()); - EXPECT_EQ(VirtualContextProxy::getVirtualContextId(proxy1), 0); - EXPECT_EQ(VirtualContextProxy::isCollection(proxy1), false); - EXPECT_EQ(VirtualContextProxy::isMigratable(proxy1), false); - - ////////////////////////////////////////////////////////////////////////// - - auto proxy2 = theVirtualManager()->makeVirtual(100); - EXPECT_EQ(theVirtualManager()->getCurrentIdent(), 2); - - auto temp3 = theVirtualManager()->getVirtualContextByProxy(proxy2); - auto hello3 = static_cast(temp3); - EXPECT_EQ(hello3->from, 100); - - theVirtualManager()->destroyVirtualContextByProxy(proxy1); - - EXPECT_EQ(theVirtualManager()->getVirtualContextByProxy(proxy1), nullptr); -} - -}}} // end namespace vt::tests::unit diff --git a/tests/unit/context/context_vrtmessage_test.extended.cc b/tests/unit/context/context_vrtmessage_test.extended.cc deleted file mode 100644 index 7ca86764ae..0000000000 --- a/tests/unit/context/context_vrtmessage_test.extended.cc +++ /dev/null @@ -1,130 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// context_vrtmessage_test.extended.cc -// DARMA Toolkit v. 1.0.0 -// DARMA/vt => Virtual Transport -// -// Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC -// (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. -// Government retains certain rights in this software. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact darma@sandia.gov -// -// ***************************************************************************** -//@HEADER -*/ - -#include - -#include "test_parallel_harness.h" - -#include "vt/vrt/context/context_vrtmanager.h" -#include "vt/vrt/context/context_vrtmessage.h" - -namespace vt { namespace tests { namespace unit { - -class TestVirtualContextMessage : public TestParallelHarness { - virtual void SetUp() { - TestParallelHarness::SetUp(); - } - - virtual void TearDown() { - TestParallelHarness::TearDown(); - } -}; - -struct HelloVirtualContext : vt::vrt::VirtualContext { - int from; - - explicit HelloVirtualContext(int const& in_from) - : VirtualContext(), from(in_from) {} -}; - -struct MyHelloMsg : vt::vrt::VirtualContextMessage { - int from; - - MyHelloMsg(int const& in_from) - : vt::vrt::VirtualContextMessage(), from(in_from) {} - -}; - -void myWorkHandler (MyHelloMsg* msg, HelloVirtualContext* context) { - // do some work -} - - -TEST_F(TestVirtualContextMessage, Construction_and_API) { - using namespace vt; - - auto const& my_node = theContext()->getNode(); - - auto vrtc1 = theVirtualManager()->makeVirtual(10); - - auto in_msg = makeMessage(); - theVirtualManager()->sendMsg( - my_node, in_msg.get() - ); - - - EXPECT_EQ(theVirtualManager()->getCurrentIdent(), 1); - - auto temp1 = theVirtualManager()->getVirtualByID(vrtc1); - auto hello1 = static_cast(temp1); - - auto temp2 = theVirtualManager()->getVirtualByID(vrtc1); - auto hello2 = static_cast(temp2); - - EXPECT_EQ(hello1->from, 10); - EXPECT_EQ(hello1->theVirtualContextNode(), getVirtualManager()->getNode()); - - hello1->setIsCollection(true); - EXPECT_EQ(hello2->isCollection(), true); - - hello2->setIsCollection(false); - EXPECT_EQ(hello1->isCollection(), false); - - //////////////////////////////////////////////////////////////////// - - theVirtualManager()->destroyVirtualContextByID(vrtc1); - EXPECT_EQ(theVirtualManager()->getVirtualByID(vrtc1), nullptr); - - auto vrtc2 = theVirtualManager()->makeVirtual(20); - auto temp21 = theVirtualManager()->getVirtualByID(vrtc2); - auto hello21 = static_cast(temp21); - - auto vrtc3 = 20; - EXPECT_EQ(theVirtualManager()->getVirtualByID(vrtc3), nullptr); - - EXPECT_EQ(hello21->from, 20); - EXPECT_EQ(hello21->theVirtualContextNode(), getVirtualManager()->getNode()); -} - -}}} // end namespace vt::tests::unit diff --git a/tests/unit/context/context_vrtproxy_test.nompi.extended.cc b/tests/unit/context/context_vrtproxy_test.nompi.extended.cc deleted file mode 100644 index 337a5a405d..0000000000 --- a/tests/unit/context/context_vrtproxy_test.nompi.extended.cc +++ /dev/null @@ -1,103 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// context_vrtproxy_test.extended.cc -// DARMA Toolkit v. 1.0.0 -// DARMA/vt => Virtual Transport -// -// Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC -// (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. -// Government retains certain rights in this software. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact darma@sandia.gov -// -// ***************************************************************************** -//@HEADER -*/ - -#include - -#include "test_harness.h" - -namespace vt { namespace tests { namespace unit { - -class TestVrtContextProxy : public TestHarness { - virtual void SetUp() { - TestHarness::SetUp(); - } - - virtual void TearDown() { - TestHarness::TearDown(); - } -}; - -TEST_F(TestVrtContextProxy, Construction_AND_API) { - using namespace vt; - using namespace vt::vrt; - - VrtContext_ProxyType proxy1 = VrtContextProxy::createProxy(200, 20); - EXPECT_EQ(VrtContextProxy::isCollection(proxy1), false); - EXPECT_EQ(VrtContextProxy::isMigratable(proxy1), false); - EXPECT_EQ(VrtContextProxy::getVirtualNode(proxy1), 20); - EXPECT_EQ(VrtContextProxy::getVirtualID(proxy1), 200); - - VrtContextProxy::setIsCollection(proxy1, true); - EXPECT_EQ(VrtContextProxy::isCollection(proxy1), true); - - VrtContextProxy::setIsMigratable(proxy1, true); - EXPECT_EQ(VrtContextProxy::isMigratable(proxy1), true); - - VrtContextProxy::setVrtContextNode(proxy1, 2000); - EXPECT_EQ(VrtContextProxy::getVirtualNode(proxy1), 2000); - - VrtContextProxy::setVrtContextId(proxy1, 3000); - EXPECT_EQ(VrtContextProxy::getVirtualID(proxy1), 3000); - - EXPECT_EQ(VrtContextProxy::isCollection(proxy1), true); - EXPECT_EQ(VrtContextProxy::isMigratable(proxy1), true); - EXPECT_EQ(VrtContextProxy::getVirtualNode(proxy1), 2000); - EXPECT_EQ(VrtContextProxy::getVirtualID(proxy1), 3000); - - VrtContext_ProxyType proxy2 - = VrtContextProxy::createProxy(200, 20, true); - EXPECT_EQ(VrtContextProxy::isCollection(proxy2), true); - EXPECT_EQ(VrtContextProxy::isMigratable(proxy2), false); - EXPECT_EQ(VrtContextProxy::getVirtualNode(proxy2), 20); - EXPECT_EQ(VrtContextProxy::getVirtualID(proxy2), 200); - - VrtContext_ProxyType proxy3 = - VrtContextProxy::createProxy(200, 20, true, true); - EXPECT_EQ(VrtContextProxy::isCollection(proxy3), true); - EXPECT_EQ(VrtContextProxy::isMigratable(proxy3), true); - EXPECT_EQ(VrtContextProxy::getVirtualNode(proxy3), 20); - EXPECT_EQ(VrtContextProxy::getVirtualID(proxy3), 200); -} - -}}} // end namespace vt::tests::unit