Module Name:    src
Committed By:   kamil
Date:           Sat Feb 22 19:44:07 UTC 2020

Modified Files:
        src/tests/lib/libc/sys: Makefile t_ptrace_wait.c t_ptrace_wait.h

Log Message:
Disable t_ptrace_wait* tests for MKSANITIZER/MKLIBCSANITIZER

A subset of tests is not compatible with the sanitizers.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/tests/lib/libc/sys/Makefile
cvs rdiff -u -r1.164 -r1.165 src/tests/lib/libc/sys/t_ptrace_wait.c
cvs rdiff -u -r1.21 -r1.22 src/tests/lib/libc/sys/t_ptrace_wait.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/sys/Makefile
diff -u src/tests/lib/libc/sys/Makefile:1.57 src/tests/lib/libc/sys/Makefile:1.58
--- src/tests/lib/libc/sys/Makefile:1.57	Sun Jun 30 21:20:04 2019
+++ src/tests/lib/libc/sys/Makefile	Sat Feb 22 19:44:07 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.57 2019/06/30 21:20:04 mgorny Exp $
+# $NetBSD: Makefile,v 1.58 2020/02/22 19:44:07 kamil Exp $
 
 MKMAN=	no
 
@@ -110,6 +110,15 @@ CPPFLAGS.t_ptrace_waitid.c	+= -D_KERNTYP
 CPPFLAGS.t_ptrace_waitpid.c	+= -D_KERNTYPES -D__TEST_FENV
 CPPFLAGS.t_ucontext.c		+= -D_KERNTYPES
 
+.if ${MKSANITIZER:Uno} != "yes" && ${MKLIBCSANITIZER:Uno} != "yes"
+CPPFLAGS.t_ptrace_wait.c	+= -DENABLE_TESTS
+CPPFLAGS.t_ptrace_wait3.c	+= -DENABLE_TESTS
+CPPFLAGS.t_ptrace_wait4.c	+= -DENABLE_TESTS
+CPPFLAGS.t_ptrace_wait6.c	+= -DENABLE_TESTS
+CPPFLAGS.t_ptrace_waitid.c	+= -DENABLE_TESTS
+CPPFLAGS.t_ptrace_waitpid.c	+= -DENABLE_TESTS
+.endif
+
 FILES=		truncate_test.root_owned
 FILESBUILD=	yes
 FILESDIR_truncate_test.root_owned=	${TESTSDIR}

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.164 src/tests/lib/libc/sys/t_ptrace_wait.c:1.165
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.164	Thu Feb 20 22:38:54 2020
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Sat Feb 22 19:44:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.164 2020/02/20 22:38:54 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.165 2020/02/22 19:44:07 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.164 2020/02/20 22:38:54 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.165 2020/02/22 19:44:07 kamil Exp $");
 
 #define __LEGACY_PT_LWPINFO
 
@@ -76,6 +76,8 @@ __RCSID("$NetBSD: t_ptrace_wait.c,v 1.16
 
 #include <atf-c.h>
 
+#ifdef ENABLE_TESTS
+
 /* Assumptions in the kernel code that must be kept. */
 static_assert(sizeof(((struct ptrace_state *)0)->pe_report_event) ==
     sizeof(((siginfo_t *)0)->si_pe_report_event),
@@ -9016,11 +9018,29 @@ THREAD_CONCURRENT_TEST(thread_concurrent
 #include "t_ptrace_i386_wait.h"
 #include "t_ptrace_x86_wait.h"
 
+/// ----------------------------------------------------------------------------
+
+#else
+ATF_TC(dummy);
+ATF_TC_HEAD(dummy, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "A dummy test");
+}
+
+ATF_TC_BODY(dummy, tc)
+{
+
+	// Dummy, skipped
+	// The ATF framework requires at least a single defined test.
+}
+#endif
+
 ATF_TP_ADD_TCS(tp)
 {
 	setvbuf(stdout, NULL, _IONBF, 0);
 	setvbuf(stderr, NULL, _IONBF, 0);
 
+#ifdef ENABLE_TESTS
 	ATF_TP_ADD_TC(tp, traceme_raise1);
 	ATF_TP_ADD_TC(tp, traceme_raise2);
 	ATF_TP_ADD_TC(tp, traceme_raise3);
@@ -9620,5 +9640,9 @@ ATF_TP_ADD_TCS(tp)
 	ATF_TP_ADD_TCS_PTRACE_WAIT_I386();
 	ATF_TP_ADD_TCS_PTRACE_WAIT_X86();
 
+#else
+	ATF_TP_ADD_TC(tp, dummy);
+#endif
+
 	return atf_no_error();
 }

Index: src/tests/lib/libc/sys/t_ptrace_wait.h
diff -u src/tests/lib/libc/sys/t_ptrace_wait.h:1.21 src/tests/lib/libc/sys/t_ptrace_wait.h:1.22
--- src/tests/lib/libc/sys/t_ptrace_wait.h:1.21	Thu Feb 13 13:38:44 2020
+++ src/tests/lib/libc/sys/t_ptrace_wait.h	Sat Feb 22 19:44:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.h,v 1.21 2020/02/13 13:38:44 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.h,v 1.22 2020/02/22 19:44:07 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc.
@@ -606,11 +606,6 @@ trigger_trap(void)
 #endif
 }
 
-#if defined(__clang__)
-__attribute__((no_sanitize("undefined")))
-#else
-__attribute__((no_sanitize_undefined))
-#endif
 static void __used
 trigger_segv(void)
 {
@@ -647,11 +642,6 @@ are_fpu_exceptions_supported(void)
 	return true;
 }
 
-#if defined(__clang__)
-__attribute__((no_sanitize("undefined")))
-#else
-__attribute__((no_sanitize_undefined))
-#endif
 static void __used
 trigger_fpe(void)
 {

Reply via email to