[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r3290 - in GNUnet: . src/util/os
From: |
grothoff |
Subject: |
[GNUnet-SVN] r3290 - in GNUnet: . src/util/os |
Date: |
Wed, 23 Aug 2006 18:47:41 -0700 (PDT) |
Author: grothoff
Date: 2006-08-23 18:47:36 -0700 (Wed, 23 Aug 2006)
New Revision: 3290
Modified:
GNUnet/README
GNUnet/src/util/os/Makefile.am
GNUnet/src/util/os/daemontest.c
GNUnet/src/util/os/semaphore.c
GNUnet/src/util/os/semaphoretest.c
Log:
syn
Modified: GNUnet/README
===================================================================
--- GNUnet/README 2006-08-22 02:04:23 UTC (rev 3289)
+++ GNUnet/README 2006-08-24 01:47:36 UTC (rev 3290)
@@ -28,9 +28,12 @@
- libextractor >= 0.5.13
- libgcrypt >= 1.2
- libgmp >= 4.0
-- mysql >= 4.1 OR sqlite >= 3.0
-- libltdl (from libtool)
+- mysql >= 4.1 OR sqlite >= 3.0
+- libltdl >= 1.5 (part of GNU libtool)
+- libguile >= 1.8
+- libcurl >= 7.x
+
Recommended autotools for compiling the SVN version are:
- autoconf >= 2.59
- automake >= 1.9.4
@@ -165,7 +168,22 @@
report bugs can be found in the GNUnet FAQ on the webpage. Submit
patches via E-Mail to address@hidden
+In order to run the unit tests with "make check", you need to
+set an environment variable ("GNUNET_PREFIX") to the directory
+where GNUnet is installed (usually, GNUnet will use OS specific
+tricks in order to try to figure out the PREFIX, but since the
+testcase binaries are not installed, that trick does not work
+for them). Also, before running any testcases, you must
+complete the installation first. Quick summary:
+$ ./configure --prefix=$SOMEWHERE
+$ make
+$ make install
+$ export GNUNET_PREFIX=$SOMEWHERE
+$ make check
+
+
+
Stay tuned
==========
Modified: GNUnet/src/util/os/Makefile.am
===================================================================
--- GNUnet/src/util/os/Makefile.am 2006-08-22 02:04:23 UTC (rev 3289)
+++ GNUnet/src/util/os/Makefile.am 2006-08-24 01:47:36 UTC (rev 3290)
@@ -29,8 +29,12 @@
daemontest_SOURCES = \
daemontest.c
daemontest_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(top_builddir)/src/util/loggers/libgnunetutil_logging.la \
+ $(top_builddir)/src/util/network_client/libgnunetutil_network_client.la \
+ $(top_builddir)/src/util/config_impl/libgnunetutil_config.la
+
semaphoretest_SOURCES = \
semaphoretest.c
semaphoretest_LDADD = \
Modified: GNUnet/src/util/os/daemontest.c
===================================================================
--- GNUnet/src/util/os/daemontest.c 2006-08-22 02:04:23 UTC (rev 3289)
+++ GNUnet/src/util/os/daemontest.c 2006-08-24 01:47:36 UTC (rev 3290)
@@ -1,6 +1,6 @@
/*
This file is part of GNUnet.
- (C) 2005 Christian Grothoff (and other contributing authors)
+ (C) 2005, 2006 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@ -18,43 +18,43 @@
Boston, MA 02111-1307, USA.
*/
/**
- * @file test/daemontest.c
+ * @file src/util/os/daemontest.c
* @brief Testcase for the daemon functions
* @author Christian Grothoff
*/
#include "gnunet_util.h"
#include "platform.h"
-static int parseCommandLine(int argc,
- char * argv[]) {
- FREENONNULL(setConfigurationString("GNUNETD",
- "_MAGIC_",
- "NO"));
- FREENONNULL(setConfigurationString("GNUNETD",
- "LOGFILE",
- NULL));
- FREENONNULL(setConfigurationString("GNUNET",
- "LOGLEVEL",
- "NOTHING"));
- FREENONNULL(setConfigurationString("GNUNET",
- "GNUNETD-CONFIG",
- "check.conf"));
- return OK;
-}
+#include "gnunet_util_config_impl.h"
+#include "gnunet_util_network_client.h"
+#include "gnunet_util_error_loggers.h"
-int main(int argc, char *argv[]) {
+int main(int argc,
+ const char *argv[]) {
int daemon;
+ struct GE_Context * ectx;
+ static struct GC_Configuration * cfg;
- if (OK != initUtil(argc,
- argv,
- &parseCommandLine))
- return -1;
- daemon = startGNUnetDaemon(NO);
+ ectx = GE_create_context_stderr(NO,
+ GE_WARNING | GE_ERROR | GE_FATAL |
+ GE_USER | GE_ADMIN | GE_DEVELOPER |
+ GE_IMMEDIATE | GE_BULK);
+ GE_setDefaultContext(ectx);
+ cfg = GC_create_C_impl();
+ GE_ASSERT(ectx, cfg != NULL);
+ os_init(ectx);
+ daemon = os_daemon_start(ectx,
+ cfg,
+ "check.conf",
+ NO);
GE_ASSERT(ectx, daemon > 0);
- GE_ASSERT(ectx, OK == waitForGNUnetDaemonRunning(30 * cronSECONDS));
- GE_ASSERT(ectx, OK == stopGNUnetDaemon());
- GE_ASSERT(ectx, OK == waitForGNUnetDaemonTermination(daemon));
- doneUtil();
+ GE_ASSERT(ectx, OK == connection_wait_for_running(ectx,
+ cfg,
+ 30 * cronSECONDS));
+ GE_ASSERT(ectx, OK == os_daemon_stop(ectx, daemon));
+
+ GC_free(cfg);
+ GE_free_context(ectx);
return 0;
}
Modified: GNUnet/src/util/os/semaphore.c
===================================================================
--- GNUnet/src/util/os/semaphore.c 2006-08-22 02:04:23 UTC (rev 3289)
+++ GNUnet/src/util/os/semaphore.c 2006-08-24 01:47:36 UTC (rev 3290)
@@ -70,7 +70,7 @@
#else
/* PORT-ME! */
#endif
-} IPC_Semaphore;
+} struct IPC_SEMAPHORE;
#if LINUX
@@ -144,7 +144,7 @@
}
#endif
-IPC_Semaphore *
+struct IPC_SEMAPHORE *
IPC_SEMAPHORE_CREATE(struct GE_Context * ectx,
const char * basename,
const unsigned int initialValue) {
@@ -152,9 +152,9 @@
#if SOLARIS || OSX || FREEBSD5
char * noslashBasename;
int i;
- IPC_Semaphore * ret;
+ struct IPC_SEMAPHORE * ret;
- ret = MALLOC(sizeof(IPC_Semaphore));
+ ret = MALLOC(sizeof(struct IPC_SEMAPHORE));
ret->ectx = ectx;
noslashBasename = STRDUP(basename);
for (i=strlen(noslashBasename);i>0;i--)
@@ -186,11 +186,11 @@
#elif WINDOWS
char * noslashBasename;
int i;
- IPC_Semaphore * ret;
+ struct IPC_SEMAPHORE * ret;
SECURITY_ATTRIBUTES sec;
DWORD dwErr;
- ret = MALLOC(sizeof(IPC_Semaphore));
+ ret = MALLOC(sizeof(struct IPC_SEMAPHORE));
ret->ectx = ectx;
noslashBasename = STRDUP(basename);
for (i=strlen(noslashBasename);i>0;i--)
@@ -224,12 +224,12 @@
struct semid_ds *buf;
ushort *array;
} semctl_arg;
- IPC_Semaphore * ret;
+ struct IPC_SEMAPHORE * ret;
key_t key;
FILE * fp;
int pcount;
- ret = MALLOC(sizeof(IPC_Semaphore));
+ ret = MALLOC(sizeof(struct IPC_SEMAPHORE));
ret->ectx = ectx;
fp = FOPEN(basename, "a+");
if (NULL == fp) {
@@ -300,9 +300,9 @@
#elif SOMEBSD
int fd;
int cnt;
- IPC_Semaphore * ret;
+ struct IPC_SEMAPHORE * ret;
- ret = MALLOC(sizeof(IPC_Semaphore));
+ ret = MALLOC(sizeof(struct IPC_SEMAPHORE));
ret->ectx = ectx;
MUTEX_CREATE(&ret->internalLock);
@@ -384,7 +384,7 @@
#endif
}
-void IPC_SEMAPHORE_UP(IPC_Semaphore * sem) {
+void IPC_SEMAPHORE_UP(struct IPC_SEMAPHORE * sem) {
if (sem == NULL) /* error on creation, optimistic execution; good luck */
return;
#if SOLARIS || OSX || FREEBSD5
@@ -447,7 +447,7 @@
}
/* FIXME: add support for mayBlock! */
-int IPC_SEMAPHORE_DOWN(IPC_Semaphore * sem,
+int IPC_SEMAPHORE_DOWN(struct IPC_SEMAPHORE * sem,
int mayBlock) {
if (sem == NULL) /* error on creation, optimistic execution; good luck */
return OK;
@@ -537,7 +537,7 @@
#endif
}
-void IPC_SEMAPHORE_DESTROY(IPC_Semaphore * sem) {
+void IPC_SEMAPHORE_DESTROY(struct IPC_SEMAPHORE * sem) {
if (sem == NULL) /* error on creation, optimistic execution; good luck */
return;
#if SOLARIS || OSX || FREEBSD5
Modified: GNUnet/src/util/os/semaphoretest.c
===================================================================
--- GNUnet/src/util/os/semaphoretest.c 2006-08-22 02:04:23 UTC (rev 3289)
+++ GNUnet/src/util/os/semaphoretest.c 2006-08-24 01:47:36 UTC (rev 3290)
@@ -28,7 +28,7 @@
#include <sys/types.h>
#ifndef MINGW /* PORT-ME MINGW */
-static IPC_Semaphore * ipc;
+static struct IPC_SEMAPHORE * ipc;
static int testIPCSemaphore() {
pid_t me;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r3290 - in GNUnet: . src/util/os,
grothoff <=