gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r21860 - in gnunet/src: include testing


From: gnunet
Subject: [GNUnet-SVN] r21860 - in gnunet/src: include testing
Date: Sun, 10 Jun 2012 19:28:57 +0200

Author: harsha
Date: 2012-06-10 19:28:57 +0200 (Sun, 10 Jun 2012)
New Revision: 21860

Modified:
   gnunet/src/include/gnunet_testing_lib-new.h
   gnunet/src/testing/testing.c
Log:
-updated documentation

Modified: gnunet/src/include/gnunet_testing_lib-new.h
===================================================================
--- gnunet/src/include/gnunet_testing_lib-new.h 2012-06-10 14:28:12 UTC (rev 
21859)
+++ gnunet/src/include/gnunet_testing_lib-new.h 2012-06-10 17:28:57 UTC (rev 
21860)
@@ -62,14 +62,16 @@
  * Create a system handle.  There must only be one system
  * handle per operating system.
  *
- * @param tmppath prefix path to use for all service homes
+ ** @param testdir only the directory name without any path. This is used for
+ *          all service homes; the directory will be created in a temporary
+ *          location depending on the underlying OS
  * @param controller hostname of the controlling host, 
  *        service configurations are modified to allow 
  *        control connections from this host; can be NULL
  * @return handle to this system, NULL on error
  */
 struct GNUNET_TESTING_System *
-GNUNET_TESTING_system_create (const char *tmppath,
+GNUNET_TESTING_system_create (const char *testdir,
                              const char *controller);
 
 
@@ -77,7 +79,7 @@
  * Free system resources.
  *
  * @param system system to be freed
- * @param remove_paths should the 'tmppath' and all subdirectories
+ * @param remove_paths should the 'testdir' and all subdirectories
  *        be removed (clean up on shutdown)?
  */
 void
@@ -223,8 +225,9 @@
  * and should thus be called directly from "main".  The testcase
  * should self-terminate by invoking 'GNUNET_SCHEDULER_shutdown'.
  *
- * @param tmppath path for storing temporary data for the test
- *        also used to setup the program name for logging
+ * @param testdir only the directory name without any path. This is used for
+ *          all service homes; the directory will be created in a temporary
+ *          location depending on the underlying OS
  * @param cfgfilename name of the configuration file to use;
  *         use NULL to only run with defaults
  * @param tm main function of the testcase
@@ -232,7 +235,7 @@
  * @return 0 on success, 1 on error
  */
 int
-GNUNET_TESTING_peer_run (const char *tmppath,
+GNUNET_TESTING_peer_run (const char *testdir,
                         const char *cfgfilename,
                         GNUNET_TESTING_TestMain tm,
                         void *tm_cls);
@@ -249,8 +252,9 @@
  * This function is useful if the testcase is for a single service
  * and if that service doesn't itself depend on other services.
  *
- * @param tmppath path for storing temporary data for the test
- *        also used to setup the program name for logging
+ * @param testdir only the directory name without any path. This is used for
+ *          all service homes; the directory will be created in a temporary
+ *          location depending on the underlying OS
  * @param service_name name of the service to run
  * @param cfgfilename name of the configuration file to use;
  *         use NULL to only run with defaults
@@ -259,7 +263,7 @@
  * @return 0 on success, 1 on error
  */
 int
-GNUNET_TESTING_service_run (const char *tmppath,
+GNUNET_TESTING_service_run (const char *testdir,
                            const char *service_name,
                            const char *cfgfilename,
                            GNUNET_TESTING_TestMain tm,

Modified: gnunet/src/testing/testing.c
===================================================================
--- gnunet/src/testing/testing.c        2012-06-10 14:28:12 UTC (rev 21859)
+++ gnunet/src/testing/testing.c        2012-06-10 17:28:57 UTC (rev 21860)
@@ -237,21 +237,24 @@
  * Create a system handle.  There must only be one system
  * handle per operating system.
  *
- * @param tmppath prefix path to use for all service homes
+ * @param testdir only the directory name without any path. This is used for
+ *          all service homes; the directory will be created in a temporary
+ *          location depending on the underlying OS
+ *
  * @param controller hostname of the controlling host, 
  *        service configurations are modified to allow 
  *        control connections from this host; can be NULL
  * @return handle to this system, NULL on error
  */
 struct GNUNET_TESTING_System *
-GNUNET_TESTING_system_create (const char *tmppath,
+GNUNET_TESTING_system_create (const char *testdir,
                              const char *controller)
 {
   struct GNUNET_TESTING_System *system;
 
-  GNUNET_assert (NULL != tmppath);
+  GNUNET_assert (NULL != testdir);
   system = GNUNET_malloc (sizeof (struct GNUNET_TESTING_System));
-  system->tmppath = GNUNET_DISK_mkdtemp (tmppath);
+  system->tmppath = GNUNET_DISK_mkdtemp (testdir);
   if (NULL == system->tmppath)
   {
     GNUNET_free (system);
@@ -272,7 +275,7 @@
  * Free system resources.
  *
  * @param system system to be freed
- * @param remove_paths should the 'tmppath' and all subdirectories
+ * @param remove_paths should the 'testdir' and all subdirectories
  *        be removed (clean up on shutdown)?
  */
 void
@@ -876,8 +879,9 @@
  * and should thus be called directly from "main".  The testcase
  * should self-terminate by invoking 'GNUNET_SCHEDULER_shutdown'.
  *
- * @param tmppath path for storing temporary data for the test
- *        also used to setup the program name for logging
+ * @param testdir only the directory name without any path. This is used for
+ *          all service homes; the directory will be created in a temporary
+ *          location depending on the underlying OS
  * @param cfgfilename name of the configuration file to use;
  *         use NULL to only run with defaults
  * @param tm main function of the testcase
@@ -885,12 +889,12 @@
  * @return 0 on success, 1 on error
  */
 int
-GNUNET_TESTING_peer_run (const char *tmppath,
+GNUNET_TESTING_peer_run (const char *testdir,
                         const char *cfgfilename,
                         GNUNET_TESTING_TestMain tm,
                         void *tm_cls)
 {
-  return GNUNET_TESTING_service_run (tmppath, "arm",
+  return GNUNET_TESTING_service_run (testdir, "arm",
                                     cfgfilename, tm, tm_cls);
 }
 
@@ -944,8 +948,9 @@
  * This function is useful if the testcase is for a single service
  * and if that service doesn't itself depend on other services.
  *
- * @param tmppath path for storing temporary data for the test,
- *        also used to setup the program name for logging
+ * @param testdir only the directory name without any path. This is used for
+ *          all service homes; the directory will be created in a temporary
+ *          location depending on the underlying OS
  * @param service_name name of the service to run
  * @param cfgfilename name of the configuration file to use;
  *         use NULL to only run with defaults
@@ -954,7 +959,7 @@
  * @return 0 on success, 1 on error
  */
 int
-GNUNET_TESTING_service_run (const char *tmppath,
+GNUNET_TESTING_service_run (const char *testdir,
                            const char *service_name,
                            const char *cfgfilename,
                            GNUNET_TESTING_TestMain tm,
@@ -965,10 +970,10 @@
   struct GNUNET_TESTING_Peer *peer;
   struct GNUNET_CONFIGURATION_Handle *cfg;
 
-  GNUNET_log_setup (tmppath,
+  GNUNET_log_setup (testdir,
                     "WARNING",
                     NULL);
-  system = GNUNET_TESTING_system_create (tmppath, "127.0.0.1");
+  system = GNUNET_TESTING_system_create (testdir, "127.0.0.1");
   if (NULL == system)
     return 1;
   cfg = GNUNET_CONFIGURATION_create ();




reply via email to

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