Make the gmxapi tests look more like the other tests.
* Consistently use the test fixture based on the MDRun test fixture.
* Move gmxapi tests to the `api/` directory now that the infrastructure allows for the move. Establishes consistency with the nblib file locations.
endif()
option(GMXAPI "Install GROMACS API." ${_GMXAPI_DEFAULT})
if (GMXAPI)
+ if(NOT ${BUILD_SHARED_LIBS})
+ # Note: this conditional should check for the existence of a libgromacs target supporting PIC
+ # using the POSITION_INDEPENDENT_CODE property, but for now the only facility we have is the global
+ # variable, BUILD_SHARED_LIBS.
+ # TODO: gmxapi should gracefully build for dynamic linking or static linking for PIC or without.
+ message(FATAL_ERROR "GMXAPI requires position-independent code. Set -DGMXAPI=OFF or -DBUILD_SHARED_LIBS=ON.")
+ endif()
add_subdirectory(gmxapi)
endif()
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+# Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
add_library(gmxapi-detail INTERFACE)
target_include_directories(gmxapi-detail
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
+
+if (BUILD_TESTING AND GMX_BUILD_UNITTESTS)
+ add_subdirectory(tests)
+ add_subdirectory(workflow/tests)
+endif()
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+# Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
* Provides additional test coverage of template headers only used by client code.
*/
-#include "config.h"
-
-#include <gtest/gtest.h>
-
#include "gromacs/utility/gmxmpi.h"
#include "gmxapi/context.h"
#include "gmxapi/mpi/gmxapi_mpi.h"
+#include "testingconfiguration.h"
namespace gmxapi
namespace
{
-TEST(GmxApiMpiTest, AllContext)
+TEST_F(GmxApiTest, AllContext)
{
// Default Implicit COMM_WORLD for MPI builds.
- auto context = createContext();
+ EXPECT_NO_THROW(auto context = createContext());
}
#if GMX_LIB_MPI
-TEST(GmxApiMpiTest, NullContext)
+TEST_F(GmxApiTest, NullContext)
{
// Explicit COMM_NULL is not supported.
EXPECT_ANY_THROW(assignResource(MPI_COMM_NULL));
}
-TEST(GmxApiMpiTest, MpiWorldContext)
+TEST_F(GmxApiTest, MpiWorldContext)
{
// Note that this test is only compiled when GMX_MPI is enabled for the
// build tree, so we cannot unit test the behavior of non-MPI GROMACS
auto context = createContext(*resources);
}
-TEST(GmxApiMpiTest, MpiSplitContext)
+TEST_F(GmxApiTest, MpiSplitContext)
{
// Explicit sub-communicator.
MPI_Comm communicator = MPI_COMM_NULL;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
// Run each rank as a separate ensemble member.
MPI_Comm_split(MPI_COMM_WORLD, rank, rank, &communicator);
- auto context = createContext(*assignResource(communicator));
+ EXPECT_NO_THROW(auto context = createContext(*assignResource(communicator)));
}
#endif
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2018, by the GROMACS development team, led by
+ * Copyright (c) 2018,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2018,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2018, by the GROMACS development team, led by
+ * Copyright (c) 2018,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
*/
#include "gmxapi/status.h"
-
-#include <gtest/gtest.h>
+#include "testingconfiguration.h"
namespace gmxapi
{
/*!
* \brief Test construction and conversion of boolean success status.
*/
-TEST(GmxApiBasicTest, Status)
+TEST_F(GmxApiTest, Status)
{
{
auto status = gmxapi::Status();
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2018, by the GROMACS development team, led by
+ * Copyright (c) 2018,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2018, by the GROMACS development team, led by
+ * Copyright (c) 2018,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2018,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include <climits>
-#include <gtest/gtest.h>
-
#include "gmxapi/version.h"
#include "testingconfiguration.h"
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+# Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
EXPECT_EQ(impl.size(), 1);
// Create workflow container
- gmxapi::Workflow work{ std::move(impl) };
+ EXPECT_NO_THROW(gmxapi::Workflow work{ std::move(impl) });
}
//! Create from create() method(s)
add_subdirectory(gromacs)
add_subdirectory(programs)
-add_subdirectory(api)
# Configure header files with configuration-specific values. This step
# should follow all introspection e.g. looking for headers and
+++ /dev/null
-#
-# This file is part of the GROMACS molecular simulation package.
-#
-# Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
-# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
-# and including many others, as listed in the AUTHORS file in the
-# top-level source directory and at http://www.gromacs.org.
-#
-# GROMACS is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public License
-# as published by the Free Software Foundation; either version 2.1
-# of the License, or (at your option) any later version.
-#
-# GROMACS is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with GROMACS; if not, see
-# http://www.gnu.org/licenses, or write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# If you want to redistribute modifications to GROMACS, please
-# consider that scientific software is very special. Version
-# control is crucial - bugs must be traceable. We will be happy to
-# consider code for inclusion in the official distribution, but
-# derived work must not be called official GROMACS. Details are found
-# in the README & COPYING files - if they are missing, get the
-# official version at http://www.gromacs.org.
-#
-# To help us fund GROMACS development, we humbly ask that you cite
-# the research papers on the package. Check out http://www.gromacs.org.
-
-# Activate targets for new C++ API components and docs.
-if (GMXAPI)
- if(NOT ${BUILD_SHARED_LIBS})
- # Note: this conditional should check for the existence of a libgromacs target supporting PIC
- # using the POSITION_INDEPENDENT_CODE property, but for now the only facility we have is the global
- # variable, BUILD_SHARED_LIBS.
- # TODO: gmxapi should gracefully build for dynamic linking or static linking for PIC or without.
- message(FATAL_ERROR "GMXAPI requires position-independent code. Set -DGMXAPI=OFF or -DBUILD_SHARED_LIBS=ON.")
- endif()
- add_subdirectory(cpp)
-endif()
-
+++ /dev/null
-#
-# This file is part of the GROMACS molecular simulation package.
-#
-# Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
-# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
-# and including many others, as listed in the AUTHORS file in the
-# top-level source directory and at http://www.gromacs.org.
-#
-# GROMACS is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public License
-# as published by the Free Software Foundation; either version 2.1
-# of the License, or (at your option) any later version.
-#
-# GROMACS is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with GROMACS; if not, see
-# http://www.gnu.org/licenses, or write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# If you want to redistribute modifications to GROMACS, please
-# consider that scientific software is very special. Version
-# control is crucial - bugs must be traceable. We will be happy to
-# consider code for inclusion in the official distribution, but
-# derived work must not be called official GROMACS. Details are found
-# in the README & COPYING files - if they are missing, get the
-# official version at http://www.gromacs.org.
-#
-# To help us fund GROMACS development, we humbly ask that you cite
-# the research papers on the package. Check out http://www.gromacs.org.
-
-if(BUILD_TESTING)
- add_subdirectory(tests)
- add_subdirectory(workflow/tests)
-endif()