From 53fc926dc847af55a13a6ac9ea852658b0b0ba4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Tue, 12 Dec 2017 23:23:18 +0100 Subject: Only run the unit tests with postgresql if TEST_POSTGRES_URI env var is set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Even if we built with postgresql’s support --- tests/database.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/database.cpp b/tests/database.cpp index 20a446b..7ab6da8 100644 --- a/tests/database.cpp +++ b/tests/database.cpp @@ -16,13 +16,10 @@ TEST_CASE("Database") std::string postgresql_uri{"postgresql://"}; const char* env_value = ::getenv("TEST_POSTGRES_URI"); if (env_value != nullptr) - postgresql_uri += env_value; + Database::open("postgresql://"s + env_value); else - postgresql_uri += "/test"; - Database::open(postgresql_uri); -#else - Database::open(":memory:"); #endif + Database::open(":memory:"); Database::raw_exec("DELETE FROM " + Database::irc_server_options.get_name()); Database::raw_exec("DELETE FROM " + Database::irc_channel_options.get_name()); @@ -121,5 +118,5 @@ TEST_CASE("Database") } Database::close(); -#endif } +#endif -- cgit v1.2.3