From 194f7b8772e943dba98d672e738214808eb1a1a7 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 13 Jun 2021 20:30:24 +0100 Subject: Code for setting up an initial source from scratch Includes beginnings of the end-to-end test suite. --- test/Jamfile.jam | 1 + test/test-e2e.cpp | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 test/test-e2e.cpp (limited to 'test') diff --git a/test/Jamfile.jam b/test/Jamfile.jam index 685ecf9..55dcadf 100644 --- a/test/Jamfile.jam +++ b/test/Jamfile.jam @@ -18,3 +18,4 @@ run test-streams.cpp ; run test-misc.cpp ; run test-mysql.cpp : : : testdb ; run test-postgresql.cpp : -- : ../db/schema.sql : testdb ; +run test-e2e.cpp : -- : ../db/schema.sql : testdb ; diff --git a/test/test-e2e.cpp b/test/test-e2e.cpp new file mode 100644 index 0000000..fe57e17 --- /dev/null +++ b/test/test-e2e.cpp @@ -0,0 +1,22 @@ +#define BOOST_TEST_MODULE EndToEnd +#include + +#include "testdb-mysql.h" +#include "testdb-postgresql.h" +#include + +BOOST_AUTO_TEST_CASE(e2e) +{ + const char * const target_schema {"testout"}; + using namespace MyGrate::Testing; + MySQLDB my; + PqConnDB pq {ROOT "/db/schema.sql"}; + + auto pqm = pq.mock(); + + auto out = MyGrate::Output::Pq::UpdateDatabase::createNew(&pqm, MySQLDB::SERVER, MySQLDB::USER, MySQLDB::PASSWORD, + MySQLDB::PORT, my.mockname.c_str(), 100, target_schema); + BOOST_CHECK_EQUAL(out.source, 1); + auto src = out.getSource(); + BOOST_REQUIRE(src); +} -- cgit v1.2.3