@@ -62,6 +62,13 @@ int __ndctl_test_attempt(struct ndctl_test *test, unsigned int kver,
return 0;
}
+void __ndctl_test_skip(struct ndctl_test *test, const char *caller, int line)
+{
+ test->skip++;
+ test->attempt = test->skip;
+ fprintf(stderr, "%s: explicit skip %s:%d\n", __func__, caller, line);
+}
+
int ndctl_test_get_attempted(struct ndctl_test *test)
{
return test->attempt;
@@ -6,3 +6,5 @@ int ndctl_test_get_attempted(struct ndctl_test *test);
int __ndctl_test_attempt(struct ndctl_test *test, unsigned int kver,
const char *caller, int line);
#define ndctl_test_attempt(t, v) __ndctl_test_attempt(t, v, __func__, __LINE__)
+void __ndctl_test_skip(struct ndctl_test *test, const char *caller, int line);
+#define ndctl_test_skip(t) __ndctl_test_skip(t, __func__, __LINE__)
@@ -319,6 +319,7 @@ int test_dpa_alloc(int loglevel, struct ndctl_test *test)
NULL, NULL, NULL, NULL);
if (err < 0) {
result = 77;
+ ndctl_test_skip(test);
fprintf(stderr, "%s unavailable skipping tests\n",
NFIT_TEST_MODULE);
goto err_module;
@@ -1583,6 +1583,7 @@ int test_libndctl(int loglevel, struct ndctl_test *test)
NULL, NULL, NULL, NULL);
if (err < 0) {
result = 77;
+ ndctl_test_skip(test);
fprintf(stderr, "%s unavailable skipping tests\n",
NFIT_TEST_MODULE);
goto err_module;
@@ -249,6 +249,7 @@ int test_parent_uuid(int loglevel, struct ndctl_test *test)
NULL, NULL, NULL, NULL);
if (err < 0) {
result = 77;
+ ndctl_test_skip(test);
fprintf(stderr, "%s unavailable skipping tests\n",
NFIT_TEST_MODULE);
goto err_module;
If the kernel headers report the kernel version is capable of running the tests, but the nfit_test infrastructure is not found, don't report "PASS". Add ndctl_test_skip() as an explicit skip for reasons outside of incompatible kernel version. Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- lib/test-core.c | 7 +++++++ lib/test-core.h | 2 ++ lib/test-dpa-alloc.c | 1 + lib/test-libndctl.c | 1 + lib/test-parent-uuid.c | 1 + 5 files changed, 12 insertions(+)