Version 1.11.12
[nbdkit/ericb.git] / tests / test.h
blobc369150e51031ae0e37d9d92d4d71e725efbfcce
1 /* nbdkit
2 * Copyright (C) 2013 Red Hat Inc.
3 * All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met:
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * * Neither the name of Red Hat nor the names of its contributors may be
17 * used to endorse or promote products derived from this software without
18 * specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
27 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
30 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
34 #ifndef NBDKIT_TEST_H
35 #define NBDKIT_TEST_H
37 #include <stdarg.h>
38 #include <unistd.h>
40 #define NBDKIT_START_TIMEOUT 30 /* seconds */
42 #define NBDKIT_PLUGIN(name) \
43 "../plugins/" name "/.libs/nbdkit-" name "-plugin.so"
45 extern pid_t pid; /* PID of nbdkit process. */
46 extern const char *server[2]; /* server parameter for add_drive */
48 extern int test_start_nbdkit (const char *arg, ...);
50 /* Declare program_name. */
51 #if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME == 1
52 #include <errno.h>
53 #define program_name program_invocation_short_name
54 #else
55 #define program_name "nbdkit"
56 #endif
58 #endif /* NBDKIT_TEST_H */