Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests Bluntly skip the tests that fail under QEMU. XXX: syst...



details:   https://anonhg.NetBSD.org/src/rev/3e8fceac4557
branches:  trunk
changeset: 763562:3e8fceac4557
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Fri Mar 25 10:00:31 2011 +0000

description:
Bluntly skip the tests that fail under QEMU. XXX: system(3) is used for this?

wnCVS: ----------------------------------------------------------------------

diffstat:

 tests/include/sys/t_bitops.c |  12 ++++++++----
 tests/lib/libm/t_ceil.c      |  11 +++++++++--
 tests/lib/libm/t_floor.c     |  16 +++++++++-------
 3 files changed, 26 insertions(+), 13 deletions(-)

diffs (121 lines):

diff -r b3926241f9c8 -r 3e8fceac4557 tests/include/sys/t_bitops.c
--- a/tests/include/sys/t_bitops.c      Fri Mar 25 09:39:19 2011 +0000
+++ b/tests/include/sys/t_bitops.c      Fri Mar 25 10:00:31 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_bitops.c,v 1.4 2011/03/25 04:26:42 jruoho Exp $ */
+/*     $NetBSD: t_bitops.c,v 1.5 2011/03/25 10:00:31 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -35,6 +35,7 @@
 #include <sys/bitops.h>
 
 #include <math.h>
+#include <stdlib.h>
 
 static const struct {
        uint32_t        val;
@@ -155,9 +156,6 @@
 ATF_TC(ilog2_2);
 ATF_TC_HEAD(ilog2_2, tc)
 {
-       /*
-        * This may fail under QEMU; see PR misc/44767.
-        */
        atf_tc_set_md_var(tc, "descr", "Test log2(3) vs. ilog2(3)");
 }
 
@@ -166,6 +164,12 @@
        double  x, y;
        uint64_t i;
 
+       /*
+        * This may fail under QEMU; see PR misc/44767.
+        */
+       if (system("cpuctl identify 0 | grep -q QEMU") == 0)
+               atf_tc_skip("Test not applicable on QEMU");
+
        for (i = 1; i < UINT32_MAX; i += UINT16_MAX) {
 
                x = log2(i);
diff -r b3926241f9c8 -r 3e8fceac4557 tests/lib/libm/t_ceil.c
--- a/tests/lib/libm/t_ceil.c   Fri Mar 25 09:39:19 2011 +0000
+++ b/tests/lib/libm/t_ceil.c   Fri Mar 25 10:00:31 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_ceil.c,v 1.1 2011/03/24 15:43:06 jruoho Exp $ */
+/* $NetBSD: t_ceil.c,v 1.2 2011/03/25 10:00:32 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,10 +29,11 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_ceil.c,v 1.1 2011/03/24 15:43:06 jruoho Exp $");
+__RCSID("$NetBSD: t_ceil.c,v 1.2 2011/03/25 10:00:32 jruoho Exp $");
 
 #include <math.h>
 #include <limits.h>
+#include <stdlib.h>
 
 #include <atf-c.h>
 
@@ -48,6 +49,12 @@
        double x, y;
        int i;
 
+       /*
+        * This may fail under QEMU; see PR misc/44767.
+        */
+       if (system("cpuctl identify 0 | grep -q QEMU") == 0)
+               atf_tc_skip("Test not applicable on QEMU");
+
        for (i = 0; i < n; i++) {
 
                x = i + 0.999999999;
diff -r b3926241f9c8 -r 3e8fceac4557 tests/lib/libm/t_floor.c
--- a/tests/lib/libm/t_floor.c  Fri Mar 25 09:39:19 2011 +0000
+++ b/tests/lib/libm/t_floor.c  Fri Mar 25 10:00:31 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_floor.c,v 1.2 2011/03/25 04:26:41 jruoho Exp $ */
+/* $NetBSD: t_floor.c,v 1.3 2011/03/25 10:00:32 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,21 +29,17 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_floor.c,v 1.2 2011/03/25 04:26:41 jruoho Exp $");
+__RCSID("$NetBSD: t_floor.c,v 1.3 2011/03/25 10:00:32 jruoho Exp $");
 
 #include <math.h>
 #include <limits.h>
-
-#include <stdio.h>
+#include <stdlib.h>
 
 #include <atf-c.h>
 
 ATF_TC(floor);
 ATF_TC_HEAD(floor, tc)
 {
-       /*
-        * This may fail under QEMU; see PR misc/44767.
-        */
        atf_tc_set_md_var(tc, "descr", "A basic test of floor(3)");
 }
 
@@ -53,6 +49,12 @@
        double x, y;
        int i;
 
+       /*
+        * This may fail under QEMU; see PR misc/44767.
+        */
+       if (system("cpuctl identify 0 | grep -q QEMU") == 0)
+               atf_tc_skip("Test not applicable on QEMU");
+
        for (i = 0; i < n; i++) {
 
                x = i + 0.999999999;



Home | Main Index | Thread Index | Old Index