diff options
author | ngie <ngie@FreeBSD.org> | 2015-04-29 08:56:56 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2015-04-29 08:56:56 +0000 |
commit | 699d6a9776809c40d52be400e3bb86875c38d859 (patch) | |
tree | 142644d3b43dda0372c3f9df9e520fa4e5fea273 /tests/freebsd_test_suite/macros.h | |
parent | 84263e95af7a73b8526223931d4b64b0c12639c5 (diff) | |
download | FreeBSD-src-699d6a9776809c40d52be400e3bb86875c38d859.zip FreeBSD-src-699d6a9776809c40d52be400e3bb86875c38d859.tar.gz |
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
Diffstat (limited to 'tests/freebsd_test_suite/macros.h')
-rw-r--r-- | tests/freebsd_test_suite/macros.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/freebsd_test_suite/macros.h b/tests/freebsd_test_suite/macros.h index 755a994..bc0b610 100644 --- a/tests/freebsd_test_suite/macros.h +++ b/tests/freebsd_test_suite/macros.h @@ -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) |