fix-testing #30
No files matched your search
@@ -13,6 +13,7 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Building binary with make
|
- name: Building binary with make
|
||||||
run: |
|
run: |
|
||||||
|
sed -i '1s/^/#define TEST\n/' src/config/config.hpp && \
|
||||||
echo "#define TEST" >> src/OpenRouter/OpenRouter.hpp && \
|
echo "#define TEST" >> src/OpenRouter/OpenRouter.hpp && \
|
||||||
make -j$(nproc)
|
make -j$(nproc)
|
||||||
- name: Testing to run binary builded with make
|
- name: Testing to run binary builded with make
|
||||||
@@ -29,6 +30,7 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Building binary with CMake
|
- name: Building binary with CMake
|
||||||
run: |
|
run: |
|
||||||
|
sed -i '1s/^/#define TEST\n/' src/config/config.hpp && \
|
||||||
echo "#define TEST" >> src/OpenRouter/OpenRouter.hpp && \
|
echo "#define TEST" >> src/OpenRouter/OpenRouter.hpp && \
|
||||||
mkdir build && \
|
mkdir build && \
|
||||||
cd build && \
|
cd build && \
|
||||||
@@ -48,6 +50,7 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Building binary with meson
|
- name: Building binary with meson
|
||||||
run: |
|
run: |
|
||||||
|
sed -i '1s/^/#define TEST\n/' src/config/config.hpp && \
|
||||||
echo "#define TEST" >> src/OpenRouter/OpenRouter.hpp && \
|
echo "#define TEST" >> src/OpenRouter/OpenRouter.hpp && \
|
||||||
meson setup build && \
|
meson setup build && \
|
||||||
ninja -C build
|
ninja -C build
|
||||||
|
|||||||
@@ -2,5 +2,9 @@
|
|||||||
#include <ConfigManager.hpp>
|
#include <ConfigManager.hpp>
|
||||||
|
|
||||||
namespace config {
|
namespace config {
|
||||||
|
#ifdef TEST
|
||||||
|
static ConfigManager config;
|
||||||
|
#else
|
||||||
static ConfigManager config(std::string("../config.json"));
|
static ConfigManager config(std::string("../config.json"));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
#include <httplib.h>
|
#include <httplib.h>
|
||||||
#include <json.hpp>
|
#include <json.hpp>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
|
#include <types.hpp>
|
||||||
|
|
||||||
inline void check_body_empty(const httplib::Request& request, httplib::Response& response, std::string required_string) {
|
inline void check_body_empty(const httplib::Request& request, httplib::Response& response, std::string required_string) {
|
||||||
if (request.body.empty()) {
|
if (request.body.empty()) {
|
||||||
|
|||||||
+1
-1
@@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
OpenRouter::OpenRouter router;
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
|
OpenRouter::OpenRouter router;
|
||||||
return router.serve(
|
return router.serve(
|
||||||
config::config.getConfig()["server"]["ip"],
|
config::config.getConfig()["server"]["ip"],
|
||||||
config::config.getConfig()["server"]["port"]
|
config::config.getConfig()["server"]["port"]
|
||||||
|
|||||||
Reference in new issue
Block a user