Don't run FP Exception tests under qemu - they don't work.

While here, properly skip certain tests on vax architecture.  (It is
not legal to have a test-program with zero test cases, so each test
case needs to check-and-skip.)
This commit is contained in:
pgoyette 2011-01-03 20:51:26 +00:00
parent 39d0f69cf4
commit e81a7ec5fd
3 changed files with 36 additions and 27 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_ldexp.c,v 1.2 2011/01/01 23:45:01 pgoyette Exp $ */ /* $NetBSD: t_ldexp.c,v 1.3 2011/01/03 20:51:26 pgoyette Exp $ */
/*- /*-
* Copyright (c) 2010 The NetBSD Foundation, Inc. * Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -182,7 +182,11 @@ run_test(struct ldexp_test *table)
} \ } \
ATF_TC_BODY(name, tc) \ ATF_TC_BODY(name, tc) \
{ \ { \
const char *arch; \
\ \
arch = atf_config_get("atf_arch"); \
if (strcmp("vax", arch) == 0) \
atf_tc_skip("Test not valid for %s", arch); \
run_test(name); \ run_test(name); \
} }
@ -196,10 +200,7 @@ TEST(denormal_large_exp)
ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TCS(tp)
{ {
const char *arch;
arch = atf_config_get("atf_arch");
if (strcmp("vax", arch) != 0) {
ATF_TP_ADD_TC(tp, basics); ATF_TP_ADD_TC(tp, basics);
ATF_TP_ADD_TC(tp, zero); ATF_TP_ADD_TC(tp, zero);
ATF_TP_ADD_TC(tp, infinity); ATF_TP_ADD_TC(tp, infinity);
@ -207,8 +208,6 @@ ATF_TP_ADD_TCS(tp)
ATF_TP_ADD_TC(tp, denormal); ATF_TP_ADD_TC(tp, denormal);
ATF_TP_ADD_TC(tp, underflow); ATF_TP_ADD_TC(tp, underflow);
ATF_TP_ADD_TC(tp, denormal_large_exp); ATF_TP_ADD_TC(tp, denormal_large_exp);
} else
printf("Test not valid for %s\n", arch);
return atf_no_error(); return atf_no_error();
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_siginfo.c,v 1.7 2011/01/02 21:39:24 pgoyette Exp $ */ /* $NetBSD: t_siginfo.c,v 1.8 2011/01/03 20:51:26 pgoyette Exp $ */
/*- /*-
* Copyright (c) 2010 The NetBSD Foundation, Inc. * Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -296,6 +296,8 @@ ATF_TC_BODY(sigfpe_flt, tc)
struct sigaction sa; struct sigaction sa;
double d = strtod("0", NULL); double d = strtod("0", NULL);
if (system("cpuctl identify 0 | grep -q QEMU") == 0)
atf_tc_skip("Test does not run correctly under qemu");
if (sigsetjmp(sigfpe_flt_env, 0) == 0) { if (sigsetjmp(sigfpe_flt_env, 0) == 0) {
sa.sa_flags = SA_SIGINFO; sa.sa_flags = SA_SIGINFO;
sa.sa_sigaction = sigfpe_flt_action; sa.sa_sigaction = sigfpe_flt_action;

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_except.c,v 1.4 2011/01/03 09:14:21 dholland Exp $ */ /* $NetBSD: t_except.c,v 1.5 2011/01/03 20:51:26 pgoyette Exp $ */
/*- /*-
* Copyright (c) 1995 The NetBSD Foundation, Inc. * Copyright (c) 1995 The NetBSD Foundation, Inc.
@ -38,6 +38,9 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
const char *skip_mesg;
const char *skip_arch;
void sigfpe(int, siginfo_t *, void *); void sigfpe(int, siginfo_t *, void *);
volatile sig_atomic_t signal_caught; volatile sig_atomic_t signal_caught;
volatile int sicode; volatile int sicode;
@ -282,6 +285,8 @@ sigfpe(int s, siginfo_t *si, void *c)
ATF_TC_BODY(m##_##t, tc) \ ATF_TC_BODY(m##_##t, tc) \
{ \ { \
\ \
if (skip_mesg != NULL) \
atf_tc_skip(skip_mesg, skip_arch); \
m(t##_ops); \ m(t##_ops); \
} }
@ -294,19 +299,22 @@ TEST(unmasked, long_double)
ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TCS(tp)
{ {
const char *arch;
arch = atf_config_get("atf_machine"); skip_arch = atf_config_get("atf_machine");
if (strcmp("vax", arch) == 0 || strcmp("m68000", arch) == 0) if (strcmp("vax", skip_arch) == 0 || strcmp("m68000", skip_arch) == 0)
printf("Test not applicable on %s", arch); skip_mesg = "Test not applicable on %s";
else { else if (system("cpuctl identify 0 | grep -q QEMU") == 0) {
skip_mesg = "Test does not run correctly under %s";
skip_arch = "QEMU";
} else
skip_mesg = NULL;
ATF_TP_ADD_TC(tp, masked_float); ATF_TP_ADD_TC(tp, masked_float);
ATF_TP_ADD_TC(tp, masked_double); ATF_TP_ADD_TC(tp, masked_double);
ATF_TP_ADD_TC(tp, masked_long_double); ATF_TP_ADD_TC(tp, masked_long_double);
ATF_TP_ADD_TC(tp, unmasked_float); ATF_TP_ADD_TC(tp, unmasked_float);
ATF_TP_ADD_TC(tp, unmasked_double); ATF_TP_ADD_TC(tp, unmasked_double);
ATF_TP_ADD_TC(tp, unmasked_long_double); ATF_TP_ADD_TC(tp, unmasked_long_double);
}
return atf_no_error(); return atf_no_error();
} }