TORTURE_SKIP=3
};
+enum torture_progress_whence {
+ TORTURE_PROGRESS_SET,
+ TORTURE_PROGRESS_CUR,
+ TORTURE_PROGRESS_POP,
+ TORTURE_PROGRESS_PUSH,
+};
+
/*
* These callbacks should be implemented by any backend that wishes
* to listen to reports from the torture tests.
struct torture_test *);
void (*test_result) (struct torture_context *,
enum torture_result, const char *reason);
+ void (*progress) (struct torture_context *, int offset, enum torture_progress_whence whence);
};
void torture_ui_test_start(struct torture_context *context,
bool torture_run_suite(struct torture_context *context,
struct torture_suite *suite);
+/* Run the specified testsuite recursively, but only the specified
+ * tests */
+bool torture_run_suite_restricted(struct torture_context *context,
+ struct torture_suite *suite, char **restricted);
+
/* Run the specified testcase */
bool torture_run_tcase(struct torture_context *context,
struct torture_tcase *tcase);
return false; \
}
+#define torture_assert_goto(torture_ctx,expr,ret,label,cmt) \
+ if (!(expr)) { \
+ torture_result(torture_ctx, TORTURE_FAIL, __location__": Expression `%s' failed: %s", __STRING(expr), cmt); \
+ ret = false; \
+ goto label; \
+ }
+
#define torture_assert_werr_equal(torture_ctx, got, expected, cmt) \
do { WERROR __got = got, __expected = expected; \
if (!W_ERROR_EQUAL(__got, __expected)) { \
do { int __got = (got), __expected = (expected); \
if (__got != __expected) { \
torture_result(torture_ctx, TORTURE_FAIL, \
- __location__": "#got" was %d, expected %d: %s", \
- __got, __expected, cmt); \
+ __location__": "#got" was %d (0x%X), expected %d (0x%X): %s", \
+ __got, __got, __expected, __expected, cmt); \
return false; \
} \
} while(0)
do { int __got = (got), __expected = (expected); \
if (__got != __expected) { \
torture_result(torture_ctx, TORTURE_FAIL, \
- __location__": "#got" was %d, expected %d: %s", \
- __got, __expected, cmt); \
+ __location__": "#got" was %d (0x%X), expected %d (0x%X): %s", \
+ __got, __got, __expected, __expected, cmt); \
ret = false; \
goto label; \
} \
do { uint64_t __got = (got), __expected = (expected); \
if (__got != __expected) { \
torture_result(torture_ctx, TORTURE_FAIL, \
- __location__": "#got" was %llu, expected %llu: %s", \
- (unsigned long long)__got, (unsigned long long)__expected, cmt); \
+ __location__": "#got" was %llu (0x%llX), expected %llu (0x%llX): %s", \
+ (unsigned long long)__got, (unsigned long long)__got, \
+ (unsigned long long)__expected, (unsigned long long)__expected, \
+ cmt); \
return false; \
} \
} while(0)
struct torture_suite *torture_find_suite(struct torture_suite *parent,
const char *name);
+unsigned long torture_setting_ulong(struct torture_context *test,
+ const char *name,
+ unsigned long default_value);
+
NTSTATUS torture_temp_dir(struct torture_context *tctx,
const char *prefix,
char **tempdir);
bool torture_suite_init_tcase(struct torture_suite *suite,
struct torture_tcase *tcase,
const char *name);
+int torture_suite_children_count(const struct torture_suite *suite);
struct torture_context *torture_context_init(struct tevent_context *event_ctx, struct torture_results *results);