Sectioning unit tests for meaningful error messages.

This commit is contained in:
Patrick Lühne 2017-06-17 17:07:09 +02:00
parent c84cafda18
commit de69003105
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF

View File

@ -26,11 +26,17 @@ TEST_CASE("[PDDL parser acceptance] All official PDDL domains are parsed without
const auto domainFile = domainDirectory / "domain.pddl"; const auto domainFile = domainDirectory / "domain.pddl";
pddl::Tokenizer tokenizer; const auto testSectionName = competitionDirectory.path().stem().string() + ", "
tokenizer.read(domainFile); + domainDirectory.path().stem().string();
pddl::Context context(std::move(tokenizer), ignoreWarnings);
CHECK_NOTHROW(pddl::parseDescription(context)); SECTION("domain [" + testSectionName + "]")
{
pddl::Tokenizer tokenizer;
tokenizer.read(domainFile);
pddl::Context context(std::move(tokenizer), ignoreWarnings);
CHECK_NOTHROW(pddl::parseDescription(context));
}
} }
} }
} }
@ -52,12 +58,19 @@ TEST_CASE("[PDDL parser acceptance] The first instance for all official PDDL dom
const auto domainFile = domainDirectory / "domain.pddl"; const auto domainFile = domainDirectory / "domain.pddl";
const auto instanceFile = domainDirectory / "instances" / "instance-1.pddl"; const auto instanceFile = domainDirectory / "instances" / "instance-1.pddl";
pddl::Tokenizer tokenizer; const auto testSectionName = competitionDirectory.path().stem().string() + ", "
tokenizer.read(domainFile); + domainDirectory.path().stem().string() + ", "
tokenizer.read(instanceFile); + instanceFile.stem().string();
pddl::Context context(std::move(tokenizer), ignoreWarnings);
CHECK_NOTHROW(pddl::parseDescription(context)); SECTION("instance [" + testSectionName + "]")
{
pddl::Tokenizer tokenizer;
tokenizer.read(domainFile);
tokenizer.read(instanceFile);
pddl::Context context(std::move(tokenizer), ignoreWarnings);
CHECK_NOTHROW(pddl::parseDescription(context));
}
} }
} }
} }