aboutsummaryrefslogtreecommitdiff
path: root/build2
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-11-17 01:52:51 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-11-17 12:03:36 +0300
commit83005f5c8de788f3b2fec9b186a766814004895d (patch)
tree0ecef30660bee50827bce49a87e003475e9dba0c /build2
parent35e4dda6c64716bc04627d7544ccb3ee9a07616e (diff)
Print id of failed test
Diffstat (limited to 'build2')
-rw-r--r--build2/test/script/runner.cxx30
-rw-r--r--build2/test/script/runner.hxx2
2 files changed, 30 insertions, 2 deletions
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 <build2/variable.hxx>
#include <build2/filesystem.hxx>
+#include <build2/diagnostics.hxx>
#include <build2/test/common.hxx>
@@ -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 <build2/types.hxx>
#include <build2/utility.hxx>
-#include <build2/diagnostics.hxx> // location
-
#include <build2/test/script/script.hxx>
namespace build2