gnunet-svn
[Top][All Lists]
Advanced

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

[taler-donau] branch master updated: fixing tests


From: gnunet
Subject: [taler-donau] branch master updated: fixing tests
Date: Mon, 08 Apr 2024 22:55:10 +0200

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

johannes-casaburi pushed a commit to branch master
in repository donau.

The following commit(s) were added to refs/heads/master by this push:
     new 2a70ca5  fixing tests
2a70ca5 is described below

commit 2a70ca5ebe860558f7ec338be6d50655a63c4de1
Author: Casaburi Johannes <johannes.casaburi@students.bfh.ch>
AuthorDate: Mon Apr 8 22:53:53 2024 +0200

    fixing tests
---
 src/donau/donau-httpd_get-charities.c   |  1 -
 src/donaudb/plugin_donaudb_postgres.c   | 10 --------
 src/donaudb/test-donau-db-postgres.conf |  2 ++
 src/donaudb/test_donaudb.c              | 42 +++++++++++++++++++++++++++++++++
 src/lib/Makefile.am                     |  7 ------
 src/util/Makefile.am                    | 15 ------------
 6 files changed, 44 insertions(+), 33 deletions(-)

diff --git a/src/donau/donau-httpd_get-charities.c 
b/src/donau/donau-httpd_get-charities.c
index 1084c76..f8faf6b 100644
--- a/src/donau/donau-httpd_get-charities.c
+++ b/src/donau/donau-httpd_get-charities.c
@@ -28,7 +28,6 @@
 #include "donau-httpd.h"
 #include "donaudb_plugin.h"
 #include "donau-httpd_charity.h"
-// #include <taler-exchange-httpd_metrics.h>
 
 
 /**
diff --git a/src/donaudb/plugin_donaudb_postgres.c 
b/src/donaudb/plugin_donaudb_postgres.c
index 877fb54..ca42b47 100644
--- a/src/donaudb/plugin_donaudb_postgres.c
+++ b/src/donaudb/plugin_donaudb_postgres.c
@@ -39,16 +39,6 @@
 #include "pg_event_listen.h"
 #include "pg_event_listen_cancel.h"
 #include "pg_event_notify.h"
-// #include "pg_get_policy_details.h"
-// #include "pg_persist_policy_details.h"
-// #include "pg_gc.h"
-// #include "pg_begin_shard.h"
-// #include "pg_abort_shard.h"
-// #include "pg_complete_shard.h"
-// #include "pg_release_revolving_shard.h"
-// #include "pg_delete_shard_locks.h"
-// #include "pg_compute_shard.h"
-
 #include "pg_insert_donation_unit.h"
 #include "pg_iterate_donation_units.h"
 #include "pg_insert_history_entry.h"
diff --git a/src/donaudb/test-donau-db-postgres.conf 
b/src/donaudb/test-donau-db-postgres.conf
index 1f21a89..4d9b3cd 100644
--- a/src/donaudb/test-donau-db-postgres.conf
+++ b/src/donaudb/test-donau-db-postgres.conf
@@ -4,6 +4,8 @@ DB = postgres
 
 BASE_URL = http://localhost/
 
+CURRENCY = EUR
+
 [donaudb-postgres]
 
 #The connection string the plugin has to use for connecting to the database
diff --git a/src/donaudb/test_donaudb.c b/src/donaudb/test_donaudb.c
index 7f0ccbf..6854793 100644
--- a/src/donaudb/test_donaudb.c
+++ b/src/donaudb/test_donaudb.c
@@ -65,6 +65,48 @@ static int result;
  */
 static struct DONAUDB_Plugin *plugin;
 
+
+/**
+ * Main function that will be run by the scheduler.
+ *
+ * @param cls closure with config
+ */
+static void
+run (void *cls)
+{
+  struct GNUNET_CONFIGURATION_Handle *cfg = cls;
+
+  if (NULL ==
+      (plugin = DONAUDB_plugin_load (cfg)))
+  {
+    result = 77;
+    return;
+  }
+  (void) plugin->drop_tables (plugin->cls);
+  if (GNUNET_OK !=
+      plugin->create_tables (plugin->cls))
+  {
+    result = 77;
+    goto cleanup;
+  }
+  plugin->preflight (plugin->cls);
+  FAILIF (GNUNET_OK !=
+          plugin->start (plugin->cls,
+                         "test-1"));
+
+// TODO Add tests
+
+drop:
+  if (0 != result)
+    plugin->rollback (plugin->cls);
+  GNUNET_break (GNUNET_OK ==
+                plugin->drop_tables (plugin->cls));
+cleanup:
+  DONAUDB_plugin_unload (plugin);
+  plugin = NULL;
+}
+
+
 int
 main (int argc,
       char *const argv[])
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 6d73e03..0679a90 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -41,10 +41,3 @@ libdonau_la_LIBADD = \
        $(LIBGNURLCURL_LIBS) \
        $(XLIB)
 
-.NOTPARALLEL:
-check_PROGRAMS = \
-  test_donau_api_cs \
-  test_donau_api_rsa 
-
-TESTS = \
-  $(check_PROGRAMS)
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index 12772c4..8c7663e 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -60,18 +60,3 @@ libdonauutil_la_LDFLAGS = \
   -version-info 0:0:0 \
   -no-undefined
 
-AM_TESTS_ENVIRONMENT=export TALER_PREFIX=$${TALER_PREFIX:-@libdir@};export 
PATH=$${TALER_PREFIX:-@prefix@}/bin:$$PATH;
-
-check_PROGRAMS = \
- test_crypto
-
-TESTS = \
- $(check_PROGRAMS)
-
-test_crypto_SOURCES = \
-  test_crypto.c
-test_crypto_LDADD = \
-  libdonauutil.la \
-  -ltalerutil \
-  -lgnunetutil 
-

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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