-
-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add list of failed and skipped targets to tail summary.
This expands out the failed and skipped summary tail lines to also include a sorted list of action and targets of the corresponding failed and skipped targets. This makes it easier to see them and to further search for individual ones in teh rest of the output. It also makes it possible to quickly retry specific targets. fixes #196
- Loading branch information
1 parent
0538ac4
commit 6c1a655
Showing
16 changed files
with
193 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
Copyright 2024 René Ferdinand Rivera Morell | ||
Distributed under the Boost Software License, Version 1.0. | ||
(See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt) | ||
*/ | ||
|
||
#include "mod_summary.h" | ||
|
||
#include "output.h" | ||
|
||
#include <memory> | ||
|
||
namespace b2 { | ||
|
||
void summary::group(value_ref group) | ||
{ | ||
group_order.push_back(group); | ||
groups.emplace(group, new std::vector<value_ref>); | ||
} | ||
|
||
void summary::message(value_ref group, value_ref message) | ||
{ | ||
groups[group]->push_back(message); | ||
} | ||
|
||
int summary::count(value_ref group) | ||
{ | ||
return (int)(groups[group]->size()); | ||
} | ||
|
||
void summary::print(value_ref group, value_ref format) | ||
{ | ||
std::string format_str = format; | ||
auto & g = groups[group]; | ||
std::sort(g->begin(), g->end(), [](value_ref a, value_ref b) -> bool | ||
{ | ||
return std::strcmp(a->str(), b->str()) < 0; | ||
}); | ||
for (auto const & m : *g) | ||
{ | ||
std::string m_str = m; | ||
out_printf(format->str(), m_str.c_str()); | ||
} | ||
} | ||
|
||
} // namespace b2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
Copyright 2024 René Ferdinand Rivera Morell | ||
Distributed under the Boost Software License, Version 1.0. | ||
(See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt) | ||
*/ | ||
|
||
#ifndef B2_MOD_SUMMARY_H | ||
#define B2_MOD_SUMMARY_H | ||
|
||
#include "config.h" | ||
|
||
#include "bind.h" | ||
#include "value.h" | ||
|
||
#include <unordered_map> | ||
#include <vector> | ||
|
||
namespace b2 { | ||
|
||
class summary : public object | ||
{ | ||
public: | ||
void group(value_ref group); | ||
void message(value_ref group, value_ref message); | ||
int count(value_ref group); | ||
void print(value_ref group, value_ref format); | ||
|
||
private: | ||
using group_t = std::unique_ptr<std::vector<value_ref>>; | ||
using groups_t = std::unordered_map<value_ref, | ||
group_t, | ||
value_ref::hash_function, | ||
value_ref::equal_function>; | ||
|
||
groups_t groups; | ||
std::vector<value_ref> group_order; | ||
}; | ||
|
||
struct summary_module : b2::bind::module_<summary_module> | ||
{ | ||
const char * module_name = "summary"; | ||
|
||
template <class Binder> | ||
void def(Binder & binder) | ||
{ | ||
binder.def_class("summary", type_<summary>()) | ||
.def(init_<>()) | ||
.def(&summary::group, "group", "group" * _1) | ||
.def(&summary::message, "message", "group" * _1, | ||
"message" * _1n) | ||
.def(&summary::count, "count", "group" * _1) | ||
.def(&summary::print, "print", "group" * _1, | ||
"format" * _1); | ||
} | ||
}; | ||
|
||
} // namespace b2 | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,7 @@ | |
[subtest_b] 0 | ||
[subtest_b] 1 | ||
[subtest_b] 2 | ||
...updated 2 targets... | ||
""") | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,7 @@ | |
echo [subtest_b] 1 | ||
echo [subtest_b] 2 | ||
...updated 2 targets... | ||
""") | ||
t.expect_nothing_more() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,6 +97,7 @@ | |
[.b] 0 | ||
[.b] 1 | ||
[.b] 2 | ||
...updated 8 targets... | ||
""") | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,6 +72,7 @@ | |
003 | ||
.use.2 u2.user | ||
004 | ||
...updated 4 targets... | ||
""") | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,7 @@ | |
001 - linked | ||
install installed_dll | ||
002 - installed | ||
...updated 3 targets... | ||
""") | ||
|
||
|
Oops, something went wrong.