summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Jamfile.jam1
-rw-r--r--test/test-e2e.cpp22
2 files changed, 23 insertions, 0 deletions
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 : : : <library>testdb ;
run test-postgresql.cpp : -- : ../db/schema.sql : <library>testdb ;
+run test-e2e.cpp : -- : ../db/schema.sql : <library>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 <boost/test/unit_test.hpp>
+
+#include "testdb-mysql.h"
+#include "testdb-postgresql.h"
+#include <output/pq/updateDatabase.h>
+
+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);
+}