lib: framework: add in test name before test description

Submitted by Colin King on March 5, 2013, 9 p.m.

Details

Message ID 1362517206-18862-1-git-send-email-colin.king@canonical.com
State Accepted
Headers show

Commit Message

Colin King March 5, 2013, 9 p.m.
From: Colin Ian King <colin.king@canonical.com>

As suggested by John Brier, it makes sense to include the name
of the test, so lets prefix that before the test description.
This allows users to find the test results in the output log
by just looking for the test name.

An example of the output goes from:

Gather BIOS DMI information.

to:

bios_info: Gather BIOS DMI information.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/lib/src/fwts_framework.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Keng-Yu Lin March 7, 2013, 7:26 a.m.
On Wed, Mar 6, 2013 at 5:00 AM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> As suggested by John Brier, it makes sense to include the name
> of the test, so lets prefix that before the test description.
> This allows users to find the test results in the output log
> by just looking for the test name.
>
> An example of the output goes from:
>
> Gather BIOS DMI information.
>
> to:
>
> bios_info: Gather BIOS DMI information.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/lib/src/fwts_framework.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c
> index 25ccc41..57079e6 100644
> --- a/src/lib/src/fwts_framework.c
> +++ b/src/lib/src/fwts_framework.c
> @@ -496,7 +496,7 @@ static int fwts_framework_run_test(fwts_framework *fw, fwts_framework_test *test
>                 fw->print_summary = true;
>
>         if (test->ops->description) {
> -               fwts_log_heading(fw, "%s", test->ops->description);
> +               fwts_log_heading(fw, "%s: %s", test->name, test->ops->description);
>                 fwts_framework_underline(fw,'-');
>                 if (fw->show_progress) {
>                         char buf[70];
> --
> 1.8.1.2
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Ivan Hu March 7, 2013, 7:40 a.m.
On 03/06/2013 05:00 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> As suggested by John Brier, it makes sense to include the name
> of the test, so lets prefix that before the test description.
> This allows users to find the test results in the output log
> by just looking for the test name.
>
> An example of the output goes from:
>
> Gather BIOS DMI information.
>
> to:
>
> bios_info: Gather BIOS DMI information.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/lib/src/fwts_framework.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c
> index 25ccc41..57079e6 100644
> --- a/src/lib/src/fwts_framework.c
> +++ b/src/lib/src/fwts_framework.c
> @@ -496,7 +496,7 @@ static int fwts_framework_run_test(fwts_framework *fw, fwts_framework_test *test
>   		fw->print_summary = true;
>
>   	if (test->os->description) {
> -		fwts_log_heading(fw, "%s", test->ops->description);
> +		fwts_log_heading(fw, "%s: %s", test->name, test->ops->description);
>   		fwts_framework_underline(fw,'-');
>   		if (fw->show_progress) {
>   			char buf[70];
>


Acked-by: Ivan Hu <ivan.hu@canonical.com>

Patch hide | download patch | download mbox

diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c
index 25ccc41..57079e6 100644
--- a/src/lib/src/fwts_framework.c
+++ b/src/lib/src/fwts_framework.c
@@ -496,7 +496,7 @@  static int fwts_framework_run_test(fwts_framework *fw, fwts_framework_test *test
 		fw->print_summary = true;
 
 	if (test->ops->description) {
-		fwts_log_heading(fw, "%s", test->ops->description);
+		fwts_log_heading(fw, "%s: %s", test->name, test->ops->description);
 		fwts_framework_underline(fw,'-');
 		if (fw->show_progress) {
 			char buf[70];