Browse Source

Test: PityTest - Units return int

LIB-11
heck 4 years ago
parent
commit
87ed5be3d0
  1. 5
      test/pitytest11/src/PityUnit.hh
  2. 13
      test/pitytest11/src/PityUnit.hxx

5
test/pitytest11/src/PityUnit.hh

@ -22,7 +22,10 @@ namespace pEp {
template<class TestContext = void> template<class TestContext = void>
class PityUnit { class PityUnit {
public: public:
using TestFunction = const std::function<void(PityUnit<TestContext>&, TestContext*)>; // Test success if TestFunction:
// * does not throw
// * returns 0
using TestFunction = const std::function<int(PityUnit<TestContext>&, TestContext*)>;
enum class ExecutionMode enum class ExecutionMode
{ {
FUNCTION, FUNCTION,

13
test/pitytest11/src/PityUnit.hxx

@ -142,12 +142,6 @@ namespace pEp {
} }
} }
// template<class TestContext>
// void PityUnit<TestContext>::setExecutionMode(ExecutionMode mode)
// {
// _exec_mode = mode;
// }
// static // static
template<class TestContext> template<class TestContext>
void PityUnit<TestContext>::setGlobalRootDir(const std::string &dir) void PityUnit<TestContext>::setGlobalRootDir(const std::string &dir)
@ -166,9 +160,11 @@ namespace pEp {
void PityUnit<TestContext>::run() void PityUnit<TestContext>::run()
{ {
pEpLogClass("called"); pEpLogClass("called");
_log_mutex = std::make_shared<fs_mutex>("fds"); _log_mutex = std::make_shared<fs_mutex>("log.mutex");
_log_mutex->release(); _log_mutex->release();
setenv("HOME", processDir().c_str(), true);
if (_isRootUnit()) { if (_isRootUnit()) {
_init(); _init();
} }
@ -320,7 +316,6 @@ namespace pEp {
logH3("INIT DONE"); logH3("INIT DONE");
} }
template<class TestContext> template<class TestContext>
void PityUnit<TestContext>::_run() void PityUnit<TestContext>::_run()
{ {
@ -442,7 +437,6 @@ namespace pEp {
} }
} }
// Inherited (if null see parent recursively) // Inherited (if null see parent recursively)
template<class TestContext> template<class TestContext>
TestContext *PityUnit<TestContext>::getPerspective() const TestContext *PityUnit<TestContext>::getPerspective() const
@ -508,7 +502,6 @@ namespace pEp {
return ret; return ret;
} }
template<class TestContext> template<class TestContext>
Utils::Color PityUnit<TestContext>::_colForProcUnitNr(int procUnitNr) const Utils::Color PityUnit<TestContext>::_colForProcUnitNr(int procUnitNr) const
{ {

Loading…
Cancel
Save