summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-06-13 20:30:24 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2021-06-13 20:30:24 +0100
commit194f7b8772e943dba98d672e738214808eb1a1a7 (patch)
treeefa8d2f4e79d14e1745fae586d72cea8df68048c /test
parentAdd missing dep on schema file (diff)
downloadmygrate-194f7b8772e943dba98d672e738214808eb1a1a7.tar.bz2
mygrate-194f7b8772e943dba98d672e738214808eb1a1a7.tar.xz
mygrate-194f7b8772e943dba98d672e738214808eb1a1a7.zip
Code for setting up an initial source from scratch
Includes beginnings of the end-to-end test suite.
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);
+}