forked from artyom-beilis/cppcms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcppcms_service_test.cpp
More file actions
39 lines (35 loc) · 1.11 KB
/
cppcms_service_test.cpp
File metadata and controls
39 lines (35 loc) · 1.11 KB
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
31
32
33
34
35
36
37
38
39
///////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) <artyomtnk@yahoo.com>
//
// See accompanying file COPYING.TXT file for licensing details.
//
///////////////////////////////////////////////////////////////////////////////
#include <cppcms/service.h>
#include <cppcms/application.h>
#include <cppcms/applications_pool.h>
#include <cppcms/http_response.h>
#include <iostream>
#include <sys/types.h>
#include <unistd.h>
class unit_test : public cppcms::application {
public:
unit_test(cppcms::service &s) : cppcms::application(s) {}
virtual void main(std::string)
{
response().out() << getpid();
}
};
int main(int argc,char **argv)
{
try {
cppcms::service srv(argc,argv);
srv.applications_pool().mount(cppcms::create_pool<unit_test>());
srv.run();
}
catch(std::exception const &e) {
std::cerr << e.what() << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}