Merge in util update
[awesomized/libmemcached] / libtest / common.h
1 /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
2 *
3 * libtest
4 *
5 * Copyright (C) 2011 Data Differential, http://datadifferential.com/
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 3 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 /*
23 Common include file for libtest
24 */
25
26 #pragma once
27
28 #include <config.h>
29
30 #include <cassert>
31 #include <cerrno>
32 #include <cstdlib>
33 #include <sstream>
34 #include <string>
35
36 #ifdef HAVE_SYS_TYPES_H
37 #include <sys/types.h>
38 #endif
39
40 #ifdef HAVE_SYS_TIME_H
41 #include <sys/time.h>
42 #endif
43
44 #ifdef HAVE_SYS_WAIT_H
45 #include <sys/wait.h>
46 #endif
47
48 #ifdef HAVE_SYS_RESOURCE_H
49 #include <sys/resource.h>
50 #endif
51
52 #ifdef HAVE_FNMATCH_H
53 #include <fnmatch.h>
54 #endif
55
56 static inline bool is_pid_valid(const pid_t pid)
57 {
58 return (pid > 1) ? true : false;
59 }
60
61 #include <libtest/gearmand.h>
62 #include <libtest/blobslap_worker.h>
63 #include <libtest/memcached.h>
64
65 #include <libtest/libtool.hpp>
66 #include <libtest/killpid.h>
67
68 #include <libtest/test.hpp>