Add -setup, a command line argument.

This commit is contained in:
Francis ANDRE
2018-05-19 15:04:59 +02:00
parent 8951b90bbe
commit 904b0061eb
4 changed files with 32 additions and 1 deletions

View File

@@ -9,6 +9,7 @@
#include "CppUnit/CppUnit.h"
#include <string>
#include <vector>
namespace CppUnit {
@@ -29,6 +30,11 @@ public:
virtual void run(TestResult* result) = 0;
virtual int countTestCases() = 0;
virtual std::string toString() = 0;
void addSetup(const std::vector<std::string>& setup);
protected:
std::vector<std::string> _setup;
};
@@ -57,6 +63,11 @@ inline std::string Test::toString()
}
inline void Test::addSetup(const std::vector<std::string>& setup)
{
_setup = setup;
}
} // namespace CppUnit

View File

@@ -96,6 +96,7 @@ public:
std::string toString();
virtual void setUp();
virtual void setUp(const std::vector<std::string>& setup);
virtual void tearDown();
protected:
@@ -202,6 +203,12 @@ inline void TestCase::setUp()
}
// A hook for fixture set up with command line arguments
inline void TestCase::setUp(const std::vector<std::string>& setup)
{
}
// A hook for fixture tear down
inline void TestCase::tearDown()
{