summaryrefslogtreecommitdiffhomepage
path: root/tests/webserverprocess.h
blob: 3a4b7d6d7b8ae556bacebefb209b5b19558c192c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once

#include <string>

#include <ext/stdio_filebuf.h>
#include <signal.h>
#include <sys/wait.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/types.h>

class WebserverProcess
{
private:
 void init(const std::string& config);
public:
 WebserverProcess(const std::string& config, bool wait_for_listener = true);
 WebserverProcess(bool wait_for_listener = true);
 ~WebserverProcess();
 void start();
 void stop();
 bool is_running();
 std::string output();

private:
 pid_t m_pid;
 std::string m_config;
 bool m_wait_for_listener;
}; // class WebserverProcess