Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/lib/libc Don't run FP Exception tests under qemu - the...
details: https://anonhg.NetBSD.org/src/rev/4a5907f0beb6
branches: trunk
changeset: 760365:4a5907f0beb6
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Mon Jan 03 20:51:26 2011 +0000
description:
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.)
diffstat:
tests/lib/libc/gen/t_ldexp.c | 25 ++++++++++++-------------
tests/lib/libc/gen/t_siginfo.c | 4 +++-
tests/lib/libc/ieeefp/t_except.c | 34 +++++++++++++++++++++-------------
3 files changed, 36 insertions(+), 27 deletions(-)
diffs (129 lines):
diff -r 383aaaabcebb -r 4a5907f0beb6 tests/lib/libc/gen/t_ldexp.c
--- a/tests/lib/libc/gen/t_ldexp.c Mon Jan 03 19:25:48 2011 +0000
+++ b/tests/lib/libc/gen/t_ldexp.c Mon Jan 03 20:51:26 2011 +0000
@@ -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.
@@ -182,7 +182,11 @@
} \
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); \
}
@@ -196,19 +200,14 @@
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, zero);
- ATF_TP_ADD_TC(tp, infinity);
- ATF_TP_ADD_TC(tp, overflow);
- ATF_TP_ADD_TC(tp, denormal);
- ATF_TP_ADD_TC(tp, underflow);
- ATF_TP_ADD_TC(tp, denormal_large_exp);
- } else
- printf("Test not valid for %s\n", arch);
+ ATF_TP_ADD_TC(tp, basics);
+ ATF_TP_ADD_TC(tp, zero);
+ ATF_TP_ADD_TC(tp, infinity);
+ ATF_TP_ADD_TC(tp, overflow);
+ ATF_TP_ADD_TC(tp, denormal);
+ ATF_TP_ADD_TC(tp, underflow);
+ ATF_TP_ADD_TC(tp, denormal_large_exp);
return atf_no_error();
}
diff -r 383aaaabcebb -r 4a5907f0beb6 tests/lib/libc/gen/t_siginfo.c
--- a/tests/lib/libc/gen/t_siginfo.c Mon Jan 03 19:25:48 2011 +0000
+++ b/tests/lib/libc/gen/t_siginfo.c Mon Jan 03 20:51:26 2011 +0000
@@ -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.
@@ -296,6 +296,8 @@
struct sigaction sa;
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) {
sa.sa_flags = SA_SIGINFO;
sa.sa_sigaction = sigfpe_flt_action;
diff -r 383aaaabcebb -r 4a5907f0beb6 tests/lib/libc/ieeefp/t_except.c
--- a/tests/lib/libc/ieeefp/t_except.c Mon Jan 03 19:25:48 2011 +0000
+++ b/tests/lib/libc/ieeefp/t_except.c Mon Jan 03 20:51:26 2011 +0000
@@ -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.
@@ -38,6 +38,9 @@
#include <stdlib.h>
#include <string.h>
+const char *skip_mesg;
+const char *skip_arch;
+
void sigfpe(int, siginfo_t *, void *);
volatile sig_atomic_t signal_caught;
volatile int sicode;
@@ -282,6 +285,8 @@
ATF_TC_BODY(m##_##t, tc) \
{ \
\
+ if (skip_mesg != NULL) \
+ atf_tc_skip(skip_mesg, skip_arch); \
m(t##_ops); \
}
@@ -294,19 +299,22 @@
ATF_TP_ADD_TCS(tp)
{
- const char *arch;
- arch = atf_config_get("atf_machine");
- if (strcmp("vax", arch) == 0 || strcmp("m68000", arch) == 0)
- printf("Test not applicable on %s", arch);
- else {
- ATF_TP_ADD_TC(tp, masked_float);
- ATF_TP_ADD_TC(tp, masked_double);
- ATF_TP_ADD_TC(tp, masked_long_double);
- ATF_TP_ADD_TC(tp, unmasked_float);
- ATF_TP_ADD_TC(tp, unmasked_double);
- ATF_TP_ADD_TC(tp, unmasked_long_double);
- }
+ skip_arch = atf_config_get("atf_machine");
+ if (strcmp("vax", skip_arch) == 0 || strcmp("m68000", skip_arch) == 0)
+ skip_mesg = "Test not applicable on %s";
+ 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_double);
+ ATF_TP_ADD_TC(tp, masked_long_double);
+ ATF_TP_ADD_TC(tp, unmasked_float);
+ ATF_TP_ADD_TC(tp, unmasked_double);
+ ATF_TP_ADD_TC(tp, unmasked_long_double);
return atf_no_error();
}
Home |
Main Index |
Thread Index |
Old Index