diff mbox series

[i-g-t,2/9] lib/kunit: Be more verbose on errors

Message ID 20231003091044.407965-13-janusz.krzysztofik@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series Kunit fixes and improvements | expand

Commit Message

Janusz Krzysztofik Oct. 3, 2023, 9:10 a.m. UTC
Use a more verbose variant of igt_fail() when failing a dynamic sub-
subtest on kernel taint.  Also, print a debug message on string
duplication failure.

Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
---
 lib/igt_kmod.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Kamil Konieczny Oct. 5, 2023, 9:04 p.m. UTC | #1
Hi Janusz,
On 2023-10-03 at 11:10:47 +0200, Janusz Krzysztofik wrote:
> Use a more verbose variant of igt_fail() when failing a dynamic sub-
> subtest on kernel taint.  Also, print a debug message on string
> duplication failure.
> 
> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>

Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>

> ---
>  lib/igt_kmod.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
> index 05ff178b27..df0e650d49 100644
> --- a/lib/igt_kmod.c
> +++ b/lib/igt_kmod.c
> @@ -834,7 +834,7 @@ static void __igt_kunit(struct igt_ktest *tst, const char *opts)
>  			if (!pthread_tryjoin_np(modprobe_thread, NULL))
>  				igt_assert_eq(modprobe.err, 0);
>  
> -			igt_fail_on(igt_kernel_tainted(&taints));
> +			igt_assert_eq(igt_kernel_tainted(&taints), 0);
>  		}
>  
>  		free(result);
> @@ -861,7 +861,7 @@ void igt_kunit(const char *module_name, const char *name, const char *opts)
>  	 */
>  	if (!name) {
>  		name = strdup(module_name);
> -		if (name) {
> +		if (!igt_debug_on(!name)) {
>  			char *suffix = strstr(name, "_test");
>  
>  			if (!suffix)
> -- 
> 2.42.0
>
diff mbox series

Patch

diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
index 05ff178b27..df0e650d49 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -834,7 +834,7 @@  static void __igt_kunit(struct igt_ktest *tst, const char *opts)
 			if (!pthread_tryjoin_np(modprobe_thread, NULL))
 				igt_assert_eq(modprobe.err, 0);
 
-			igt_fail_on(igt_kernel_tainted(&taints));
+			igt_assert_eq(igt_kernel_tainted(&taints), 0);
 		}
 
 		free(result);
@@ -861,7 +861,7 @@  void igt_kunit(const char *module_name, const char *name, const char *opts)
 	 */
 	if (!name) {
 		name = strdup(module_name);
-		if (name) {
+		if (!igt_debug_on(!name)) {
 			char *suffix = strstr(name, "_test");
 
 			if (!suffix)