Browse Source

Test: PityTest - update tests

master
heck 4 years ago
parent
commit
e57d1c6b61
  1. 3
      test/test_linear.cc
  2. 22
      test/test_processdirs.cc

3
test/test_linear.cc

@ -6,9 +6,10 @@ using namespace std;
using namespace pEp; using namespace pEp;
using namespace pEp::PityTest11; using namespace pEp::PityTest11;
// eeks_test // eeks-test
// The test framework for geeks without the g // The test framework for geeks without the g
class Car { class Car {
private: private:
int gear_nr = 0; int gear_nr = 0;

22
test/test_processdirs.cc

@ -14,7 +14,7 @@ void printHomeDir(TestUnit& myself)
{ {
// TESTLOG(string(myself.getFQName() + " - PID: " + to_string(getpid()))); // TESTLOG(string(myself.getFQName() + " - PID: " + to_string(getpid())));
// cout << "[" << to_string(getpid()) << "/" << myself.getFQName() << "] - " << endl; // cout << "[" << to_string(getpid()) << "/" << myself.getFQName() << "] - " << endl;
setenv("HOME", myself.processDir().c_str(), 1); setenv("HOME", myself.getProcessDir().c_str(), 1);
myself.log("HOME=" + string(getenv("HOME"))); myself.log("HOME=" + string(getenv("HOME")));
} }
@ -29,11 +29,11 @@ int main(int argc, char* argv[])
.addNew<TestUnit>( .addNew<TestUnit>(
"node 1", "node 1",
[](TestUnit& pity, TestContext* ctx) { [](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.processDir() == "./pitytest_data/test_processdirs/", "node 1"); PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/", "node 1");
return 0; return 0;
}) })
.addNew<TestUnit>("node 1.1", [](TestUnit& pity, TestContext* ctx) { .addNew<TestUnit>("node 1.1", [](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.processDir() == "./pitytest_data/test_processdirs/", "node 1.1"); PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/", "node 1.1");
return 0; return 0;
}); });
@ -42,19 +42,19 @@ int main(int argc, char* argv[])
.addNew<TestUnit>( .addNew<TestUnit>(
"node 2", "node 2",
[](TestUnit& pity, TestContext* ctx) { [](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.processDir() == "./pitytest_data/test_processdirs/", "node 2"); PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/", "node 2");
return 0; return 0;
}) })
.addNew<TestUnit>( .addNew<TestUnit>(
"node 2.1", "node 2.1",
[](TestUnit& pity, TestContext* ctx) { [](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.processDir() == "./pitytest_data/test_processdirs/node_2_1/", ""); PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/node_2_1/", "");
return 0; return 0;
}, },
nullptr, nullptr,
PityUnit<>::ExecutionMode::PROCESS_PARALLEL) PityUnit<>::ExecutionMode::PROCESS_PARALLEL)
.addNew<TestUnit>("node 2.1.1", [](TestUnit& pity, TestContext* ctx) { .addNew<TestUnit>("node 2.1.1", [](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.processDir() == "./pitytest_data/test_processdirs/node_2_1/", ""); PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/node_2_1/", "");
return 0; return 0;
}); });
@ -64,7 +64,7 @@ int main(int argc, char* argv[])
.addNew<TestUnit>( .addNew<TestUnit>(
"node 3", "node 3",
[](TestUnit& pity, TestContext* ctx) { [](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.processDir() == "./pitytest_data/test_processdirs/node_3/", ""); PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/node_3/", "");
return 0; return 0;
}, },
nullptr, nullptr,
@ -72,25 +72,25 @@ int main(int argc, char* argv[])
.addNew<TestUnit>( .addNew<TestUnit>(
"node 3.1", "node 3.1",
[](TestUnit& pity, TestContext* ctx) { [](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.processDir() == "./pitytest_data/test_processdirs/node_3/", ""); PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/node_3/", "");
return 0; return 0;
}) })
.addNew<TestUnit>( .addNew<TestUnit>(
"node 3.1.1", "node 3.1.1",
[](TestUnit& pity, TestContext* ctx) { [](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.processDir() == "./pitytest_data/test_processdirs/node_3/", ""); PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/node_3/", "");
return 0; return 0;
}) })
.addNew<TestUnit>( .addNew<TestUnit>(
"node 3.1.1", "node 3.1.1",
[](TestUnit& pity, TestContext* ctx) { [](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.processDir() == "./pitytest_data/test_processdirs/node_3_1_1/", ""); PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/node_3_1_1/", "");
return 0; return 0;
}, },
nullptr, nullptr,
PityUnit<>::ExecutionMode::PROCESS_PARALLEL) PityUnit<>::ExecutionMode::PROCESS_PARALLEL)
.addNew<TestUnit>("node 3.1.1.1", [](TestUnit& pity, TestContext* ctx) { .addNew<TestUnit>("node 3.1.1.1", [](TestUnit& pity, TestContext* ctx) {
PITYASSERT(pity.processDir() == "./pitytest_data/test_processdirs/node_3_1_1/", ""); PITYASSERT(pity.getProcessDir() == "./pitytest_data/test_processdirs/node_3_1_1/", "");
return 0; return 0;
}); });

Loading…
Cancel
Save