File: runner.c

package info (click to toggle)
intel-gpu-tools 2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 62,024 kB
  • sloc: xml: 769,439; ansic: 348,692; python: 8,307; yacc: 2,781; perl: 1,196; sh: 1,178; lex: 487; asm: 227; makefile: 27; lisp: 11
file content (56 lines) | stat: -rw-r--r-- 943 bytes parent folder | download
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <stdio.h>
#include <string.h>

#include "settings.h"
#include "job_list.h"
#include "executor.h"
#include "resultgen.h"

int main(int argc, char **argv)
{
	struct settings settings;
	struct job_list job_list;
	struct execute_state state;
	int exitcode = 0;

	init_settings(&settings);
	init_job_list(&job_list);

	if (!parse_options(argc, argv, &settings)) {
		return 1;
	}

	if (!create_job_list(&job_list, &settings)) {
		return 1;
	}

	if (settings.list_all) {
		list_all_tests(&job_list);
		return 0;
	}

	if (!initialize_execute_state(&state, &settings, &job_list)) {
		return 1;
	}

	if (!execute(&state, &settings, &job_list)) {
		exitcode = 1;
	}

	if (state.time_left == 0.0) {
		/*
		 * Overall timeout happened. Results generation can
		 * override this
		 */
		exitcode = 2;
	}

	if (!generate_results_path(settings.results_path)) {
		exitcode = 1;
	}

	clear_settings(&settings);

	printf("Done.\n");
	return exitcode;
}