aboutsummaryrefslogtreecommitdiff
path: root/build/diagnostics.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-07-23 09:59:52 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-07-23 09:59:52 +0200
commit3c57a25a4d6a80301ece82ab33f1394e34f8b873 (patch)
tree2ff64ebcfab74f90e81fdd2963fb653630d6d17b /build/diagnostics.cxx
parent34e5a2da18f76c7d7de79a5c12b0e85ee89c4095 (diff)
Basic test support
Diffstat (limited to 'build/diagnostics.cxx')
-rw-r--r--build/diagnostics.cxx41
1 files changed, 28 insertions, 13 deletions
diff --git a/build/diagnostics.cxx b/build/diagnostics.cxx
index f6d81bf..f12119c 100644
--- a/build/diagnostics.cxx
+++ b/build/diagnostics.cxx
@@ -128,44 +128,59 @@ namespace build
}
string
- diag_already_done (const action&, const target& t)
+ diag_done (const action&, const target& t)
{
const meta_operation_info& mi (*current_mif);
const operation_info& oi (*current_oif);
ostringstream os;
- // perform(update(x)) -> "x is already up to date"
- // configure(update(x)) -> "updating x is already configured"
+ // perform(update(x)) -> "x is up to date"
+ // configure(update(x)) -> "updating x is configured"
//
- if (mi.name_already_done.empty ())
+ if (mi.name_done.empty ())
{
os << t;
- if (!oi.name_already_done.empty ())
- os << " is already " << oi.name_already_done;
+ if (!oi.name_done.empty ())
+ os << " " << oi.name_done;
}
else
{
if (!oi.name_doing.empty ())
os << oi.name_doing << ' ';
- os << t << " is already " << mi.name_already_done;
+ os << t << " " << mi.name_done;
}
return os.str ();
}
void
- print_process (const char* const* args)
+ print_process (const char* const* args, size_t n)
{
diag_record r (text);
- for (const char* const* p (args); *p != nullptr; p++)
- r << (p != args ? " " : "")
- << (**p == '\0' ? "\"" : "") // Quote empty arguments.
- << *p
- << (**p == '\0' ? "\"" : "");
+ size_t m (0);
+ const char* const* p (args);
+ do
+ {
+ if (m != 0)
+ r << " |"; // Trailing space will be added inside the loop.
+
+ for (m++; *p != nullptr; p++, m++)
+ r << (p != args ? " " : "")
+ << (**p == '\0' ? "\"" : "") // Quote empty arguments.
+ << *p
+ << (**p == '\0' ? "\"" : "");
+
+ if (m < n) // Can we examine the next element?
+ {
+ p++;
+ m++;
+ }
+
+ } while (*p != nullptr);
}
// Trace verbosity level.