6 #ifndef KNOWROB_PROLOG_TESTS_H_
7 #define KNOWROB_PROLOG_TESTS_H_
9 #include <gtest/gtest.h>
12 #include "knowrob/reasoner/ReasonerManager.h"
13 #include "knowrob/Logger.h"
14 #include "knowrob/knowrob.h"
20 class PrologTestsBase :
public testing::Test {
23 const std::shared_ptr<knowrob::PrologReasoner> &reasoner,
27 template<
class ReasonerType,
class BackendType>
30 static std::shared_ptr<ReasonerType>
reasoner_;
31 static std::shared_ptr<KnowledgeBase>
kb_;
32 static std::shared_ptr<BackendType>
db_;
35 auto db = std::make_shared<BackendType>();
41 static std::shared_ptr<ReasonerType>
createReasoner(
const std::string &name,
const std::shared_ptr<KnowledgeBase> &kb,
const std::shared_ptr<BackendType> &db) {
42 auto r = std::make_shared<ReasonerType>();
54 }
catch (std::exception &e) {
55 FAIL() <<
"SetUpTestSuite failed: " << e.what();
69 }
catch (std::exception &e) {
70 FAIL() <<
"runTests failed: " << e.what();
74 static std::shared_ptr<ReasonerType>
reasoner() {
91 template <
class ReasonerType,
class BackendType>
94 template <
class ReasonerType,
class BackendType>
97 template <
class ReasonerType,
class BackendType>
static std::shared_ptr< KnowledgeBase > create()
static void runPrologTests(const std::shared_ptr< knowrob::PrologReasoner > &reasoner, const std::string &target)
static void runPrologTests(const std::shared_ptr< knowrob::PrologReasoner > &reasoner, const std::string &target)
static std::shared_ptr< ReasonerType > reasoner()
static void TearDownTestSuite()
static void runTests(const std::string &t)
static std::shared_ptr< BackendType > db_
static void SetUpTestSuite()
static std::shared_ptr< BackendType > createBackend(const std::string &name, const std::shared_ptr< KnowledgeBase > &kb)
static std::shared_ptr< ReasonerType > reasoner_
static std::shared_ptr< KnowledgeBase > kb_
static std::shared_ptr< ReasonerType > createReasoner(const std::string &name, const std::shared_ptr< KnowledgeBase > &kb, const std::shared_ptr< BackendType > &db)
void insertUnique(std::ostream &os)