1 #include <stdio.h> 2 #include <string.h> 3 4 #include "settings.h" 5 #include "job_list.h" 6 #include "executor.h" 7 #include "resultgen.h" 8 main(int argc,char ** argv)9int main(int argc, char **argv) 10 { 11 struct settings settings; 12 struct job_list job_list; 13 struct execute_state state; 14 int exitcode = 0; 15 16 init_settings(&settings); 17 init_job_list(&job_list); 18 19 if (!parse_options(argc, argv, &settings)) { 20 return 1; 21 } 22 23 if (!create_job_list(&job_list, &settings)) { 24 return 1; 25 } 26 27 if (settings.list_all) { 28 list_all_tests(&job_list); 29 return 0; 30 } 31 32 if (!initialize_execute_state(&state, &settings, &job_list)) { 33 return 1; 34 } 35 36 if (!execute(&state, &settings, &job_list)) { 37 exitcode = 1; 38 } 39 40 if (state.time_left == 0.0) { 41 /* 42 * Overall timeout happened. Results generation can 43 * override this 44 */ 45 exitcode = 2; 46 } 47 48 if (!generate_results_path(settings.results_path)) { 49 exitcode = 1; 50 } 51 52 printf("Done.\n"); 53 return exitcode; 54 } 55