|
@@ -148,6 +148,10 @@ int main(int argc, char *argv[])
|
|
char *launcher_args;
|
|
char *launcher_args;
|
|
char *top_srcdir;
|
|
char *top_srcdir;
|
|
struct sigaction sa;
|
|
struct sigaction sa;
|
|
|
|
+ int ret;
|
|
|
|
+ struct timeval start;
|
|
|
|
+ struct timeval end;
|
|
|
|
+ double timing;
|
|
|
|
|
|
test_args = NULL;
|
|
test_args = NULL;
|
|
timeout = 0;
|
|
timeout = 0;
|
|
@@ -254,6 +258,8 @@ int main(int argc, char *argv[])
|
|
exit(EXIT_FAILURE);
|
|
exit(EXIT_FAILURE);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ ret = EXIT_SUCCESS;
|
|
|
|
+ gettimeofday(&start, NULL);
|
|
alarm(timeout);
|
|
alarm(timeout);
|
|
if (child_pid == waitpid(child_pid, &child_exit_status, 0))
|
|
if (child_pid == waitpid(child_pid, &child_exit_status, 0))
|
|
{
|
|
{
|
|
@@ -269,7 +275,7 @@ int main(int argc, char *argv[])
|
|
if (status != AUTOTEST_SKIPPED_TEST)
|
|
if (status != AUTOTEST_SKIPPED_TEST)
|
|
fprintf(stdout, "`%s' exited with return code %d\n",
|
|
fprintf(stdout, "`%s' exited with return code %d\n",
|
|
test_name, status);
|
|
test_name, status);
|
|
- return status;
|
|
|
|
|
|
+ ret = status;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (WIFSIGNALED(child_exit_status))
|
|
else if (WIFSIGNALED(child_exit_status))
|
|
@@ -277,15 +283,19 @@ int main(int argc, char *argv[])
|
|
fprintf(stderr, "[error] `%s' killed with signal %d; test marked as failed\n",
|
|
fprintf(stderr, "[error] `%s' killed with signal %d; test marked as failed\n",
|
|
test_name, WTERMSIG(child_exit_status));
|
|
test_name, WTERMSIG(child_exit_status));
|
|
launch_gdb(test_name);
|
|
launch_gdb(test_name);
|
|
- return EXIT_FAILURE;
|
|
|
|
|
|
+ ret = EXIT_FAILURE;
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
fprintf(stderr, "[error] `%s' did not terminate normally; test marked as failed\n",
|
|
fprintf(stderr, "[error] `%s' did not terminate normally; test marked as failed\n",
|
|
test_name);
|
|
test_name);
|
|
- return EXIT_FAILURE;
|
|
|
|
|
|
+ ret = EXIT_FAILURE;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- return EXIT_SUCCESS;
|
|
|
|
|
|
+ gettimeofday(&end, NULL);
|
|
|
|
+ timing = (double)((end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec));
|
|
|
|
+ fprintf(stderr, "Execution of test '%s' took %f s\n", test_name, timing/1000000);
|
|
|
|
+
|
|
|
|
+ return ret;
|
|
}
|
|
}
|