kunit/stackinit: Clean up XFAIL under instrumentation
Kees Cook
maintainerPATCH 1/1 kunit/stackinit: Clean up XFAIL under instrumentation
Commit 8530ea3c9b97 ("Kbuild: remove structleak gcc plugin") dropped the stackinit GCC plugins, so there is no longer a gradient of test coverage. Collapse the now identical USER_PASS, BYREF_PASS, STRONG_PASS into a single INSTRUMENTED_PASS definition.
Signed-off-by Kees Cook <[email protected]>
--- lib/tests/stackinit_kunit.c | 40 +++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 22 deletions(-)
lib/tests/stackinit_kunit.c +18 -22
@@ -369,17 +369,13 @@ union test_small_end {char four; }; -#define ALWAYS_PASS WANT_SUCCESS -#define ALWAYS_FAIL XFAIL +#define ALWAYS_PASS WANT_SUCCESS +#define ALWAYS_FAIL XFAIL#ifdef CONFIG_INIT_STACK_NONE -# define USER_PASS XFAIL -# define BYREF_PASS XFAIL -# define STRONG_PASS XFAIL +# define INSTRUMENTED_PASS XFAIL#else -# define USER_PASS WANT_SUCCESS -# define BYREF_PASS WANT_SUCCESS -# define STRONG_PASS WANT_SUCCESS +# define INSTRUMENTED_PASS WANT_SUCCESS#endif /*
@@ -388,7 +384,7 @@ union test_small_end {* test expectation based on CONFIG_INIT_STACK_NONE above. */ #if defined(CONFIG_CC_IS_CLANG ) &&CONFIG_CLANG_VERSION >=240000 -# define BYPASS_PASS STRONG_PASS +# define BYPASS_PASS INSTRUMENTED_PASS#else # define BYPASS_PASS XFAIL#endif
@@ -443,23 +439,23 @@ DEFINE_STRUCT_TESTS(old_zero, ALWAYS_PASS);DEFINE_UNION_TESTS (zero,ALWAYS_PASS );DEFINE_UNION_TESTS (old_zero,ALWAYS_PASS );/* Struct initializers: padding may be left uninitialized. */ -DEFINE_STRUCT_INITIALIZER_TESTS (static,STRONG_PASS ); -DEFINE_STRUCT_INITIALIZER_TESTS (dynamic,STRONG_PASS ); -DEFINE_STRUCT_INITIALIZER_TESTS (runtime,STRONG_PASS ); -DEFINE_STRUCT_INITIALIZER_TESTS (assigned_static,STRONG_PASS ); -DEFINE_STRUCT_INITIALIZER_TESTS (assigned_dynamic,STRONG_PASS ); +DEFINE_STRUCT_INITIALIZER_TESTS (static,INSTRUMENTED_PASS ); +DEFINE_STRUCT_INITIALIZER_TESTS (dynamic,INSTRUMENTED_PASS ); +DEFINE_STRUCT_INITIALIZER_TESTS (runtime,INSTRUMENTED_PASS ); +DEFINE_STRUCT_INITIALIZER_TESTS (assigned_static,INSTRUMENTED_PASS ); +DEFINE_STRUCT_INITIALIZER_TESTS (assigned_dynamic,INSTRUMENTED_PASS );DEFINE_STRUCT_TESTS (assigned_copy,ALWAYS_FAIL ); -DEFINE_UNION_INITIALIZER_TESTS (static,STRONG_PASS ); -DEFINE_UNION_INITIALIZER_TESTS (dynamic,STRONG_PASS ); -DEFINE_UNION_INITIALIZER_TESTS (runtime,STRONG_PASS ); -DEFINE_UNION_INITIALIZER_TESTS (assigned_static,STRONG_PASS ); -DEFINE_UNION_INITIALIZER_TESTS (assigned_dynamic,STRONG_PASS ); +DEFINE_UNION_INITIALIZER_TESTS (static,INSTRUMENTED_PASS ); +DEFINE_UNION_INITIALIZER_TESTS (dynamic,INSTRUMENTED_PASS ); +DEFINE_UNION_INITIALIZER_TESTS (runtime,INSTRUMENTED_PASS ); +DEFINE_UNION_INITIALIZER_TESTS (assigned_static,INSTRUMENTED_PASS ); +DEFINE_UNION_INITIALIZER_TESTS (assigned_dynamic,INSTRUMENTED_PASS );DEFINE_UNION_TESTS (assigned_copy,ALWAYS_FAIL );/* No initialization without compiler instrumentation. */ -DEFINE_SCALAR_TESTS (none,STRONG_PASS ); -DEFINE_STRUCT_TESTS (none,BYREF_PASS ); +DEFINE_SCALAR_TESTS (none,INSTRUMENTED_PASS ); +DEFINE_STRUCT_TESTS (none,INSTRUMENTED_PASS );/* Initialization of members with __user attribute. */ -DEFINE_TEST(user, struct test_user, STRUCT, none, USER_PASS); +DEFINE_TEST(user, struct test_user, STRUCT, none, INSTRUMENTED_PASS);/* * Check two uses through a variable declaration outside either path,
Signature · 1 line
2.55.0