Add TestContext::runPart2 for tests that are only valid for part 2 of a puzzle
This commit is contained in:
parent
ce77b2354c
commit
f3682a46a9
|
@ -26,6 +26,8 @@ class TestContext
|
||||||
public:
|
public:
|
||||||
void run(const std::unique_ptr<Solver>&& solver, const long long int expected1, const long long int expected2,
|
void run(const std::unique_ptr<Solver>&& solver, const long long int expected1, const long long int expected2,
|
||||||
const std::vector<std::string>& inputPaths);
|
const std::vector<std::string>& inputPaths);
|
||||||
|
void runPart2(const std::unique_ptr<Solver>&& solver, const long long int expected,
|
||||||
|
const std::vector<std::string>& inputPaths);
|
||||||
std::vector<std::string> getInputPaths() const;
|
std::vector<std::string> getInputPaths() const;
|
||||||
std::vector<std::string> getExampleInputPaths() const;
|
std::vector<std::string> getExampleInputPaths() const;
|
||||||
};
|
};
|
||||||
|
|
|
@ -29,6 +29,15 @@ void TestContext::run(const std::unique_ptr<Solver>&& solver, const long long in
|
||||||
REQUIRE(expected2 == solver->getResultPart2());
|
REQUIRE(expected2 == solver->getResultPart2());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TestContext::runPart2(const std::unique_ptr<Solver>&& solver, const long long int expected,
|
||||||
|
const std::vector<std::string>& inputPaths)
|
||||||
|
{
|
||||||
|
SolverEngine solverEngine{ inputPaths };
|
||||||
|
solverEngine.run(*solver);
|
||||||
|
|
||||||
|
REQUIRE(expected == solver->getResultPart2());
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<std::string> TestContext::getInputPaths() const
|
std::vector<std::string> TestContext::getInputPaths() const
|
||||||
{
|
{
|
||||||
return std::vector<std::string>{ "data", "../../../data", "../../../../data" };
|
return std::vector<std::string>{ "data", "../../../data", "../../../../data" };
|
||||||
|
|
Loading…
Reference in New Issue