mirror of
https://github.com/latentPrion/cppbessot.git
synced 2026-06-23 23:28:36 +00:00
Add tests db DB_TARGET for tests
This commit is contained in:
@@ -40,13 +40,13 @@ endfunction()
|
||||
cppbessot_add_odb_orm_test(
|
||||
"sqlite"
|
||||
"sqlite"
|
||||
CPPBESSOT_ODB_TEST_SQLITE_CONNSTR
|
||||
CPPBESSOT_DB_SQLITE_PRODDEV_PATH
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/sqlite_orm_test.cpp"
|
||||
cppbessot::odb_sqlite)
|
||||
|
||||
cppbessot_add_odb_orm_test(
|
||||
"pgsql"
|
||||
"pgsql"
|
||||
CPPBESSOT_ODB_TEST_PGSQL_CONNSTR
|
||||
CPPBESSOT_DB_PGSQL_PRODDEV_CONNSTR
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/pgsql_orm_test.cpp"
|
||||
cppbessot::odb_pgsql)
|
||||
|
||||
@@ -54,8 +54,8 @@ void apply_pgsql_ddl(const std::string& connstr)
|
||||
TEST(PgsqlOdbOrm, PersistsLoadsQueriesAndErases)
|
||||
{
|
||||
const std::string connstr = cppbessot_env_or_default(
|
||||
"CPPBESSOT_ODB_TEST_PGSQL_CONNSTR",
|
||||
CPPBESSOT_ODB_TEST_PGSQL_CONNSTR_DEFAULT);
|
||||
"CPPBESSOT_DB_PGSQL_PRODDEV_CONNSTR",
|
||||
CPPBESSOT_DB_PGSQL_PRODDEV_CONNSTR_DEFAULT);
|
||||
apply_pgsql_ddl(connstr);
|
||||
odb::pgsql::database db(connstr);
|
||||
cppbessot_run_agent_orm_roundtrip<odb::pgsql::database, odb::pgsql::transaction>(db);
|
||||
|
||||
@@ -43,8 +43,8 @@ void apply_sqlite_ddl(const std::string& connstr)
|
||||
TEST(SqliteOdbOrm, PersistsLoadsQueriesAndErases)
|
||||
{
|
||||
const std::string connstr = cppbessot_env_or_default(
|
||||
"CPPBESSOT_ODB_TEST_SQLITE_CONNSTR",
|
||||
CPPBESSOT_ODB_TEST_SQLITE_CONNSTR_DEFAULT);
|
||||
"CPPBESSOT_DB_SQLITE_PRODDEV_PATH",
|
||||
CPPBESSOT_DB_SQLITE_PRODDEV_PATH_DEFAULT);
|
||||
std::filesystem::remove(connstr);
|
||||
apply_sqlite_ddl(connstr);
|
||||
odb::sqlite::database db(connstr, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE);
|
||||
|
||||
Reference in New Issue
Block a user