gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-merchant] branch master updated: conditions in test


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated: conditions in test code.
Date: Thu, 03 May 2018 15:08:27 +0200

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 9693905  conditions in test code.
9693905 is described below

commit 96939050ef7d6afe8f0d6ff5b68dbdd940c1c85e
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu May 3 15:06:20 2018 +0200

    conditions in test code.
    
    It is now possible to use a custom config file
    and purge the test database only if certains symbols
    are defined.  This is needed for the upcoming
    payment generator, as it should never purge the
    database it works on, and supposedly always use
    the ~/.config/taler.conf default database.
---
 src/lib/Makefile.am           |  1 +
 src/lib/testing_api_helpers.c | 15 +++++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 39acd3a..dbc0f07 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -127,6 +127,7 @@ test_merchant_api_new_LDADD = \
   -lgnunetcurl \
   -lgnunetutil \
   -ljansson
+test_merchant_api_new_CFLAGS = -DCUSTOM_CONFIG -DPURGE_DATABASE
 
 test_merchant_api_SOURCES = \
   test_merchant_api.c
diff --git a/src/lib/testing_api_helpers.c b/src/lib/testing_api_helpers.c
index 43ace62..dbb65bb 100644
--- a/src/lib/testing_api_helpers.c
+++ b/src/lib/testing_api_helpers.c
@@ -74,7 +74,9 @@ TALER_TESTING_run_merchant (const char *config_filename)
                                NULL, NULL, NULL,
                                "taler-merchant-httpd",
                                "taler-merchant-httpd",
+                               #ifdef CUSTOM_CONFIG
                                "-c", config_filename,
+                               #endif
                                NULL);
   if (NULL == merchant_proc)
     MERCHANT_FAIL ();
@@ -126,9 +128,6 @@ TALER_TESTING_prepare_merchant (const char *config_filename)
 {
   struct GNUNET_CONFIGURATION_Handle *cfg;
   unsigned long long port;
-  struct GNUNET_OS_Process *dbinit_proc;
-  enum GNUNET_OS_ProcessStatusType type;
-  unsigned long code;
   char *base_url;
 
   cfg = GNUNET_CONFIGURATION_create ();
@@ -161,6 +160,11 @@ TALER_TESTING_prepare_merchant (const char 
*config_filename)
     MERCHANT_FAIL ();
   }
 
+  #ifdef PURGE_DATABASE
+  struct GNUNET_OS_Process *dbinit_proc;
+  enum GNUNET_OS_ProcessStatusType type;
+  unsigned long code;
+
   /* DB preparation */
   if (NULL == (dbinit_proc = GNUNET_OS_start_process
     (GNUNET_NO,
@@ -168,7 +172,9 @@ TALER_TESTING_prepare_merchant (const char *config_filename)
      NULL, NULL, NULL,
      "taler-merchant-dbinit",
      "taler-merchant-dbinit",
+     #ifdef CUSTOM_CONFIG
      "-c", config_filename,
+     #endif
      "-r",
      NULL)))
   {
@@ -201,8 +207,9 @@ TALER_TESTING_prepare_merchant (const char *config_filename)
              " `taler-merchant-dbinit'!\n");
     MERCHANT_FAIL ();
   }
-  GNUNET_OS_process_destroy (dbinit_proc);
 
+  GNUNET_OS_process_destroy (dbinit_proc);
+  #endif
 
 
   GNUNET_asprintf (&base_url,

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]