If a process gets killed by timeout or OOM the output could end
without '\n' so add 'DURATION: N\n' after '\nERROR: ptest-dir\n'.

Signed-off-by: Aníbal Limón <anibal.li...@linaro.org>
---
 utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils.c b/utils.c
index 0813e3c..504df0b 100644
--- a/utils.c
+++ b/utils.c
@@ -382,12 +382,12 @@ run_ptests(struct ptest_list *head, const struct 
ptest_options opts,
                                                opts.timeout, fds, fps, 
&timeouted);
                                entime = time(NULL);
                                duration = entime - sttime;
-                               fprintf(fps[0], "DURATION: %d\n", duration);
 
                                if (status) {
                                        fprintf(fps[0], "\nERROR: Exit status 
is %d\n", status);
                                        rc += 1;
                                }
+                               fprintf(fps[0], "DURATION: %d\n", duration);
                                if (timeouted)
                                        fprintf(fps[0], "TIMEOUT: %s\n", 
ptest_dir);
 
-- 
2.20.1

-- 
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to