Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1
//
2
// Created by denzel on 10/12/2025.
3
//
4
#
include
"UITestHarness.h"
5
#
include
"hellfire/core/Application.h"
6
7
8
int
main
(
int
argc,
char
** argv) {
9
bool
exit_on_completion =
false
;
10
11
for
(
int
i = 1; i < argc; ++i) {
12
if
(std::string(argv[i]) ==
"--exit-on-completion"
) {
13
exit_on_completion =
true
;
14
}
15
}
16
17
hellfire
::
Application
app;
18
auto
test_harness = std::make_unique<
hellfire
::
tests
::
UITestHarness
>();
19
auto
* harness = test_harness.get();
// Get raw pointer before move
20
app.register_plugin(std::move(test_harness));
21
22
if
(exit_on_completion) {
23
app
.
set_exit_condition
([harness]() {
24
return
harness->is_complete();
25
});
26
}
27
28
app
.
initialize
(
)
;
29
app
.
run
(
)
;
30
31
int
result = harness->get_exit_code();
32
33
std::cout <<
"\n========================================\n"
;
34
std::cout <<
"UI Tests "
<< (result == 0 ?
"PASSED"
:
"FAILED"
) <<
"\n"
;
35
std::cout <<
"========================================\n"
;
36
37
return
result;
38
}
hellfire::Application
Definition
Application.h:43
hellfire::Application::set_exit_condition
void set_exit_condition(std::function< bool()> condition)
Definition
Application.cpp:269
hellfire::Application::initialize
void initialize()
Definition
Application.cpp:69
hellfire::Application::run
void run()
Definition
Application.cpp:102
hellfire::tests::UITestHarness
Definition
UITestHarness.h:11
main
int main(int argc, char **argv)
Definition
main.cpp:8
hellfire::tests
Definition
UITestHarness.h:10
hellfire
Definition
AssetManager.cpp:10
tests
ui
main.cpp
Generated by
1.9.8