Add tests db DB_TARGET for tests

This commit is contained in:
2026-05-01 03:12:01 -04:00
parent c34b959b36
commit 254b7462ba
20 changed files with 182 additions and 66 deletions
+2 -2
View File
@@ -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)
+2 -2
View File
@@ -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);
+2 -2
View File
@@ -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);