1 /* Copyright (c) 2011-2017, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
7 #define WINDOWS_LEAN_AND_MEAN
11 #endif /* defined(_WIN32) */
15 #define SLEEP(sec) Sleep((sec)*1000)
17 #define SLEEP(sec) sleep(sec)
20 /** Trivial test program which prints out its command line arguments so we can
21 * check if tor_spawn_background() works */
23 main(int argc
, char **argv
)
30 if (!strcmp(argv
[1], "--hang")) {
32 } else if (!strcmp(argv
[1], "--fast")) {
38 fprintf(stdout
, "OUT\n");
39 fprintf(stderr
, "ERR\n");
40 for (i
= 1; i
< argc
; i
++)
41 fprintf(stdout
, "%s\n", argv
[i
]);
43 fprintf(stdout
, "SLEEPING\n");
44 /* We need to flush stdout so that test_util_spawn_background_partial_read()
45 succeed. Otherwise ReadFile() will get the entire output in one */
46 // XXX: Can we make stdio flush on newline?
50 fprintf(stdout
, "DONE\n");