nngn
Toggle main menu visibility
Main Page
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
z
Variables
a
b
c
d
e
f
g
h
i
k
m
n
o
p
r
s
t
u
v
w
z
Typedefs
a
d
f
h
i
m
s
t
u
v
w
z
Enumerations
Enumerator
Concepts
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
k
m
o
p
q
r
s
t
u
v
Enumerations
a
b
c
d
e
f
l
m
o
p
r
s
t
Enumerator
a
b
c
d
e
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Related Symbols
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Typedefs
Enumerations
Macros
c
d
e
f
g
l
n
p
s
t
x
▼
nngn
Documentation
►
Building
►
Namespaces
►
Concepts
►
Classes
▼
Files
▼
File List
►
demos
►
maps
►
src
▼
tests
►
bench
►
collision
►
compute
►
font
►
graphics
►
input
►
lua
►
math
►
render
►
timing
►
utils
►
entity_test.cpp
►
entity_test.h
►
registry.h
►
tests.h
►
tools
►
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Concepts
Loading...
Searching...
No Matches
registry.h
Go to the documentation of this file.
1
#ifndef NNGN_TEST_REGISTRY_H
2
#define NNGN_TEST_REGISTRY_H
3
4
#include <QTest>
5
6
class
TestRegistry
{
7
using
V
= std::vector<std::unique_ptr<QObject>>;
8
static
V
&
m_tests
() {
static
V
v
;
return
v
; }
9
public
:
10
static
const
V
&
tests
() {
return
TestRegistry::m_tests
(); }
11
template
<
typename
T>
struct
R
{
R
() {
add<T>
(); } };
12
template
<
typename
T>
static
void
add
()
13
{
TestRegistry::m_tests
().push_back(std::make_unique<T>()); }
12
template
<
typename
T>
static
void
add
() {
…
}
14
};
6
class
TestRegistry
{
…
};
15
16
#define NNGN_TEST(T) static TestRegistry::R<T> NNGN_TEST_REGISTRATION_##T;
17
18
#endif
TestRegistry
Definition
registry.h:6
TestRegistry::V
std::vector< std::unique_ptr< QObject > > V
Definition
registry.h:7
TestRegistry::m_tests
static V & m_tests()
Definition
registry.h:8
TestRegistry::tests
static const V & tests()
Definition
registry.h:10
TestRegistry::add
static void add()
Definition
registry.h:12
v
v[1]
Definition
math.lua:22
TestRegistry::R
Definition
registry.h:11
TestRegistry::R::R
R()
Definition
registry.h:11
tests
registry.h
Generated by
1.11.0