Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2020-08-05 12:36:33 +0300
committerJean-Baptiste Kempf <jb@videolan.org>2020-08-06 16:49:03 +0300
commit95a192549a448b70d9542e840c4e34b60d09b093 (patch)
treef421b17a6107a5a596cb6b27f360a4b3282186f2 /tests
parent06f12a8995f00baef98f324f57bab3b95af05f7f (diff)
checkasm: Explicitly test whether the readtime() function works
This gives a clearer indication about what is wrong, instead of running into illegal instruction errors in the individual tests. On ARM and AArch64, access to the cycle counter register is forbidden in user mode code by default on Linux and Darwin.
Diffstat (limited to 'tests')
-rw-r--r--tests/checkasm/checkasm.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c
index ee52c89..2bf15d8 100644
--- a/tests/checkasm/checkasm.c
+++ b/tests/checkasm/checkasm.c
@@ -520,7 +520,6 @@ static void print_cpu_name(void) {
int main(int argc, char *argv[]) {
(void)func_new, (void)func_ref;
state.seed = get_seed();
- int ret = 0;
while (argc > 1) {
if (!strncmp(argv[1], "--help", 6)) {
@@ -568,6 +567,22 @@ int main(int argc, char *argv[]) {
dav1d_init_cpu();
+ if (state.bench_pattern) {
+ static int testing = 0;
+ checkasm_save_context();
+ if (!testing) {
+ checkasm_set_signal_handler_state(1);
+ testing = 1;
+ readtime();
+ checkasm_set_signal_handler_state(0);
+ } else {
+ fprintf(stderr, "checkasm: unable to access cycle counter\n");
+ return 1;
+ }
+ }
+
+ int ret = 0;
+
if (!state.function_listing) {
fprintf(stderr, "checkasm: using random seed %u\n", state.seed);
#if ARCH_X86_64
@@ -672,7 +687,9 @@ int checkasm_bench_func(void) {
/* Indicate that the current test has failed, return whether verbose printing
* is requested. */
int checkasm_fail_func(const char *const msg, ...) {
- if (state.current_func_ver->cpu && state.current_func_ver->ok) {
+ if (state.current_func_ver && state.current_func_ver->cpu &&
+ state.current_func_ver->ok)
+ {
va_list arg;
print_cpu_name();