waLBerla 7.3
Loading...
Searching...
No Matches
Testutils.hpp File Reference

Detailed Description

#include "core/Abort.h"
#include <algorithm>
#include <chrono>
#include <cmath>
#include <concepts>
#include <cstdlib>
#include <filesystem>
#include <format>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <ranges>
#include <source_location>
#include <span>
#include <sstream>
#include <string>
#include <string_view>
#include "walberla/v8/Memory.hpp"
#include "walberla/v8/Sweep.hpp"

Classes

class  walberla::v8::testing::AssertionError
class  walberla::v8::testing::TestsRunner
 Primary test orchestrator. More...
class  walberla::v8::testing::with_tolerance
 Floating-point near-equality assertions with given tolerances. More...

Namespaces

namespace  walberla
 Storage for detected contacts which can be used to perform actions for all contacts, e.g.
namespace  walberla::v8
namespace  walberla::v8::testing
namespace  walberla::v8::testing::printing

Functions

std::string walberla::v8::testing::printing::format_range (const std::ranges::range auto &range)
std::string walberla::v8::testing::printing::format_range (const auto &not_a_range)
std::filesystem::path walberla::v8::testing::tmp_dir ()
 Create and obtain a unique temporary directory.
void walberla::v8::testing::assert_true (bool cond, const std::source_location loc=std::source_location::current())
 Check if the given boolean condition is true.
void walberla::v8::testing::assert_false (bool cond, const std::source_location loc=std::source_location::current())
 Check if the given boolean condition is false.
template<typename TException>
void walberla::v8::testing::throws (const std::function< void() > &func, const std::source_location loc=std::source_location::current())
 Check if the given callback function raises an expected exception type.
template<std::equality_comparable T>
void walberla::v8::testing::assert_equal (const T &actual, const T &desired, const std::source_location loc=std::source_location::current())
 Check if two values are equal.
template<std::equality_comparable T>
void walberla::v8::testing::assert_inequal (const T &left, const T &right, const std::source_location loc=std::source_location::current())
 Check if two values are inequal.
template<std::totally_ordered T>
void walberla::v8::testing::assert_less (const T &left, const T &right, const std::source_location loc=std::source_location::current())
 Check if one value is less than another.
template<std::totally_ordered T>
void walberla::v8::testing::assert_greater (const T &left, const T &right, const std::source_location loc=std::source_location::current())
 Check if one value is greater than another.
template<std::totally_ordered T>
void walberla::v8::testing::assert_less_equal (const T &left, const T &right, const std::source_location loc=std::source_location::current())
 Check if one value is less or equal to another.
template<std::totally_ordered T>
void walberla::v8::testing::assert_greater_equal (const T &left, const T &right, const std::source_location loc=std::source_location::current())
 Check if one value is greater or equal to another.
template<std::ranges::range R1, std::ranges::range R2>
void walberla::v8::testing::assert_range_equal (const R1 &actual, const R2 &desired, const std::source_location loc=std::source_location::current())
 Check if two ranges have identical elements.
template<std::ranges::range R1>
void walberla::v8::testing::assert_range_equal (const R1 &actual, const std::ranges::range_value_t< R1 > &desired, const std::source_location loc=std::source_location::current())
 Check if all elements of a range are equal to a desired value.
template<std::ranges::range R1, std::ranges::range R2>
void walberla::v8::testing::assert_range_inequal (R1 actual, R2 desired, const std::source_location loc=std::source_location::current())
template<std::floating_point T>
void walberla::v8::testing::assert_close (T actual, T desired, const std::source_location loc=std::source_location::current())
 See with_tolerance::assert_close.
template<std::ranges::range R1, std::ranges::range R2>
void walberla::v8::testing::assert_allclose (const R1 &actual, const R2 &desired, const std::source_location loc=std::source_location::current())
 See with_tolerance::assert_allclose.
template<std::ranges::sized_range R1>
void walberla::v8::testing::assert_allclose (const R1 &actual, std::ranges::range_value_t< R1 > desired, const std::source_location loc=std::source_location::current())
 See with_tolerance::assert_allclose.
template<memory::IFieldView TFieldView>
void walberla::v8::testing::assert_allclose (const TFieldView &actual, const TFieldView &desired, bool withGhostLayers=false, const std::source_location loc=std::source_location::current())
 See with_tolerance::assert_allclose.