test-runner: write out individual test results
PATCH 1/2 test-runner: write out individual test results
The --results option only wrote PASS/FAIL for the entire run. Instead write out each individual test result.
--- tools/run-tests | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
tools/run-tests +10 -6
@@ -37,6 +37,14 @@ def dbg(*s, **kwargs): ''' print(*s, **kwargs, file=sys.__stdout__) +def write_results(file, results): + with open(file, 'w') as f: + for test, results in results.items(): + if results.failures != 0 or results.errors != 0: + f.write('%s:FAIL\n' % test) + else: + f.write('%s:PASS\n' % test) + def exit_vm(): if config: for p in Process.get_all():
@@ -45,13 +53,9 @@ def exit_vm(): if config.ctx and config.ctx.results: success = print_results(config.ctx.results) - else: - success = False - if config.ctx.args.result: - result = 'PASS' if success else 'FAIL' - with open(config.ctx.args.result, 'w') as f: - f.write(result) + if config.ctx.args.result: + write_results(config.ctx.args.result, config.ctx.results) os.sync()
Signature · 1 line
2.34.3
PATCH 2/2 monitor: change Port ID to %u print
The port ID is a u32 so print with %u rather than %d
--- monitor/nlmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
monitor/nlmon.c +1 -1
@@ -7952,7 +7952,7 @@ static void print_nlmsghdr(const struct timeval *tv, nlmsg->nlmsg_flags);print_field ("Sequence number: %u (0x%08x)" , nlmsg->nlmsg_seq, nlmsg->nlmsg_seq); -print_field ("Port ID: %d" , nlmsg->nlmsg_pid); +print_field ("Port ID: %u" , nlmsg->nlmsg_pid); }static void print_nlmsg (const struct timeval *tv,const struct nlmsghdr *nlmsg)
Signature · 1 line
2.34.3
Hi James,
Quoted 5 lines · James Prestwood
The --results option only wrote PASS/FAIL for the entire run. Instead write out each individual test result.
--- tools/run-tests | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
Both applied, thanks.
Regards,
-Denis