Add framework for executing tests against multiple postgresql versions using docker compose.
This commit is contained in:
parent
655c6fceb1
commit
c3bf9e88e4
13 changed files with 457 additions and 0 deletions
26
tests/pgintegration/DbTest.h
Normal file
26
tests/pgintegration/DbTest.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#pragma once
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <memory>
|
||||
#include <QString>
|
||||
|
||||
#include "Pgsql_Connection.h"
|
||||
|
||||
namespace pgtest {
|
||||
|
||||
/// Fixture giving every test its own database cloned from the template.
|
||||
class DbTest : public ::testing::Test {
|
||||
protected:
|
||||
void SetUp() override;
|
||||
void TearDown() override;
|
||||
|
||||
Pgsql::Connection& conn() { return *conn_; }
|
||||
QString dbName() const { return dbName_; }
|
||||
QString dbUrl() const;
|
||||
|
||||
private:
|
||||
QString dbName_;
|
||||
std::unique_ptr<Pgsql::Connection> conn_;
|
||||
};
|
||||
|
||||
} // namespace pgtest
|
||||
Loading…
Add table
Add a link
Reference in a new issue