[PATCH mptcp-next] Squash to "selftests: mptcp: print test results with colors"

Geliang Tang posted 1 patch 1 month, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/6f47bafed58fcc6fd3236b12134b23ff012d5643.1709791100.git.tanggeliang@kylinos.cn
tools/testing/selftests/net/mptcp/userspace_pm.sh | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH mptcp-next] Squash to "selftests: mptcp: print test results with colors"
Posted by Geliang Tang 1 month, 3 weeks ago
From: Geliang Tang <tanggeliang@kylinos.cn>

_printf is dropped now, use mptcp_lib_pr_fail instead.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
 tools/testing/selftests/net/mptcp/userspace_pm.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh
index 9fc9e574bc27..30652a1c548b 100755
--- a/tools/testing/selftests/net/mptcp/userspace_pm.sh
+++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh
@@ -242,8 +242,7 @@ check_expected_one()
 		test_fail
 	fi
 
-	_printf "\tExpected value for '%s': '%s', got '%s'.\n" \
-		"${var}" "${!exp}" "${!var}"
+	mptcp_lib_pr_fail "Expected value for '${var}': '${!exp}', got '${!var}'."
 	return 1
 }
 
-- 
2.40.1
Re: [PATCH mptcp-next] Squash to "selftests: mptcp: print test results with colors"
Posted by Matthieu Baerts 1 month, 3 weeks ago
Hi Geliang,

On 07/03/2024 06:58, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> _printf is dropped now, use mptcp_lib_pr_fail instead.

Good catch.

> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> ---
>  tools/testing/selftests/net/mptcp/userspace_pm.sh | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh
> index 9fc9e574bc27..30652a1c548b 100755
> --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh
> +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh
> @@ -242,8 +242,7 @@ check_expected_one()
>  		test_fail
>  	fi
>  
> -	_printf "\tExpected value for '%s': '%s', got '%s'.\n" \
> -		"${var}" "${!exp}" "${!var}"
> +	mptcp_lib_pr_fail "Expected value for '${var}': '${!exp}', got '${!var}'."

Maybe best to use 'mptcp_lib_print_err()' instead?
Because a "[FAIL]" will already be printed via test_fail() called just
above.

I will apply this patch with mptcp_lib_print_err instead. Please tell me
if it's not OK.

>  	return 1
>  }
>  

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.
Re: [PATCH mptcp-next] Squash to "selftests: mptcp: print test results with colors"
Posted by Geliang Tang 1 month, 3 weeks ago
Hi Matt,

On Thu, Mar 07, 2024 at 10:35:43AM +0100, Matthieu Baerts wrote:
> Hi Geliang,
> 
> On 07/03/2024 06:58, Geliang Tang wrote:
> > From: Geliang Tang <tanggeliang@kylinos.cn>
> > 
> > _printf is dropped now, use mptcp_lib_pr_fail instead.
> 
> Good catch.
> 
> > Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> > ---
> >  tools/testing/selftests/net/mptcp/userspace_pm.sh | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh
> > index 9fc9e574bc27..30652a1c548b 100755
> > --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh
> > +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh
> > @@ -242,8 +242,7 @@ check_expected_one()
> >  		test_fail
> >  	fi
> >  
> > -	_printf "\tExpected value for '%s': '%s', got '%s'.\n" \
> > -		"${var}" "${!exp}" "${!var}"
> > +	mptcp_lib_pr_fail "Expected value for '${var}': '${!exp}', got '${!var}'."
> 
> Maybe best to use 'mptcp_lib_print_err()' instead?
> Because a "[FAIL]" will already be printed via test_fail() called just
> above.
> 
> I will apply this patch with mptcp_lib_print_err instead. Please tell me
> if it's not OK.

Yes, mptcp_lib_print_err is much better.

Thanks,
-Geliang

> 
> >  	return 1
> >  }
> >  
> 
> Cheers,
> Matt
> -- 
> Sponsored by the NGI0 Core fund.