X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=test%2Fapi%2Ft5.c;h=5313f87128982b51ca8aa9a194eff30ab0bc6409;hp=a19de000fae902d264d2e2d2f079a35e297bd2fc;hb=d576d9f0ae1a45fef6fe3281cac1a24999fc8106;hpb=c71dc4cafd880d69e6b14b308630fbc69a7d7b23 diff --git a/test/api/t5.c b/test/api/t5.c index a19de00..5313f87 100644 --- a/test/api/t5.c +++ b/test/api/t5.c @@ -1,4 +1,4 @@ -/* $Id: t5.c,v 1.1 2004-06-14 21:43:44 adam Exp $ +/* $Id: t5.c,v 1.2 2004-06-14 23:43:32 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -24,6 +24,15 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #include +/* read zebra.cfg from env var srcdir if it exists; otherwise current dir */ +static ZebraService start_service() +{ + char cfg[256]; + char *srcdir = getenv("srcdir"); + sprintf(cfg, "%.200s%szebra.cfg", srcdir ? srcdir : "", srcdir ? "/" : ""); + return zebra_start(cfg, 0, 0); +} + static void expect(ZebraHandle zh, const char *pqf, int hits_expect, int *exit_code) { @@ -58,7 +67,7 @@ int main(int argc, char **argv) nmem_init (); - zs = zebra_start("zebra.cfg", 0, 0); + zs = start_service(); zh = zebra_open (zs); zebra_select_database(zh, "Default"); zebra_init(zh);