Taken from upstream. From b0cd77e588620465b78f7c017d3f240e13936aa3 Mon Sep 17 00:00:00 2001 From: Pavlo Solntsev Date: Sun, 19 Sep 2021 22:51:38 -0500 Subject: [PATCH] Test: Skip test if no server available Two variables will be checked. If they set and provide all needed information the test will be executed. If they are not set, the test will return TRUE and will terminate with termination status EXIT_SUCCESS. --- tests/db/check-db-catalog-postgresql.c | 16 ++++++++++++++++ tests/test-server-operation-postgresql.c | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/tests/db/check-db-catalog-postgresql.c b/tests/db/check-db-catalog-postgresql.c index 5b8e9395c..bf9a8942c 100644 --- a/tests/db/check-db-catalog-postgresql.c +++ b/tests/db/check-db-catalog-postgresql.c @@ -25,6 +25,9 @@ #include #include "../test-cnc-utils.h" +#define PROVIDER_DB_CREATE_PARAMS "POSTGRESQL_DBCREATE_PARAMS" +#define PROVIDER_CNC_PARAMS "POSTGRESQL_CNC_PARAMS" + typedef struct { GdaDbCatalog *catalog; GdaConnection *cnc; @@ -359,6 +362,19 @@ main (gint argc, { setlocale (LC_ALL,""); + const gchar *db_create_str; + const gchar *cnc_params; + + db_create_str = g_getenv (PROVIDER_DB_CREATE_PARAMS); + cnc_params = g_getenv (PROVIDER_CNC_PARAMS); + + if (!db_create_str || !cnc_params) { + g_print ("Please set POSTGRESQL_DBCREATE_PARAMS and POSTGRESQL_CNC_PARAMS variable" + "with dbname, host, user and port (usually 5432)\n"); + g_print ("Test will not be performed\n"); + return EXIT_SUCCESS; + } + g_test_init (&argc,&argv,NULL); g_test_add ("/test-db-postgresql/meta-tables", diff --git a/tests/test-server-operation-postgresql.c b/tests/test-server-operation-postgresql.c index 37796c4be..860f41a18 100644 --- a/tests/test-server-operation-postgresql.c +++ b/tests/test-server-operation-postgresql.c @@ -38,9 +38,12 @@ #include #include #include +/*#include */ #include "test-cnc-utils.h" #define PROVIDER_NAME "PostgreSQL" +#define PROVIDER_DB_CREATE_PARAMS "POSTGRESQL_DBCREATE_PARAMS" +#define PROVIDER_CNC_PARAMS "POSTGRESQL_CNC_PARAMS" #define GDA_PGSQL_ERROR_HANDLE(e) (g_print("Error: %s: %s\n", G_STRLOC, e && e->message ? e->message : "No default")); @@ -1335,6 +1338,19 @@ main(gint argc, gchar *argv[]) { setlocale (LC_ALL,""); + const gchar *db_create_str; + const gchar *cnc_params; + + db_create_str = g_getenv (PROVIDER_DB_CREATE_PARAMS); + cnc_params = g_getenv (PROVIDER_CNC_PARAMS); + + if (!db_create_str || !cnc_params) { + g_print ("Please set POSTGRESQL_DBCREATE_PARAMS and POSTGRESQL_CNC_PARAMS variable" + "with dbname, host, user and port (usually 5432)\n"); + g_print ("Test will not be performed\n"); + return EXIT_SUCCESS; + } + g_test_init (&argc,&argv,NULL); g_test_add ("/test-server-operation-sqlite/old-so-module", -- GitLab /span>Nikolay Korotkiy via Guix-patches via 2022-01-20gnu: gama: Update to 2.17....* gnu/packages/gps.scm (gama): Update to 2.17. Efraim Flashner 2021-12-13gnu: Simplify package inputs....This commit was obtained by running: ./pre-inst-env guix style without any additional argument. Ludovic Courtès 2021-12-10Merge remote-tracking branch 'signed/master' into core-updatesMathieu Othacehe 2021-12-10gnu: gpxsee: Update to 10.0....* gnu/packages/gps.scm (gpxsee): Update to 10.0. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Nikolay Korotkiy 2021-10-12Merge remote-tracking branch 'origin/master' into core-updates-frozen.Mathieu Othacehe 2021-10-04gnu: gpsd: Update to 3.23.1....* gnu/packages/gps.scm (gpsd): Update to 3.23.1. [arguments]: Don't explicitly return #t from phases. Tobias Geerinckx-Rice 2021-09-25gnu: Consolidate duplicate copyright names....* gnu/packages/android.scm: Consolidate copyright lines with the same email address. * gnu/packages/code.scm: Likewise. * gnu/packages/cpp.scm: Likewise. * gnu/packages/databases.scm: Likewise. * gnu/packages/emacs-xyz.scm: Likewise. * gnu/packages/file.scm: Likewise. * gnu/packages/freedesktop.scm: Likewise. * gnu/packages/gl.scm: Likewise. * gnu/packages/gps.scm: Likewise. * gnu/packages/linux.scm: Likewise. * gnu/packages/networking.scm: Likewise. * gnu/packages/python-xyz.scm: Likewise. * gnu/packages/python.scm: Likewise. * gnu/packages/video.scm: Likewise. * gnu/packages/xdisorg.scm: Likewise. * gnu/services/web.scm: Likewise. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Greg Hogan 2021-09-22gnu: gama: Update to 2.15....* gnu/packages/gps.scm (gama): Update to 2.15. Efraim Flashner 2021-08-12Merge branch 'master' into core-updates-frozen... Conflicts: gnu/packages/algebra.scm gnu/packages/games.scm gnu/packages/golang.scm gnu/packages/kerberos.scm gnu/packages/mail.scm gnu/packages/python.scm gnu/packages/ruby.scm gnu/packages/scheme.scm gnu/packages/tex.scm gnu/packages/tls.scm gnu/packages/version-control.scm Marius Bakke