filters: Swap GP_MirrorH() and GP_MirrorV()
[gfxprim/pasky.git] / tests / framework / tst_job.h
blob171c0f08b7d704820c2aaae4cee90739ac736655
1 /*****************************************************************************
2 * This file is part of gfxprim library. *
3 * *
4 * Gfxprim is free software; you can redistribute it and/or *
5 * modify it under the terms of the GNU Lesser General Public *
6 * License as published by the Free Software Foundation; either *
7 * version 2.1 of the License, or (at your option) any later version. *
8 * *
9 * Gfxprim is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
12 * Lesser General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU Lesser General Public *
15 * License along with gfxprim; if not, write to the Free Software *
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
17 * Boston, MA 02110-1301 USA *
18 * *
19 * Copyright (C) 2009-2012 Cyril Hrubis <metan@ucw.cz> *
20 * *
21 *****************************************************************************/
25 Test job is an instance of running test.
29 #ifndef TST_JOB_H
30 #define TST_JOB_H
32 #include <time.h>
34 #include "tst_msg.h"
35 #include "tst_preload.h"
36 #include "tst_test.h"
38 struct tst_job {
39 const struct tst_test *test;
41 /*
42 * Pipe fd.
44 * In parent this points to the read side of the pipe so the parent
45 * recieves data from child.
47 * In child this points to the write side of the pipe so child can
48 * send data to parent.
50 int pipefd;
52 int running:1;
54 /* test execution time */
55 struct timespec start_time;
56 struct timespec stop_time;
58 /* test cpu time */
59 struct timespec cpu_time;
61 /* test pid */
62 int pid;
64 /* test result */
65 enum tst_ret result;
67 /* additional benchmark data */
68 unsigned int bench_iter;
69 struct timespec bench_mean;
70 struct timespec bench_var;
73 * test malloc statistics, filled if TST_MALLOC_CHECK was set.
75 struct malloc_stats malloc_stats;
77 /* store for test messages */
78 struct tst_msg_store store;
82 * Runs a test job as a separate process.
84 * The test field must point to correct test.
86 void tst_job_run(struct tst_job *job);
89 * Waits for the test to finish.
91 void tst_job_wait(struct tst_job *job);
93 #endif /* TST_JOB_H */