NAWA 0.9
Web Application Framework for C++
main.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019-2022 Tobias Flaig.
3 *
4 * This file is part of nawa.
5 *
6 * nawa is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License,
8 * version 3, as published by the Free Software Foundation.
9 *
10 * nawa is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with nawa. If not, see <https://www.gnu.org/licenses/>.
17 */
18
24#define CATCH_CONFIG_MAIN
25
26#include <nawa/Exception.h>
27#include <nawa/config/Config.h>
28
29#include <catch2/catch.hpp>
30
31using namespace nawa;
32using namespace std;
33
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 {};
54}
55
Reader for config files and accessor to config values.
Exception class that can be used by apps to catch errors resulting from nawa function calls.
Definition: AppInit.h:31
Config loadConfig()
Definition: main.cpp:34