[yocto] [PATCH][ptest-runner 2/2] utils.c: Print DURATION after ERROR

Aníbal Limón anibal.limon at linaro.org
Wed Jan 30 09:07:37 PST 2019


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.limon at 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



More information about the yocto mailing list