summaryrefslogtreecommitdiffstats
path: root/contrib/atf/atf-c/macros.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/atf/atf-c/macros.h')
-rw-r--r--contrib/atf/atf-c/macros.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/contrib/atf/atf-c/macros.h b/contrib/atf/atf-c/macros.h
index 7afe9e8..7c33ccb 100644
--- a/contrib/atf/atf-c/macros.h
+++ b/contrib/atf/atf-c/macros.h
@@ -80,7 +80,7 @@
#define ATF_TC_HEAD(tc, tcptr) \
static \
void \
- atfu_ ## tc ## _head(atf_tc_t *tcptr)
+ atfu_ ## tc ## _head(atf_tc_t *tcptr ATF_DEFS_ATTRIBUTE_UNUSED)
#define ATF_TC_HEAD_NAME(tc) \
(atfu_ ## tc ## _head)
@@ -181,6 +181,24 @@
ATF_CHECK_MSG(strcmp(x, y) == 0, "%s != %s (%s != %s): " fmt, \
#x, #y, x, y, ##__VA_ARGS__)
+#define ATF_REQUIRE_MATCH(regexp, string) \
+ ATF_REQUIRE_MSG(atf_utils_grep_string("%s", string, regexp), \
+ "'%s' not matched in '%s'", regexp, string);
+
+#define ATF_CHECK_MATCH(regexp, string) \
+ ATF_CHECK_MSG(atf_utils_grep_string("%s", string, regexp), \
+ "'%s' not matched in '%s'", regexp, string);
+
+#define ATF_REQUIRE_MATCH_MSG(regexp, string, fmt, ...) \
+ ATF_REQUIRE_MSG(atf_utils_grep_string("%s", string, regexp), \
+ "'%s' not matched in '%s': " fmt, regexp, string, \
+ ##__VA_ARGS__);
+
+#define ATF_CHECK_MATCH_MSG(regexp, string, fmt, ...) \
+ ATF_CHECK_MSG(atf_utils_grep_string("%s", string, regexp), \
+ "'%s' not matched in '%s': " fmt, regexp, string, \
+ ##__VA_ARGS__);
+
#define ATF_CHECK_ERRNO(exp_errno, bool_expr) \
atf_tc_check_errno(__FILE__, __LINE__, exp_errno, #bool_expr, bool_expr)
OpenPOWER on IntegriCloud