NAWA
0.8
Web Application Framework for C++
main.cpp
Go to the documentation of this file.
1
6
/*
7
* Copyright (C) 2019-2021 Tobias Flaig.
8
*
9
* This file is part of nawa.
10
*
11
* nawa is free software: you can redistribute it and/or modify
12
* it under the terms of the GNU Lesser General Public License,
13
* version 3, as published by the Free Software Foundation.
14
*
15
* nawa is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU Lesser General Public License for more details.
19
*
20
* You should have received a copy of the GNU Lesser General Public License
21
* along with nawa. If not, see <https://www.gnu.org/licenses/>.
22
*/
23
24
#define CATCH_CONFIG_MAIN
25
26
#include <
nawa/Exception.h
>
27
#include <
nawa/config/Config.h
>
28
29
#include <catch2/catch.hpp>
30
31
using namespace
nawa
;
32
using namespace
std;
33
34
Config
loadConfig
() {
35
/*
36
* Possible paths for test.ini, order of precedence:
37
* 1. ./test.ini
38
* 2. ../tests/test.ini
39
* 3. ./tests/test.ini
40
*/
41
try
{
42
return
Config
(
"test.ini"
);
43
}
catch
(
Exception
const
& e) {}
44
45
try
{
46
return
Config
(
"../tests/test.ini"
);
47
}
catch
(
Exception
const
& e) {}
48
49
try
{
50
return
Config
(
"tests/test.ini"
);
51
}
catch
(
Exception
const
& e) {}
52
53
return
Config
();
54
}
55
Config.h
Reader for config files and accessor to config values.
Exception.h
Exception class that can be used by apps to catch errors resulting from nawa function calls.
nawa::Config
Definition:
Config.h:35
nawa::Exception
Definition:
Exception.h:35
nawa
Definition:
AppInit.h:31
loadConfig
Config loadConfig()
Definition:
main.cpp:34
tests
main.cpp
Generated by
1.9.2