Browse Source

Test: PityTest - processUnit term colors

LIB-11
heck 4 years ago
parent
commit
d8302d9437
  1. 7
      test/pitytest11/src/PityUnit.hh
  2. 11
      test/pitytest11/src/PityUnit.hxx

7
test/pitytest11/src/PityUnit.hh

@ -98,8 +98,8 @@ namespace pEp {
void _createTransport(); void _createTransport();
// Query // Query
bool _isProcessUnit() const; bool _isProcessUnit() const; // true if it forks
bool _isRootUnit() const; bool _isRootUnit() const; // true if has no parent
std::string _rootUnitDir(); std::string _rootUnitDir();
@ -119,10 +119,11 @@ namespace pEp {
static std::string _global_root_dir; static std::string _global_root_dir;
std::map<const std::string, PityUnit<TestContext>&> _children; // map to guarantee uniqueness of sibling-names std::map<const std::string, PityUnit<TestContext>&> _children; // map to guarantee uniqueness of sibling-names
int procUnitNr; int procUnitNr;
static int procUnitsCount; // will be increased in everuy constructor static int procUnitsCount; // will be increased in every constructor
std::shared_ptr<PityTransport> _transport; //only ever read via transport() std::shared_ptr<PityTransport> _transport; //only ever read via transport()
Endpoints _transport_endpoints; // only ever access via transportEndpoints() Endpoints _transport_endpoints; // only ever access via transportEndpoints()
// fs-mutex to sync across processes
std::shared_ptr<fs_mutex> _log_mutex = nullptr; std::shared_ptr<fs_mutex> _log_mutex = nullptr;
// internal logging // internal logging
Adapter::pEpLog::pEpLogger& m4gic_logger_n4me = logger_debug; Adapter::pEpLog::pEpLogger& m4gic_logger_n4me = logger_debug;

11
test/pitytest11/src/PityUnit.hxx

@ -517,15 +517,15 @@ namespace pEp {
case 0: case 0:
return Utils::Color::WHITE; return Utils::Color::WHITE;
case 1: case 1:
return Utils::Color::CYAN; return Utils::Color::GREEN;
case 2: case 2:
return Utils::Color::MAGENTA; return Utils::Color::YELLOW;
case 3: case 3:
return Utils::Color::BLUE; return Utils::Color::CYAN;
case 4: case 4:
return Utils::Color::GREEN; return Utils::Color::BLUE;
case 5: case 5:
return Utils::Color::YELLOW; return Utils::Color::MAGENTA;
case 6: case 6:
return Utils::Color::RED; return Utils::Color::RED;
default: default:
@ -542,6 +542,7 @@ namespace pEp {
template<class TestContext> template<class TestContext>
void PityUnit<TestContext>::_logRaw(const std::string &msg) const void PityUnit<TestContext>::_logRaw(const std::string &msg) const
{ {
// fs-mutex to sync across processes
_log_mutex->aquire(); _log_mutex->aquire();
Adapter::pEpLog::log(msg, _termColor()); Adapter::pEpLog::log(msg, _termColor());
_log_mutex->release(); _log_mutex->release();

Loading…
Cancel
Save