Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
unitTestCommon.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2018 DIVIDE-Studio
3 Copyright (c) 2009 Ionut Cava
4
5 This file is part of DIVIDE Framework.
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software
9 and associated documentation files (the "Software"), to deal in the Software
10 without restriction,
11 including without limitation the rights to use, copy, modify, merge, publish,
12 distribute, sublicense,
13 and/or sell copies of the Software, and to permit persons to whom the
14 Software is furnished to do so,
15 subject to the following conditions:
16
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
19
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 IMPLIED,
22 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23 PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25 DAMAGES OR OTHER LIABILITY,
26 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
27 IN CONNECTION WITH THE SOFTWARE
28 OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30 */
31
32#pragma once
33#ifndef DVD_UNIT_TEST_COMMON_H
34#define DVD_UNIT_TEST_COMMON_H
35
36#include <catch2/catch_all.hpp>
37
38namespace Divide::Time
39{
40 class ProfileTimer;
41};
42
43class platformInitRunListener : public Catch::EventListenerBase
44{
45 public:
46 using Catch::EventListenerBase::EventListenerBase;
47
48 static bool PLATFORM_INIT;
49
50 static void PlatformInit();
51
52 void testRunStarting( Catch::TestRunInfo const& ) override;
53 void testRunEnded( Catch::TestRunStats const& ) override;
54 private:
56};
57
58#ifndef CHECK_TRUE
59#define CHECK_TRUE( ... ) CHECK( __VA_ARGS__ )
60#endif //CHECK_TRUE
61
62#ifndef CHECK_EQUAL
63#define CHECK_EQUAL(LHS, RHS) CHECK_TRUE(LHS == RHS)
64#endif //CHECK_EQUAL
65
66#ifndef CHECK_COMPARE
67#define CHECK_COMPARE(LHS, RHS) CHECK_TRUE(COMPARE(LHS, RHS))
68#endif //CHECK_COMPARE
69
70#ifndef CHECK_NOT_EQUAL
71#define CHECK_NOT_EQUAL(LHS, RHS) CHECK_FALSE(LHS == RHS)
72#endif //CHECK_NOT_EQUAL
73
74#ifndef CHECK_ZERO
75#define CHECK_ZERO(X) CHECK_TRUE(Divide::IS_ZERO(X))
76#endif //CHECK_EQUAL
77
78#ifndef CHECK_NOT_ZERO
79#define CHECK_NOT_ZERO(X) CHECK_FALSE(Divide::IS_ZERO(X))
80#endif //CHECK_NOT_ZERO
81
82
83#endif //DVD_UNIT_TEST_COMMON_H
void testRunStarting(Catch::TestRunInfo const &) override
Divide::Time::ProfileTimer * _testTimer
void testRunEnded(Catch::TestRunStats const &) override