-/* $Id: testlib.c,v 1.20 2005-05-24 11:27:48 adam Exp $
+/* $Id: testlib.c,v 1.23 2005-06-14 20:28:54 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
/** testlib - utilities for the api tests */
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#if HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
#include <assert.h>
#include <yaz/log.h>
#include <yaz/pquery.h>
void start_log(int argc, char **argv)
{
+ int cmd_level = 0;
char logname[2048];
if (!argv)
return;
yaz_log_init_file(logname);
log_level = yaz_log_mask_str_x(argv[0], 0);
if (argc >= 2)
- log_level |= yaz_log_mask_str_x(argv[1], 0);
- yaz_log_init_level(YLOG_DEFAULT_LEVEL | log_level);
+ cmd_level |= yaz_log_mask_str_x(argv[1], 0);
+ yaz_log_init_level(YLOG_DEFAULT_LEVEL | log_level | cmd_level);
yaz_log(log_level, "starting %s", argv[0]);
}
*/
ZebraService start_up(char *cfgname, int argc, char **argv)
{
+#if HAVE_SYS_RESOURCE_H
+#if HAVE_SYS_TIME_H
+ struct rlimit rlim;
+ rlim.rlim_cur = 20;
+ rlim.rlim_max = 20;
+ setrlimit(RLIMIT_CPU, &rlim);
+#endif
+#endif
nmem_init();
start_log(argc, argv);
return start_service(cfgname);