Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Apr 2015 08:56:56 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r282211 - head/tests/freebsd_test_suite
Message-ID:  <201504290856.t3T8uuHF070908@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Wed Apr 29 08:56:56 2015
New Revision: 282211
URL: https://svnweb.freebsd.org/changeset/base/282211

Log:
  ATF_REQUIRE_KERNEL_MODULE: use atf_skip, not ATF_REQUIRE_MSG so the testcase
  no longer bombs out
  PLAIN_REQUIRE_KERNEL_MODULE: use printf + _exit, no err so the testcase no
  longer bombs out if it prints to stderr
  
  MFC after: 5 days

Modified:
  head/tests/freebsd_test_suite/macros.h

Modified: head/tests/freebsd_test_suite/macros.h
==============================================================================
--- head/tests/freebsd_test_suite/macros.h	Wed Apr 29 04:08:17 2015	(r282210)
+++ head/tests/freebsd_test_suite/macros.h	Wed Apr 29 08:56:56 2015	(r282211)
@@ -32,21 +32,24 @@
 #include <sys/param.h>
 #include <sys/module.h>
 #include <string.h>
-#include <err.h>
 #include <errno.h>
+#include <stdio.h>
+#include <unistd.h>
 
 #include <atf-c.h>
 
 #define	ATF_REQUIRE_KERNEL_MODULE(_mod_name) do {			\
-	ATF_REQUIRE_MSG(modfind(_mod_name) != -1,			\
-	    "module %s could not be resolved: %s",			\
-	    _mod_name, strerror(errno));				\
+	if (modfind(_mod_name) == -1) {					\
+		atf_skip("module %s could not be resolved: %s",		\
+		    _mod_name, strerror(errno));			\
+	}								\
 } while(0)
 
-#define	PLAIN_REQUIRE_KERNEL_MODULE(_mod_name, _exit_code) do {	\
+#define	PLAIN_REQUIRE_KERNEL_MODULE(_mod_name, _exit_code) do {		\
 	if (modfind(_mod_name) == -1) {					\
-		err(_exit_code, "module %s could not be resolved",	\
-		    _mod_name);						\
+		printf("module %s could not be resolved: %s\n",		\
+		    _mod_name, strerror(errno));			\
+		_exit(_exit_code);					\
 	}								\
 } while(0)
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504290856.t3T8uuHF070908>