common code used by tests
More...
#include <Teuchos_UnitTestHarness.hpp>
#include <Zoltan2_Util.hpp>
#include <iostream>
#include <Tpetra_Map.hpp>
#include <TpetraCore_config.h>
#include <ErrorHandlingForTests.hpp>
#include <PrintData.hpp>
#include <UserInputForTests.hpp>
Go to the source code of this file.
|
| #define | STR_VALUE(path) |
| #define | PATH_NAME(path) |
| #define | MEMORY_CHECK(iPrint, msg) |
| #define | Z2_TEST(TEST) |
| #define | Z2_TEST_THROW(code, ExceptType) |
| #define | Z2_TEST_NOTHROW(code) |
| #define | Z2_TEST_EQUALITY(val1, val2) |
| #define | Z2_TEST_INEQUALITY(val1, val2) |
| #define | Z2_TEST_ASSERT(expr) |
| #define | Z2_TEST_EQUALITY_CONST(val1, val2) |
| #define | Z2_TEST_INEQUALITY_CONST(val1, val2) |
| #define | Z2_TEST_COMPARE(val1, comp, val2) |
| #define | Z2_TEST_COMPARE_ARRAYS(val1, val2) |
| #define | Z2_TEST_COMPARE_FLOATING_ARRAYS(val1, val2, tol) |
| #define | Z2_TEST_FLOATING_EQUALITY(val1, val2, tol) |
| #define | Z2_TEST_DEVICE_HOST_VIEWS(deviceView, hostView) |
|
| typedef Tpetra::Map ::node_type | znode_t |
| typedef int | zpart_t |
| typedef Tpetra::Map ::local_ordinal_type | zlno_t |
| typedef Tpetra::Map ::global_ordinal_type | zgno_t |
| typedef float | zscalar_t |
common code used by tests
Definition in file Zoltan2_TestHelpers.hpp.
◆ STR_VALUE
| #define STR_VALUE |
( |
| path | ) |
|
◆ PATH_NAME
| #define PATH_NAME |
( |
| path | ) |
|
◆ MEMORY_CHECK
| #define MEMORY_CHECK |
( |
| iPrint, |
|
|
| msg ) |
Value: if (iPrint) { \
std::cout.width(10); \
std::cout.fill('*'); \
std::cout << kb << " KB, " << msg << std::endl; \
std::cout.width(0); \
std::cout.fill(' '); \
}
long getProcessKilobytes()
Definition at line 96 of file Zoltan2_TestHelpers.hpp.
◆ Z2_TEST
Value: { \
Teuchos::RCP<Teuchos::FancyOStream> fout = \
Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout)); \
auto &out = *fout; \
bool success = true; \
try { \
TEST; \
} catch (...) { \
out << "Test failed."; \
} \
if (!success) { \
throw std::runtime_error(#TEST " FAIL"); \
} \
}
Definition at line 106 of file Zoltan2_TestHelpers.hpp.
◆ Z2_TEST_THROW
| #define Z2_TEST_THROW |
( |
| code, |
|
|
| ExceptType ) |
◆ Z2_TEST_NOTHROW
| #define Z2_TEST_NOTHROW |
( |
| code | ) |
|
◆ Z2_TEST_EQUALITY
| #define Z2_TEST_EQUALITY |
( |
| val1, |
|
|
| val2 ) |
◆ Z2_TEST_INEQUALITY
| #define Z2_TEST_INEQUALITY |
( |
| val1, |
|
|
| val2 ) |
◆ Z2_TEST_ASSERT
| #define Z2_TEST_ASSERT |
( |
| expr | ) |
|
◆ Z2_TEST_EQUALITY_CONST
| #define Z2_TEST_EQUALITY_CONST |
( |
| val1, |
|
|
| val2 ) |
◆ Z2_TEST_INEQUALITY_CONST
| #define Z2_TEST_INEQUALITY_CONST |
( |
| val1, |
|
|
| val2 ) |
◆ Z2_TEST_COMPARE
| #define Z2_TEST_COMPARE |
( |
| val1, |
|
|
| comp, |
|
|
| val2 ) |
◆ Z2_TEST_COMPARE_ARRAYS
| #define Z2_TEST_COMPARE_ARRAYS |
( |
| val1, |
|
|
| val2 ) |
◆ Z2_TEST_COMPARE_FLOATING_ARRAYS
| #define Z2_TEST_COMPARE_FLOATING_ARRAYS |
( |
| val1, |
|
|
| val2, |
|
|
| tol ) |
◆ Z2_TEST_FLOATING_EQUALITY
| #define Z2_TEST_FLOATING_EQUALITY |
( |
| val1, |
|
|
| val2, |
|
|
| tol ) |
◆ Z2_TEST_DEVICE_HOST_VIEWS
| #define Z2_TEST_DEVICE_HOST_VIEWS |
( |
| deviceView, |
|
|
| hostView ) |
Value: \
{ \
for (int dim = 0; dim <= 2; ++dim) { \
Z2_TEST_EQUALITY(deviceView.extent(dim), hostView.extent(dim)); \
} \
\
const auto mirrorDevice = Kokkos::create_mirror_view(deviceView); \
Kokkos::deep_copy(mirrorDevice, deviceView); \
\
Z2_TEST_COMPARE_ARRAYS(hostView, mirrorDevice); \
}
Definition at line 161 of file Zoltan2_TestHelpers.hpp.
◆ znode_t
| typedef Tpetra::Map ::node_type znode_t |
◆ zpart_t
◆ zlno_t
| typedef Tpetra::Map ::local_ordinal_type zlno_t |
◆ zgno_t
| typedef Tpetra::Map ::global_ordinal_type zgno_t |
◆ zscalar_t
◆ testDataFilePath()
| std::string testDataFilePath |
( |
"." | | ) |
|
◆ zoltanTestDirectory()
| std::string zoltanTestDirectory |
( |
"." | | ) |
|
◆ PrintFromRoot()
| void PrintFromRoot |
( |
const std::string & | message | ) |
|
|
inline |
◆ TestDeviceHostView()
template<typename DeviceType, typename HostType>
| void TestDeviceHostView |
( |
const DeviceType & | deviceView, |
|
|
const HostType & | hostView ) |