aboutsummaryrefslogtreecommitdiff
path: root/tests/server/util.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-04-17 09:58:42 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-04-18 22:46:04 +0200
commitd009bc2e565844db030d7098624b39b2903a808d (patch)
tree1ccef4e0c1a22960befd8bd413d6fc34e264e806 /tests/server/util.h
parent5e2f4a33fe663c2ae8cc92c02193a7261c524867 (diff)
tests: introduce preprocessed test cases
The runtests script now always performs variable replacement on the entire test source file before the test gets executed, and saves the updated version in a temporary file (log/test[num]) so that all test case readers/servers can use that version (if present) and thus enjoy the powers of test case variable substitution. This is necessary to allow complete port number freedom. Test 309 is updated to work with a non-fixed port number thanks to this.
Diffstat (limited to 'tests/server/util.h')
-rw-r--r--tests/server/util.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/server/util.h b/tests/server/util.h
index 9c3fb9f32..73f5f45f6 100644
--- a/tests/server/util.h
+++ b/tests/server/util.h
@@ -28,6 +28,7 @@ void logmsg(const char *msg, ...);
long timediff(struct timeval newer, struct timeval older);
#define TEST_DATA_PATH "%s/data/test%ld"
+#define ALTTEST_DATA_PATH "%s/log/test%ld"
#define SERVERLOGS_LOCK "log/serverlogs.lock"
@@ -53,8 +54,9 @@ void win32_init(void);
void win32_cleanup(void);
#endif /* USE_WINSOCK */
-/* returns the path name to the test case file */
-char *test2file(long testno);
+/* fopens the test case file */
+FILE *test2fopen(long testno);
+
int wait_ms(int timeout_ms);
int write_pidfile(const char *filename);
int write_portfile(const char *filename, int port);