* [LTP] [PATCH] pan/ltp-pan.c: fix incorrect number of total tests
@ 2017-04-07 5:58 Xiao Yang
2017-04-10 13:50 ` Cyril Hrubis
0 siblings, 1 reply; 5+ messages in thread
From: Xiao Yang @ 2017-04-07 5:58 UTC (permalink / raw)
To: ltp
The number of total tests should indicate the number of tests
which have been run, but it indicates the number of tests defined
in command-file.
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
pan/ltp-pan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pan/ltp-pan.c b/pan/ltp-pan.c
index 1614c70..beed623 100644
--- a/pan/ltp-pan.c
+++ b/pan/ltp-pan.c
@@ -645,7 +645,7 @@ int main(int argc, char **argv)
strerror(errno));
fprintf(logfile,
"\n-----------------------------------------------\n");
- fprintf(logfile, "Total Tests: %d\n", coll->cnt);
+ fprintf(logfile, "Total Tests: %d\n", (coll->cnt - starts));
fprintf(logfile, "Total Skipped Tests: %d\n", tconfcnt);
fprintf(logfile, "Total Failures: %d\n", failcnt);
fprintf(logfile, "Kernel Version: %s\n", unamebuf.release);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [LTP] [PATCH] pan/ltp-pan.c: fix incorrect number of total tests
2017-04-07 5:58 [LTP] [PATCH] pan/ltp-pan.c: fix incorrect number of total tests Xiao Yang
@ 2017-04-10 13:50 ` Cyril Hrubis
2017-04-11 3:36 ` Xiao Yang
0 siblings, 1 reply; 5+ messages in thread
From: Cyril Hrubis @ 2017-04-10 13:50 UTC (permalink / raw)
To: ltp
Hi!
> pan/ltp-pan.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/pan/ltp-pan.c b/pan/ltp-pan.c
> index 1614c70..beed623 100644
> --- a/pan/ltp-pan.c
> +++ b/pan/ltp-pan.c
> @@ -645,7 +645,7 @@ int main(int argc, char **argv)
> strerror(errno));
> fprintf(logfile,
> "\n-----------------------------------------------\n");
> - fprintf(logfile, "Total Tests: %d\n", coll->cnt);
> + fprintf(logfile, "Total Tests: %d\n", (coll->cnt - starts));
This change does not make much sense to me. The coll->cnt is number of
tests loaded from the runtest file, right? The starts is basically
number of tests to be executed. The runltp script executes ltp-pan with
-S which means that starts is set to coll->cnt in the main() function
and so after this change it would print "Total Tests: 0" regardless.
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 5+ messages in thread
* [LTP] [PATCH] pan/ltp-pan.c: fix incorrect number of total tests
2017-04-10 13:50 ` Cyril Hrubis
@ 2017-04-11 3:36 ` Xiao Yang
2017-04-12 15:31 ` Cyril Hrubis
0 siblings, 1 reply; 5+ messages in thread
From: Xiao Yang @ 2017-04-11 3:36 UTC (permalink / raw)
To: ltp
On 2017/04/10 21:50, Cyril Hrubis wrote:
> Hi!
>> pan/ltp-pan.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/pan/ltp-pan.c b/pan/ltp-pan.c
>> index 1614c70..beed623 100644
>> --- a/pan/ltp-pan.c
>> +++ b/pan/ltp-pan.c
>> @@ -645,7 +645,7 @@ int main(int argc, char **argv)
>> strerror(errno));
>> fprintf(logfile,
>> "\n-----------------------------------------------\n");
>> - fprintf(logfile, "Total Tests: %d\n", coll->cnt);
>> + fprintf(logfile, "Total Tests: %d\n", (coll->cnt - starts));
> This change does not make much sense to me. The coll->cnt is number of
> tests loaded from the runtest file, right? The starts is basically
> number of tests to be executed. The runltp script executes ltp-pan with
> -S which means that starts is set to coll->cnt in the main() function
> and so after this change it would print "Total Tests: 0" regardless.
>
Hi Cyril
Actually, the coll->cnt is number of tests loaded from the runtest file.
However, starts is set to coll->cnt at first , and it reduces when
completing one test.
Please see the following code:
cpid =
run_child(coll->ary[c], running + i, quiet_mode,
&failcnt, fmt_print, logfile);
if (cpid != -1)
++num_active;
if ((cpid != -1 || sequential) && starts > 0)
--starts;
I think that ltp-pan could indicate the number of tests which have been
run when receiving one signal.
I am not familiar with ltp-pan code,so do you have some suggestions
about it?
Thanks,
Xiao Yang.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [LTP] [PATCH] pan/ltp-pan.c: fix incorrect number of total tests
2017-04-11 3:36 ` Xiao Yang
@ 2017-04-12 15:31 ` Cyril Hrubis
2017-04-13 2:47 ` Xiao Yang
0 siblings, 1 reply; 5+ messages in thread
From: Cyril Hrubis @ 2017-04-12 15:31 UTC (permalink / raw)
To: ltp
Hi!
> Actually, the coll->cnt is number of tests loaded from the runtest file.
> However, starts is set to coll->cnt at first , and it reduces when
> completing one test.
> Please see the following code:
> cpid =
> run_child(coll->ary[c], running + i, quiet_mode,
> &failcnt, fmt_print, logfile);
> if (cpid != -1)
> ++num_active;
> if ((cpid != -1 || sequential) && starts > 0)
> --starts;
>
> I think that ltp-pan could indicate the number of tests which have been
> run when receiving one signal.
Hmm, ok, so unless starts is set to -1, which means "execute the testrun
until interrupted" this would result in the number of executed tests, if
starts is -1 the result is incorrect anyway.
But to get it really correct we should rather add a counter and count
each started test child or something.
> I am not familiar with ltp-pan code???so do you have some suggestions
> about it?
Well the ltp-pan code is messy and the tool is in a maintenance mode,
which means that we only do bugfixes. This looks like a bug so I'm not
against fixing it but at the same time I do not think that this is
important enough. So my suggestion would be to wait for the new LTP
test runner that I started to work on some time ago and keep up with
ltp-pan.c as it is until then.
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 5+ messages in thread
* [LTP] [PATCH] pan/ltp-pan.c: fix incorrect number of total tests
2017-04-12 15:31 ` Cyril Hrubis
@ 2017-04-13 2:47 ` Xiao Yang
0 siblings, 0 replies; 5+ messages in thread
From: Xiao Yang @ 2017-04-13 2:47 UTC (permalink / raw)
To: ltp
Hi Cyril
Thanks for your explanation. :-)
Agreed. I would be to wait for the new LTP test runner.
Thanks,
Xiao Yang
On 2017/04/12 23:31, Cyril Hrubis wrote:
> Hi!
>> Actually, the coll->cnt is number of tests loaded from the runtest file.
>> However, starts is set to coll->cnt at first , and it reduces when
>> completing one test.
>> Please see the following code:
>> cpid =
>> run_child(coll->ary[c], running + i, quiet_mode,
>> &failcnt, fmt_print, logfile);
>> if (cpid != -1)
>> ++num_active;
>> if ((cpid != -1 || sequential)&& starts> 0)
>> --starts;
>>
>> I think that ltp-pan could indicate the number of tests which have been
>> run when receiving one signal.
> Hmm, ok, so unless starts is set to -1, which means "execute the testrun
> until interrupted" this would result in the number of executed tests, if
> starts is -1 the result is incorrect anyway.
>
> But to get it really correct we should rather add a counter and count
> each started test child or something.
>
>> I am not familiar with ltp-pan code???so do you have some suggestions
>> about it?
> Well the ltp-pan code is messy and the tool is in a maintenance mode,
> which means that we only do bugfixes. This looks like a bug so I'm not
> against fixing it but at the same time I do not think that this is
> important enough. So my suggestion would be to wait for the new LTP
> test runner that I started to work on some time ago and keep up with
> ltp-pan.c as it is until then.
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-04-13 2:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-07 5:58 [LTP] [PATCH] pan/ltp-pan.c: fix incorrect number of total tests Xiao Yang
2017-04-10 13:50 ` Cyril Hrubis
2017-04-11 3:36 ` Xiao Yang
2017-04-12 15:31 ` Cyril Hrubis
2017-04-13 2:47 ` Xiao Yang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.