unittest namespace
UnitTest declarations and definitions.
Namespaces
- namespace ctr
- UnitTest control facilitating user input to internal data transfer.
Classes
Functions
- void operator|(PUP::er& p, tut::test_runner_singleton& runner)
-
template<typename T>void veceq(const std::string& msg, const std::vector<T>& a, const std::vector<T>& b, tk::
real prec = std::numeric_limits<T>::epsilon()) - Ensure equality of all element of a vector of Ts (e.g., floating point numbers) up to some precision.
-
template<typename T, std::size_t N>void veceq(const std::string& msg, const std::array<T, N>& a, const std::array<T, N>& b, tk::
real prec = std::numeric_limits<T>::epsilon()) - Ensure equality of all element of a array of Ts (e.g., floating point numbers) up to some precision.
Variables
- tut::test_runner_singleton g_runner
- Template Unit Test test runner.
- CProxy_TUTSuite g_suiteProxy
- std::string g_executable
- int g_maxTestsInGroup
- Max number of tests in every group.
Function documentation
void unittest:: operator|(PUP::er& p,
tut::test_runner_singleton& runner)
#include <src/Main/UnitTest.cpp>
Pack/Unpack test runner. This Pack/Unpack method (re-)creates the test runner singleton on all processing elements. Therefore we circumvent Charm's usual pack/unpack for this type, and thus sizing does not make sense: sizing is a no-op. We could initialize the stack in UnitTestDriver's constructor and let this function re-create the runner only when unpacking, but that leads to repeating the same code twice: once in UnitTestDriver's constructor, once here. Another option is to use this pack/unpack routine to both initially create (when packing) and to re-create (when unpacking) the runner, which eliminates the need for pre-creating the object in UnitTestDriver's constructor and therefore eliminates the repeated code. This explains the guard for sizing: the code below is called for packing only (in serial) and packing and unpacking (in parallel).
#include <src/UnitTest/TUTUtil.hpp>
template<typename T>
void unittest:: veceq(const std::string& msg,
const std::vector<T>& a,
const std::vector<T>& b,
tk:: real prec = std::numeric_limits<T>::epsilon())
Ensure equality of all element of a vector of Ts (e.g., floating point numbers) up to some precision.
Parameters | |
---|---|
msg in | Message to output if the vectors are not equal |
a in | First vector to compare |
b in | Second vector to compare |
prec in | Optional precision |
#include <src/UnitTest/TUTUtil.hpp>
template<typename T, std::size_t N>
void unittest:: veceq(const std::string& msg,
const std::array<T, N>& a,
const std::array<T, N>& b,
tk:: real prec = std::numeric_limits<T>::epsilon())
Ensure equality of all element of a array of Ts (e.g., floating point numbers) up to some precision.
Parameters | |
---|---|
msg in | Message to output if the arrays are not equal |
a in | First array to compare |
b in | Second array to compare |
prec in | Optional precision |
Variable documentation
tut::test_runner_singleton unittest:: g_runner
#include <src/UnitTest/TUTTest.hpp>
Template Unit Test test runner.
Global-scope data. Initialized by the main chare and distibuted to all PEs by the Charm++ runtime system. Though semantically not const, all these global data should be considered read-only. See also http:/
CProxy_TUTSuite unittest:: g_suiteProxy
#include <tests/unit/Base/TestTimer.cpp>
Test suite Charm++ proxy facilitating call-back to unit test suite by individual unit tests spawning Charm++ chares
std::string unittest:: g_executable
#include <tests/unit/Base/TestWriter.cpp>
UnitTest executable name. So that FileParser's unit tests can access a file for opening.
int unittest:: g_maxTestsInGroup
#include <src/UnitTest/TUTSuite.cpp>
Max number of tests in every group.