From 83005f5c8de788f3b2fec9b186a766814004895d Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 17 Nov 2018 01:52:51 +0300 Subject: Print id of failed test --- build2/test/script/runner.cxx | 30 ++++++++++++++++++++++++++++++ build2/test/script/runner.hxx | 2 -- 2 files changed, 30 insertions(+), 2 deletions(-) (limited to 'build2') diff --git a/build2/test/script/runner.cxx b/build2/test/script/runner.cxx index 958927e..2e37f3a 100644 --- a/build2/test/script/runner.cxx +++ b/build2/test/script/runner.cxx @@ -12,6 +12,7 @@ #include #include +#include #include @@ -697,6 +698,15 @@ namespace build2 void default_runner:: enter (scope& sp, const location&) { + auto df = make_diag_frame ( + [&sp](const diag_record& dr) + { + // Let's not depend on how the path representation can be improved + // for readability on printing. + // + dr << info << "test id: " << sp.id_path.posix_string (); + }); + // Scope working directory shall be empty (the script working // directory is cleaned up by the test rule prior the script // execution). @@ -729,6 +739,15 @@ namespace build2 void default_runner:: leave (scope& sp, const location& ll) { + auto df = make_diag_frame ( + [&sp](const diag_record& dr) + { + // Let's not depend on how the path representation can be improved + // for readability on printing. + // + dr << info << "test id: " << sp.id_path.posix_string (); + }); + // Perform registered cleanups if requested. // if (common_.after == output_after::clean) @@ -1761,6 +1780,17 @@ namespace build2 size_t li, const location& ll, bool diag) { + // Print test id once per test expression. + // + auto df = make_diag_frame ( + [&sp](const diag_record& dr) + { + // Let's not depend on how the path representation can be improved + // for readability on printing. + // + dr << info << "test id: " << sp.id_path.posix_string (); + }); + // Commands are numbered sequentially throughout the expression // starting with 1. Number 0 means the command is a single one. // diff --git a/build2/test/script/runner.hxx b/build2/test/script/runner.hxx index 17b4de1..77c751a 100644 --- a/build2/test/script/runner.hxx +++ b/build2/test/script/runner.hxx @@ -8,8 +8,6 @@ #include #include -#include // location - #include namespace build2 -- cgit v1.1