aboutsummaryrefslogtreecommitdiff
path: root/tests/server
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-02-12 14:40:08 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-02-12 14:40:08 +0000
commit49ab1d914c0ae90f2c98f3433f4b27118b45835f (patch)
treec66bcd4753403af4b16a5e235b0dbd49c002d7e5 /tests/server
parentf9a6e7b68dc25c91cc3fdf63653a3bd431f1f48d (diff)
provide a source path to the servers to make them find the tests when run
outside the source dir, not needing any symlinks
Diffstat (limited to 'tests/server')
-rw-r--r--tests/server/sws.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/server/sws.c b/tests/server/sws.c
index 796806e7f..f2f465003 100644
--- a/tests/server/sws.c
+++ b/tests/server/sws.c
@@ -70,7 +70,10 @@ spitout(FILE *stream,
#define REQUEST_DUMP "log/server.input"
#define RESPONSE_DUMP "log/server.response"
-#define TEST_DATA_PATH "data/test%d"
+#define TEST_DATA_PATH "%s/data/test%d"
+
+/* global variable, where to find the 'data' dir */
+char *path=".";
enum {
DOCNUMBER_QUIT = -6,
@@ -442,7 +445,7 @@ static int send_doc(int sock,
if(0 != part_no)
sprintf(partbuf, "data%d", part_no);
- sprintf(filename, TEST_DATA_PATH, doc);
+ sprintf(filename, TEST_DATA_PATH, path, doc);
stream=fopen(filename, "rb");
if(!stream) {
@@ -537,9 +540,14 @@ int main(int argc, char *argv[])
int part_no;
FILE *pidfile;
- if(argc>1)
+ if(argc>1) {
port = atoi(argv[1]);
+ if(argc>2) {
+ path = argv[2];
+ }
+ }
+
logfp = fopen(logfile, "a");
if (!logfp) {
perror(logfile);